git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@39583
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
32 files changed:
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
-// Name: cocoa/textctrl.mm
+// Name: src/cocoa/textctrl.mm
// Purpose: wxTextCtrl
// Author: David Elliott
// Modified by:
// Created: 2003/03/16
// Purpose: wxTextCtrl
// Author: David Elliott
// Modified by:
// Created: 2003/03/16
// Copyright: (c) 2003 David Elliott
// Licence: wxWidgets licence
/////////////////////////////////////////////////////////////////////////////
#include "wx/wxprec.h"
// Copyright: (c) 2003 David Elliott
// Licence: wxWidgets licence
/////////////////////////////////////////////////////////////////////////////
#include "wx/wxprec.h"
+
+#include "wx/textctrl.h"
+
#ifndef WX_PRECOMP
#include "wx/app.h"
#ifndef WX_PRECOMP
#include "wx/app.h"
- #include "wx/textctrl.h"
#include "wx/log.h"
#endif //WX_PRECOMP
#include "wx/log.h"
#endif //WX_PRECOMP
wxLogTrace(wxTRACE_COCOA_Window_Size,wxT("wxTextCtrl=%p::DoGetBestSize()==(%d,%d)"),this,size.x,size.y);
return size;
}
wxLogTrace(wxTRACE_COCOA_Window_Size,wxT("wxTextCtrl=%p::DoGetBestSize()==(%d,%d)"),this,size.x,size.y);
return size;
}
#include "wx/clrpicker.h"
#include "wx/clrpicker.h"
-#include "wx/textctrl.h"
+#ifndef WX_PRECOMP
+ #include "wx/textctrl.h"
+#endif
// ============================================================================
// ============================================================================
#include "wx/fontpicker.h"
#include "wx/fontpicker.h"
-#include "wx/textctrl.h"
+#ifndef WX_PRECOMP
+ #include "wx/textctrl.h"
+#endif
+
#include "wx/fontenum.h"
#include "wx/tokenzr.h"
#include "wx/fontenum.h"
#include "wx/tokenzr.h"
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
-// Name: common/pickerbase.cpp
+// Name: src/common/pickerbase.cpp
// Purpose: wxPickerBase class implementation
// Author: Francesco Montorsi
// Modified by:
// Purpose: wxPickerBase class implementation
// Author: Francesco Montorsi
// Modified by:
#include "wx/pickerbase.h"
#include "wx/pickerbase.h"
-#include "wx/textctrl.h"
+#ifndef WX_PRECOMP
+ #include "wx/textctrl.h"
+#endif
// ============================================================================
// implementation
// ============================================================================
// implementation
// remove any border style from our style as wxPickerBase's window must be
// invisible (user styles must be set on the textctrl or the platform-dependent picker)
style &= ~wxBORDER_MASK;
// remove any border style from our style as wxPickerBase's window must be
// invisible (user styles must be set on the textctrl or the platform-dependent picker)
style &= ~wxBORDER_MASK;
- if (!wxControl::Create(parent, id, pos, size, style | wxNO_BORDER | wxTAB_TRAVERSAL,
+ if (!wxControl::Create(parent, id, pos, size, style | wxNO_BORDER | wxTAB_TRAVERSAL,
validator, name))
return false;
validator, name))
return false;
wxASSERT(m_text);
// don't leave the textctrl empty
wxASSERT(m_text);
// don't leave the textctrl empty
- if (m_text->GetValue().IsEmpty())
+ if (m_text->GetValue().empty())
UpdateTextCtrlFromPicker();
}
UpdateTextCtrlFromPicker();
}
#include "wx/msgdlg.h"
#include "wx/cmndata.h"
#include "wx/choice.h"
#include "wx/msgdlg.h"
#include "wx/cmndata.h"
#include "wx/choice.h"
+ #include "wx/textctrl.h"
#endif
#include "wx/module.h"
#include "wx/layout.h"
#endif
#include "wx/module.h"
#include "wx/layout.h"
-#include "wx/textctrl.h"
#include "wx/textdlg.h"
#include "wx/filefn.h"
#include "wx/gdicmn.h"
#include "wx/textdlg.h"
#include "wx/filefn.h"
#include "wx/gdicmn.h"
#include "wx/checkbox.h"
#include "wx/choice.h"
#include "wx/stattext.h"
#include "wx/checkbox.h"
#include "wx/choice.h"
#include "wx/stattext.h"
+ #include "wx/textctrl.h"
-#include "wx/textctrl.h"
#include "wx/longlong.h"
#include "wx/sizer.h"
#include "wx/tokenzr.h"
#include "wx/longlong.h"
#include "wx/sizer.h"
#include "wx/tokenzr.h"
#include "wx/timer.h"
#include "wx/settings.h"
#include "wx/listbox.h"
#include "wx/timer.h"
#include "wx/settings.h"
#include "wx/listbox.h"
+ #include "wx/textctrl.h"
#endif
#include "wx/generic/treectlg.h"
#endif
#include "wx/generic/treectlg.h"
-#include "wx/textctrl.h"
#include "wx/imaglist.h"
#include "wx/renderer.h"
#include "wx/imaglist.h"
#include "wx/renderer.h"
#ifndef WX_PRECOMP
#include "wx/intl.h"
#include "wx/settings.h"
#ifndef WX_PRECOMP
#include "wx/intl.h"
#include "wx/settings.h"
+ #include "wx/textctrl.h" // for wxEVT_COMMAND_TEXT_UPDATED
#endif
#include "wx/arrstr.h"
#endif
#include "wx/arrstr.h"
-#include "wx/textctrl.h" // for wxEVT_COMMAND_TEXT_UPDATED
-
// We use GtkCombo which has been deprecated since GTK+ 2.3.0
// in favour of GtkComboBox for <GTK2.4 runtime
// We also use GtkList
// We use GtkCombo which has been deprecated since GTK+ 2.3.0
// in favour of GtkComboBox for <GTK2.4 runtime
// We also use GtkList
#ifndef WX_PRECOMP
#include "wx/wx.h"
#include "wx/log.h"
#ifndef WX_PRECOMP
#include "wx/wx.h"
#include "wx/log.h"
+ #include "wx/textctrl.h"
#endif
#include "wx/gtk/treectrl.h"
#endif
#include "wx/gtk/treectrl.h"
-#include "wx/textctrl.h"
printf("precreate\n");
PreCreation( parent, id, pos, size, style, name );
printf("precreate\n");
PreCreation( parent, id, pos, size, style, name );
gtk_widget_realize(GTK_WIDGET(m_tree));
gtk_widget_realize(GTK_WIDGET(m_tree));
}
wxTreeCtrl::~wxTreeCtrl(void) {
}
wxTreeCtrl::~wxTreeCtrl(void) {
-long wxTreeCtrl::GetNextVisibleItem(long item) const {
- GtkTreeItem *p;
- GtkTreeItem *next = NULL;
+long wxTreeCtrl::GetNextVisibleItem(long item) const
+{
+ GtkTreeItem *p;
+ GtkTreeItem *next = NULL;
- p = findGtkTreeItem(item);
- GList *list = gtk_container_get_children(GTK_CONTAINER(p));
- next = GTK_TREE_ITEM(list->data);
+ p = findGtkTreeItem(item);
+ GList *list = gtk_container_get_children(GTK_CONTAINER(p));
+ next = GTK_TREE_ITEM(list->data);
// gtk_container_foreach(GTK_CONTAINER(p), gtk_treectrl_next_visible_callback, &next);
// gtk_container_foreach(GTK_CONTAINER(p), gtk_treectrl_next_visible_callback, &next);
- if (next != NULL)
- return (long)gtk_object_get_data(GTK_OBJECT(next), "id");
+ if (next != NULL)
+ return (long)gtk_object_get_data(GTK_OBJECT(next), "id");
-bool wxTreeCtrl::GetItem(wxTreeItem& info) const {
- GtkTreeItem *p;
+bool wxTreeCtrl::GetItem(wxTreeItem& info) const
+{
+ GtkTreeItem *p;
- p = findGtkTreeItem(info.m_itemId);
+ p = findGtkTreeItem(info.m_itemId);
- if (p == NULL) {
- wxLogSysError("TreeCtrl::GetItem failed");
- return FALSE;
- }
+ if (p == NULL)
+ {
+ wxLogSysError("TreeCtrl::GetItem failed");
+ return false;
+ }
- wxConvertFromGtkTreeItem(info, p);
+ wxConvertFromGtkTreeItem(info, p);
-bool wxTreeCtrl::SetItem(wxTreeItem& info) {
- GtkTreeItem *p;
+bool wxTreeCtrl::SetItem(wxTreeItem& info)
+{
+ GtkTreeItem *p;
- p = findGtkTreeItem(info.m_itemId);
+ p = findGtkTreeItem(info.m_itemId);
- if (p == NULL) {
- wxLogSysError("TreeCtrl::SetItem failed");
- return FALSE;
- }
+ if (p == NULL)
+ {
+ wxLogSysError("TreeCtrl::SetItem failed");
+ return false;
+ }
- wxConvertToGtkTreeItem(this, info, &p);
+ wxConvertToGtkTreeItem(this, info, &p);
}
int wxTreeCtrl::GetItemState(long item, long stateMask) const {
}
int wxTreeCtrl::GetItemState(long item, long stateMask) const {
-bool wxTreeCtrl::SetItemState(long item, long state, long stateMask) {
- wxTreeItem info;
+bool wxTreeCtrl::SetItemState(long item, long state, long stateMask)
+{
+ wxTreeItem info;
- info.m_mask = wxTREE_MASK_STATE ;
- info.m_state = state;
- info.m_stateMask = stateMask;
- info.m_itemId = item;
+ info.m_mask = wxTREE_MASK_STATE ;
+ info.m_state = state;
+ info.m_stateMask = stateMask;
+ info.m_itemId = item;
-bool wxTreeCtrl::DeleteChildren(long item) {
- GtkTreeItem *p;
+bool wxTreeCtrl::DeleteChildren(long item)
+{
+ GtkTreeItem *p;
- p = findGtkTreeItem(item);
- if (p == NULL)
- return FALSE;
+ p = findGtkTreeItem(item);
+ if (p == NULL)
+ return false;
- gtk_tree_item_remove_subtree(GTK_TREE_ITEM(p));
+ gtk_tree_item_remove_subtree(GTK_TREE_ITEM(p));
#include "wx/dialog.h"
#include "wx/settings.h"
#include "wx/msgdlg.h"
#include "wx/dialog.h"
#include "wx/settings.h"
#include "wx/msgdlg.h"
+ #include "wx/textctrl.h"
#endif
#include "wx/layout.h"
#endif
#include "wx/layout.h"
#include "wx/caret.h"
#endif // wxUSE_CARET
#include "wx/caret.h"
#endif // wxUSE_CARET
-#if wxUSE_TEXTCTRL
- #include "wx/textctrl.h"
-#endif
-
#include "wx/statusbr.h"
#include "wx/fontutil.h"
#include "wx/statusbr.h"
#include "wx/fontutil.h"
#ifndef WX_PRECOMP
#include "wx/intl.h"
#include "wx/settings.h"
#ifndef WX_PRECOMP
#include "wx/intl.h"
#include "wx/settings.h"
+ #include "wx/textctrl.h" // for wxEVT_COMMAND_TEXT_UPDATED
#endif
#include "wx/arrstr.h"
#endif
#include "wx/arrstr.h"
-#include "wx/textctrl.h" // for wxEVT_COMMAND_TEXT_UPDATED
-
#include "wx/gtk1/private.h"
//-----------------------------------------------------------------------------
#include "wx/gtk1/private.h"
//-----------------------------------------------------------------------------
#ifndef WX_PRECOMP
#include "wx/utils.h"
#ifndef WX_PRECOMP
#include "wx/utils.h"
+ #include "wx/textctrl.h" // for wxEVT_COMMAND_TEXT_UPDATED
-#include "wx/textctrl.h" // for wxEVT_COMMAND_TEXT_UPDATED
#include "wx/math.h"
#include "wx/gtk1/private.h"
#include "wx/math.h"
#include "wx/gtk1/private.h"
#ifndef WX_PRECOMP
#include "wx/wx.h"
#include "wx/log.h"
#ifndef WX_PRECOMP
#include "wx/wx.h"
#include "wx/log.h"
+ #include "wx/textctrl.h"
#endif
#include "wx/gtk1/treectrl.h"
#endif
#include "wx/gtk1/treectrl.h"
-#include "wx/textctrl.h"
printf("precreate\n");
PreCreation( parent, id, pos, size, style, name );
printf("precreate\n");
PreCreation( parent, id, pos, size, style, name );
gtk_widget_realize(GTK_WIDGET(m_tree));
gtk_widget_realize(GTK_WIDGET(m_tree));
-long wxTreeCtrl::GetFirstVisibleItem(void) const {
- GtkTreeItem *next = NULL;
+long wxTreeCtrl::GetFirstVisibleItem(void) const
+{
+ GtkTreeItem *next = NULL;
- GList *list = gtk_container_children(GTK_CONTAINER(m_anchor));
- next = GTK_TREE_ITEM(list->data);
+ GList *list = gtk_container_children(GTK_CONTAINER(m_anchor));
+ next = GTK_TREE_ITEM(list->data);
// gtk_container_foreach(GTK_CONTAINER(m_anchor), gtk_treectrl_next_visible_callback, &next);
// gtk_container_foreach(GTK_CONTAINER(m_anchor), gtk_treectrl_next_visible_callback, &next);
- if (next != NULL)
- return (long)gtk_object_get_data(GTK_OBJECT(next), "id");
+ if (next != NULL)
+ return (long)gtk_object_get_data(GTK_OBJECT(next), "id");
-long wxTreeCtrl::GetNextVisibleItem(long item) const {
- GtkTreeItem *p;
- GtkTreeItem *next = NULL;
+long wxTreeCtrl::GetNextVisibleItem(long item) const
+{
+ GtkTreeItem *p;
+ GtkTreeItem *next = NULL;
- p = findGtkTreeItem(item);
- GList *list = gtk_container_children(GTK_CONTAINER(p));
- next = GTK_TREE_ITEM(list->data);
+ p = findGtkTreeItem(item);
+ GList *list = gtk_container_children(GTK_CONTAINER(p));
+ next = GTK_TREE_ITEM(list->data);
// gtk_container_foreach(GTK_CONTAINER(p), gtk_treectrl_next_visible_callback, &next);
// gtk_container_foreach(GTK_CONTAINER(p), gtk_treectrl_next_visible_callback, &next);
- if (next != NULL)
- return (long)gtk_object_get_data(GTK_OBJECT(next), "id");
+ if (next != NULL)
+ return (long)gtk_object_get_data(GTK_OBJECT(next), "id");
-bool wxTreeCtrl::GetItem(wxTreeItem& info) const {
- GtkTreeItem *p;
+bool wxTreeCtrl::GetItem(wxTreeItem& info) const
+{
+ GtkTreeItem *p;
- p = findGtkTreeItem(info.m_itemId);
+ p = findGtkTreeItem(info.m_itemId);
- if (p == NULL) {
- wxLogSysError("TreeCtrl::GetItem failed");
- return FALSE;
- }
+ if (p == NULL)
+ {
+ wxLogSysError("TreeCtrl::GetItem failed");
+ return false;
+ }
- wxConvertFromGtkTreeItem(info, p);
+ wxConvertFromGtkTreeItem(info, p);
-bool wxTreeCtrl::SetItem(wxTreeItem& info) {
- GtkTreeItem *p;
+bool wxTreeCtrl::SetItem(wxTreeItem& info)
+{
+ GtkTreeItem *p;
- p = findGtkTreeItem(info.m_itemId);
+ p = findGtkTreeItem(info.m_itemId);
- if (p == NULL) {
- wxLogSysError("TreeCtrl::SetItem failed");
- return FALSE;
- }
+ if (p == NULL)
+ {
+ wxLogSysError("TreeCtrl::SetItem failed");
+ return false;
+ }
- wxConvertToGtkTreeItem(this, info, &p);
+ wxConvertToGtkTreeItem(this, info, &p);
}
int wxTreeCtrl::GetItemState(long item, long stateMask) const {
}
int wxTreeCtrl::GetItemState(long item, long stateMask) const {
-bool wxTreeCtrl::DeleteChildren(long item) {
- GtkTreeItem *p;
+bool wxTreeCtrl::DeleteChildren(long item)
+{
+ GtkTreeItem *p;
- p = findGtkTreeItem(item);
- if (p == NULL)
- return FALSE;
+ p = findGtkTreeItem(item);
+ if (p == NULL)
+ return false;
- gtk_tree_item_remove_subtree(GTK_TREE_ITEM(p));
+ gtk_tree_item_remove_subtree(GTK_TREE_ITEM(p));
#include "wx/dialog.h"
#include "wx/settings.h"
#include "wx/msgdlg.h"
#include "wx/dialog.h"
#include "wx/settings.h"
#include "wx/msgdlg.h"
+ #include "wx/textctrl.h"
#endif
#include "wx/layout.h"
#endif
#include "wx/layout.h"
#include "wx/caret.h"
#endif // wxUSE_CARET
#include "wx/caret.h"
#endif // wxUSE_CARET
-#if wxUSE_TEXTCTRL
- #include "wx/textctrl.h"
-#endif
-
#include "wx/statusbr.h"
#include "wx/fontutil.h"
#include "wx/statusbr.h"
#include "wx/fontutil.h"
#include "wx/menu.h"
#include "wx/settings.h"
#include "wx/msgdlg.h"
#include "wx/menu.h"
#include "wx/settings.h"
#include "wx/msgdlg.h"
+ #include "wx/textctrl.h"
#endif // WXPRECOMP
#include "wx/html/helpfrm.h"
#include "wx/html/helpctrl.h"
#endif // WXPRECOMP
#include "wx/html/helpfrm.h"
#include "wx/html/helpctrl.h"
-#include "wx/textctrl.h"
#include "wx/notebook.h"
#include "wx/imaglist.h"
#include "wx/treectrl.h"
#include "wx/notebook.h"
#include "wx/imaglist.h"
#include "wx/treectrl.h"
#include "wx/menu.h"
#include "wx/settings.h"
#include "wx/msgdlg.h"
#include "wx/menu.h"
#include "wx/settings.h"
#include "wx/msgdlg.h"
+ #include "wx/textctrl.h"
#endif // WXPRECOMP
#include "wx/html/helpfrm.h"
#include "wx/html/helpdlg.h"
#include "wx/html/helpctrl.h"
#endif // WXPRECOMP
#include "wx/html/helpfrm.h"
#include "wx/html/helpdlg.h"
#include "wx/html/helpctrl.h"
-#include "wx/textctrl.h"
#include "wx/notebook.h"
#include "wx/imaglist.h"
#include "wx/treectrl.h"
#include "wx/notebook.h"
#include "wx/imaglist.h"
#include "wx/treectrl.h"
#include "wx/cursor.h"
#include "wx/dialog.h"
#include "wx/msgdlg.h"
#include "wx/cursor.h"
#include "wx/dialog.h"
#include "wx/msgdlg.h"
+ #include "wx/textctrl.h"
#endif
#include "wx/gdicmn.h"
#include "wx/module.h"
#include "wx/memory.h"
#include "wx/tooltip.h"
#endif
#include "wx/gdicmn.h"
#include "wx/module.h"
#include "wx/memory.h"
#include "wx/tooltip.h"
-#include "wx/textctrl.h"
#include "wx/docview.h"
#include "wx/filename.h"
#include "wx/docview.h"
#include "wx/filename.h"
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
+// Name: src/mac/carbon/spinbutt.cpp
// Purpose: wxSpinCtrl
// Author: Robert
// Modified by: Mark Newsam (Based on GTK file)
// Purpose: wxSpinCtrl
// Author: Robert
// Modified by: Mark Newsam (Based on GTK file)
#if wxUSE_SPINCTRL
#include "wx/spinbutt.h"
#if wxUSE_SPINCTRL
#include "wx/spinbutt.h"
+
+#ifndef WX_PRECOMP
+ #include "wx/textctrl.h"
+#endif
+
-#include "wx/textctrl.h"
#include "wx/containr.h"
// ----------------------------------------------------------------------------
#include "wx/containr.h"
// ----------------------------------------------------------------------------
: wxTextCtrl(spin , -1, value, wxDefaultPosition, wxSize(40, -1))
{
m_spin = spin;
: wxTextCtrl(spin , -1, value, wxDefaultPosition, wxSize(40, -1))
{
m_spin = spin;
// remove the default minsize, the spinctrl will have one instead
SetSizeHints(-1,-1);
}
// remove the default minsize, the spinctrl will have one instead
SetSizeHints(-1,-1);
}
{
// Hand button down events to wxSpinCtrl. Doesn't work.
if (event.GetEventType() == wxEVT_LEFT_DOWN && m_spin->ProcessEvent( event ))
{
// Hand button down events to wxSpinCtrl. Doesn't work.
if (event.GetEventType() == wxEVT_LEFT_DOWN && m_spin->ProcessEvent( event ))
return wxTextCtrl::ProcessEvent( event );
}
return wxTextCtrl::ProcessEvent( event );
}
END_EVENT_TABLE()
IMPLEMENT_DYNAMIC_CLASS(wxSpinCtrl, wxControl)
END_EVENT_TABLE()
IMPLEMENT_DYNAMIC_CLASS(wxSpinCtrl, wxControl)
BEGIN_EVENT_TABLE(wxSpinCtrl, wxControl)
BEGIN_EVENT_TABLE(wxSpinCtrl, wxControl)
- WX_EVENT_TABLE_CONTROL_CONTAINER(wxSpinCtrl)
+ WX_EVENT_TABLE_CONTROL_CONTAINER(wxSpinCtrl)
END_EVENT_TABLE()
WX_DELEGATE_TO_CONTROL_CONTAINER(wxSpinCtrl)
END_EVENT_TABLE()
WX_DELEGATE_TO_CONTROL_CONTAINER(wxSpinCtrl)
wxSize csize = size ;
m_text = new wxSpinCtrlText(this, value);
m_btn = new wxSpinCtrlButton(this, style);
wxSize csize = size ;
m_text = new wxSpinCtrlText(this, value);
m_btn = new wxSpinCtrlButton(this, style);
m_btn->SetRange(min, max);
m_btn->SetValue(initial);
m_btn->SetRange(min, max);
m_btn->SetValue(initial);
- csize.y = m_text->GetSize().y + 2 * TEXTBORDER ; //allow for text border highlights
- if ( m_btn->GetSize().y > csize.y )
- csize.y = m_btn->GetSize().y ;
+ csize.y = m_text->GetSize().y + 2 * TEXTBORDER ; //allow for text border highlights
+ if ( m_btn->GetSize().y > csize.y )
+ csize.y = m_btn->GetSize().y ;
//MacPostControlCreate(pos, csize);
SetInitialBestSize(csize);
//MacPostControlCreate(pos, csize);
SetInitialBestSize(csize);
}
wxSpinCtrl::~wxSpinCtrl()
}
wxSpinCtrl::~wxSpinCtrl()
{
if (!m_btn || !m_text)
return GetSize();
{
if (!m_btn || !m_text)
return GetSize();
wxSize sizeBtn = m_btn->GetBestSize(),
sizeText = m_text->GetBestSize();
wxSize sizeBtn = m_btn->GetBestSize(),
sizeText = m_text->GetBestSize();
height = sizeText.y;
else
height = sizeBtn.y;
height = sizeText.y;
else
height = sizeBtn.y;
return wxSize(sizeBtn.x + sizeText.x + MARGIN, height );
}
return wxSize(sizeBtn.x + sizeText.x + MARGIN, height );
}
// position the subcontrols inside the client area
wxSize sizeBtn = m_btn->GetSize();
wxSize sizeText = m_text->GetSize();
// position the subcontrols inside the client area
wxSize sizeBtn = m_btn->GetSize();
wxSize sizeText = m_text->GetSize();
wxControl::DoMoveWindow(x, y, width, height);
wxCoord wText = width - sizeBtn.x - MARGIN - 2 * TEXTBORDER;
wxControl::DoMoveWindow(x, y, width, height);
wxCoord wText = width - sizeBtn.x - MARGIN - 2 * TEXTBORDER;
m_text->SetSize(TEXTBORDER, (height - sizeText.y) / 2, wText, -1);
m_btn->SetSize(0 + wText + MARGIN + 2 * TEXTBORDER , (height - sizeBtn.y) / 2 , -1, -1 );
}
m_text->SetSize(TEXTBORDER, (height - sizeText.y) / 2, wText, -1);
m_btn->SetSize(0 + wText + MARGIN + 2 * TEXTBORDER , (height - sizeBtn.y) / 2 , -1, -1 );
}
bool wxSpinCtrl::Enable(bool enable)
{
if ( !wxControl::Enable(enable) )
bool wxSpinCtrl::Enable(bool enable)
{
if ( !wxControl::Enable(enable) )
- return FALSE;
- return TRUE;
+ return false;
+ return true;
}
bool wxSpinCtrl::Show(bool show)
{
if ( !wxControl::Show(show) )
}
bool wxSpinCtrl::Show(bool show)
{
if ( !wxControl::Show(show) )
- return FALSE;
- return TRUE;
+ return false;
+ return true;
}
// ----------------------------------------------------------------------------
}
// ----------------------------------------------------------------------------
}
int wxSpinCtrl::GetValue() const
}
int wxSpinCtrl::GetValue() const
// be selected
if ( (from == -1) && (to == -1) )
{
// be selected
if ( (from == -1) && (to == -1) )
{
}
m_text->SetSelection(from, to);
}
m_text->SetSelection(from, to);
#include "wx/msgdlg.h"
#include "wx/scrolbar.h"
#include "wx/statbox.h"
#include "wx/msgdlg.h"
#include "wx/scrolbar.h"
#include "wx/statbox.h"
+ #include "wx/textctrl.h"
#endif
#include "wx/layout.h"
#endif
#include "wx/layout.h"
#include "wx/menuitem.h"
#include "wx/spinctrl.h"
#include "wx/geometry.h"
#include "wx/menuitem.h"
#include "wx/spinctrl.h"
#include "wx/geometry.h"
-#include "wx/textctrl.h"
#include "wx/cursor.h"
#include "wx/dialog.h"
#include "wx/msgdlg.h"
#include "wx/cursor.h"
#include "wx/dialog.h"
#include "wx/msgdlg.h"
+ #include "wx/textctrl.h"
#endif
#include "wx/gdicmn.h"
#include "wx/module.h"
#include "wx/memory.h"
#include "wx/tooltip.h"
#endif
#include "wx/gdicmn.h"
#include "wx/module.h"
#include "wx/memory.h"
#include "wx/tooltip.h"
-#include "wx/textctrl.h"
#include "wx/docview.h"
#include "wx/filename.h"
#include "wx/docview.h"
#include "wx/filename.h"
+#include "wx/spinctrl.h"
+
#ifndef WX_PRECOMP
#include "wx/textctrl.h"
#endif //WX_PRECOMP
#include "wx/spinbutt.h"
#ifndef WX_PRECOMP
#include "wx/textctrl.h"
#endif //WX_PRECOMP
#include "wx/spinbutt.h"
-#include "wx/spinctrl.h"
-
-
-#include "wx/spinctrl.h"
// ----------------------------------------------------------------------------
// constants
// ----------------------------------------------------------------------------
// constants
#include "wx/log.h"
#include "wx/settings.h"
#include "wx/dcclient.h"
#include "wx/log.h"
#include "wx/settings.h"
#include "wx/dcclient.h"
+ #include "wx/textctrl.h"
-#include "wx/textctrl.h"
#include "wx/imaglist.h"
#include "wx/listctrl.h"
#include "wx/imaglist.h"
#include "wx/listctrl.h"
#include "wx/sizer.h"
#include "wx/intl.h"
#include "wx/log.h"
#include "wx/sizer.h"
#include "wx/intl.h"
#include "wx/log.h"
+ #include "wx/textctrl.h"
#endif
#if wxUSE_OWNER_DRAWN && !defined(__WXUNIVERSAL__)
#endif
#if wxUSE_OWNER_DRAWN && !defined(__WXUNIVERSAL__)
#include "wx/spinctrl.h"
#endif // wxUSE_SPINCTRL
#include "wx/spinctrl.h"
#endif // wxUSE_SPINCTRL
-#include "wx/textctrl.h"
#include "wx/notebook.h"
#include "wx/listctrl.h"
#include "wx/notebook.h"
#include "wx/listctrl.h"
// Truncate tooltip length if needed as otherwise we might not have
// enough space for it in the buffer and MultiByteToWideChar() would
// return an error
// Truncate tooltip length if needed as otherwise we might not have
// enough space for it in the buffer and MultiByteToWideChar() would
// return an error
- size_t tipLength = wxMin(ttip.Len(), WXSIZEOF(buf) - 1);
+ size_t tipLength = wxMin(ttip.length(), WXSIZEOF(buf) - 1);
// Convert to WideChar without adding the NULL character. The NULL
// character is added afterwards (this is more efficient).
// Convert to WideChar without adding the NULL character. The NULL
// character is added afterwards (this is more efficient).
#include "wx/log.h"
#include "wx/settings.h"
#include "wx/dcclient.h"
#include "wx/log.h"
#include "wx/settings.h"
#include "wx/dcclient.h"
+ #include "wx/textctrl.h"
-#include "wx/textctrl.h"
#include "wx/imaglist.h"
#include "wx/listctrl.h"
#include "wx/imaglist.h"
#include "wx/listctrl.h"
// none
//
/////////////////////////////////////////////////////////////////////////////
// none
//
/////////////////////////////////////////////////////////////////////////////
-void ConvertFromOS2ListItem (
- HWND hWndListCtrl
-, wxListItem& rInfo
-, PMYRECORD pRecord
-)
+void ConvertFromOS2ListItem ( HWND hWndListCtrl,
+ wxListItem& rInfo,
+ PMYRECORD pRecord )
- CListItemInternalData* pInternaldata = (CListItemInternalData *)pRecord->m_ulUserData;
- bool bNeedText = FALSE;
+ CListItemInternalData* pInternaldata = (CListItemInternalData *)pRecord->m_ulUserData;
+ bool bNeedText = false;
if (pInternaldata)
rInfo.SetData(pInternaldata->m_lParam);
if (pInternaldata)
rInfo.SetData(pInternaldata->m_lParam);
m_pImageListNormal = NULL;
m_pImageListSmall = NULL;
m_pImageListState = NULL;
m_pImageListNormal = NULL;
m_pImageListSmall = NULL;
m_pImageListState = NULL;
- m_bOwnsImageListNormal = FALSE;
- m_bOwnsImageListSmall = FALSE;
- m_bOwnsImageListState = FALSE;
+ m_bOwnsImageListNormal = false;
+ m_bOwnsImageListSmall = false;
+ m_bOwnsImageListState = false;
m_lBaseStyle = 0L;
m_nColCount = 0;
m_pTextCtrl = NULL;
m_lBaseStyle = 0L;
m_nColCount = 0;
m_pTextCtrl = NULL;
- m_bAnyInternalData = FALSE;
- m_bHasAnyAttr = FALSE;
+ m_bAnyInternalData = false;
+ m_bHasAnyAttr = false;
} // end of wxListCtrl::Init
} // end of wxListCtrl::Init
-bool wxListCtrl::Create (
- wxWindow* pParent
-, wxWindowID vId
-, const wxPoint& rPos
-, const wxSize& rSize
-, long lStyle
-, const wxValidator& rValidator
-, const wxString& rsName
-)
+bool wxListCtrl::Create ( wxWindow* pParent,
+ wxWindowID vId,
+ const wxPoint& rPos,
+ const wxSize& rSize,
+ long lStyle,
+ const wxValidator& rValidator,
+ const wxString& rsName )
- int nX = rPos.x;
- int nY = rPos.y;
- int nWidth = rSize.x;
- int nHeight = rSize.y;
+ int nX = rPos.x;
+ int nY = rPos.y;
+ int nWidth = rSize.x;
+ int nHeight = rSize.y;
#if wxUSE_VALIDATORS
SetValidator(rValidator);
#if wxUSE_VALIDATORS
SetValidator(rValidator);
m_windowId = (vId == -1) ? NewControlId() : vId;
m_windowId = (vId == -1) ? NewControlId() : vId;
- long lSstyle = WS_VISIBLE | WS_TABSTOP;
+ long lSstyle = WS_VISIBLE | WS_TABSTOP;
if (GetWindowStyleFlag() & wxCLIP_SIBLINGS)
lSstyle |= WS_CLIPSIBLINGS;
if (GetWindowStyleFlag() & wxCLIP_SIBLINGS)
lSstyle |= WS_CLIPSIBLINGS;
if (pParent)
pParent->AddChild(this);
if (pParent)
pParent->AddChild(this);
} // end of wxListCtrl::Create
} // end of wxListCtrl::Create
-bool wxListCtrl::DoCreateControl (
- int nX
-, int nY
-, int nWidth
-, int nHeight
-)
+bool wxListCtrl::DoCreateControl ( int nX, int nY,
+ int nWidth, int nHeight )
- DWORD lWstyle = m_lBaseStyle;
- long lOldStyle = 0; // Dummy
+ DWORD lWstyle = m_lBaseStyle;
+ long lOldStyle = 0; // Dummy
lWstyle |= ConvertToOS2Style( lOldStyle
,GetWindowStyleFlag()
lWstyle |= ConvertToOS2Style( lOldStyle
,GetWindowStyleFlag()
,MPFROMP(&vCnrInfo)
,(MPARAM)(USHORT)sizeof(CNRINFO)
))
,MPFROMP(&vCnrInfo)
,(MPARAM)(USHORT)sizeof(CNRINFO)
))
lWstyle = ConvertViewToOS2Style(GetWindowStyleFlag());
vCnrInfo.flWindowAttr |= lWstyle;
if (!::WinSendMsg( GetHWND()
lWstyle = ConvertViewToOS2Style(GetWindowStyleFlag());
vCnrInfo.flWindowAttr |= lWstyle;
if (!::WinSendMsg( GetHWND()
,MPFROMP(&vCnrInfo)
,(MPARAM)CMA_FLWINDOWATTR
))
,MPFROMP(&vCnrInfo)
,(MPARAM)CMA_FLWINDOWATTR
))
//
// And now set needed arrangement flags
//
// And now set needed arrangement flags
,(MPARAM)CMA_ARRANGEGRID
,(MPARAM)lWstyle
))
,(MPARAM)CMA_ARRANGEGRID
,(MPARAM)lWstyle
))
SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW));
SetForegroundColour(GetParent()->GetForegroundColour());
SubclassWin(m_hWnd);
SetFont(*wxSMALL_FONT);
SetXComp(0);
SetYComp(0);
SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW));
SetForegroundColour(GetParent()->GetForegroundColour());
SubclassWin(m_hWnd);
SetFont(*wxSMALL_FONT);
SetXComp(0);
SetYComp(0);
- SetSize( nX
- ,nY
- ,nWidth
- ,nHeight
- );
- return TRUE;
+ SetSize( nX, nY, nWidth, nHeight );
+ return true;
} // end of wxListCtrl::DoCreateControl
void wxListCtrl::UpdateStyle ()
{
if (GetHWND())
{
} // end of wxListCtrl::DoCreateControl
void wxListCtrl::UpdateStyle ()
{
if (GetHWND())
{
- long lDummy;
- DWORD dwStyleNew = ConvertToOS2Style( lDummy
- ,GetWindowStyleFlag()
- );
+ long lDummy;
+ DWORD dwStyleNew = ConvertToOS2Style( lDummy, GetWindowStyleFlag() );
dwStyleNew |= m_lBaseStyle;
//
// Get the current window style.
//
dwStyleNew |= m_lBaseStyle;
//
// Get the current window style.
//
- ULONG dwStyleOld = ::WinQueryWindowULong(GetHWND(), QWL_STYLE);
+ ULONG dwStyleOld = ::WinQueryWindowULong(GetHWND(), QWL_STYLE);
//
// Only set the window style if the view bits have changed.
//
// Only set the window style if the view bits have changed.
{
if (m_bAnyInternalData)
{
{
if (m_bAnyInternalData)
{
- int n = GetItemCount();
- int i = 0;
+ int n = GetItemCount();
+ int i = 0;
for (i = 0; i < n; i++)
DeleteInternalData(this, (long)i);
for (i = 0; i < n; i++)
DeleteInternalData(this, (long)i);
- m_bAnyInternalData = FALSE;
+ m_bAnyInternalData = false;
}
} // end of wxListCtrl::FreeAllInternalData
}
} // end of wxListCtrl::FreeAllInternalData
// ----------------------------------------------------------------------------
// Sets the foreground, i.e. text, colour
// ----------------------------------------------------------------------------
// Sets the foreground, i.e. text, colour
-bool wxListCtrl::SetForegroundColour (
- const wxColour& rCol)
+bool wxListCtrl::SetForegroundColour (const wxColour& rCol)
- ULONG ulColor = wxColourToRGB(rCol);
+ ULONG ulColor = wxColourToRGB(rCol);
if (!wxWindow::SetForegroundColour(rCol))
if (!wxWindow::SetForegroundColour(rCol))
::WinSetPresParam( GetHWND()
,PP_FOREGROUNDCOLOR
,sizeof(ULONG)
,&ulColor
);
::WinSetPresParam( GetHWND()
,PP_FOREGROUNDCOLOR
,sizeof(ULONG)
,&ulColor
);
} // end of wxListCtrl::SetForegroundColour
// Sets the background colour
} // end of wxListCtrl::SetForegroundColour
// Sets the background colour
-bool wxListCtrl::SetBackgroundColour (
- const wxColour& rCol
-)
+bool wxListCtrl::SetBackgroundColour ( const wxColour& rCol )
{
if (!wxWindow::SetBackgroundColour(rCol))
{
if (!wxWindow::SetBackgroundColour(rCol))
//
// We set the same colour for both the "empty" background and the items
// background
//
//
// We set the same colour for both the "empty" background and the items
// background
//
- ULONG ulColor = wxColourToRGB(rCol);
+ ULONG ulColor = wxColourToRGB(rCol);
::WinSetPresParam( GetHWND()
,PP_BACKGROUNDCOLOR
,sizeof(ULONG)
,&ulColor
);
::WinSetPresParam( GetHWND()
,PP_BACKGROUNDCOLOR
,sizeof(ULONG)
,&ulColor
);
} // end of wxListCtrl::SetBackgroundColour
// Gets information about this column
} // end of wxListCtrl::SetBackgroundColour
// Gets information about this column
-bool wxListCtrl::GetColumn (
- int nCol
-, wxListItem& rItem
-) const
+bool wxListCtrl::GetColumn ( int nCol, wxListItem& rItem ) const
- PFIELDINFO pFieldInfo = FindOS2ListFieldByColNum ( GetHWND()
- ,nCol
- );
+ PFIELDINFO pFieldInfo = FindOS2ListFieldByColNum ( GetHWND(), nCol );
rItem.SetWidth(pFieldInfo->cxWidth);
if ((rItem.GetMask() & wxLIST_MASK_TEXT) &&
(pFieldInfo->flData & CFA_STRING) &&
rItem.SetWidth(pFieldInfo->cxWidth);
if ((rItem.GetMask() & wxLIST_MASK_TEXT) &&
(pFieldInfo->flData & CFA_STRING) &&
else if (pFieldInfo->flData & CFA_CENTER)
rItem.m_format = wxLIST_FORMAT_CENTRE;
}
else if (pFieldInfo->flData & CFA_CENTER)
rItem.m_format = wxLIST_FORMAT_CENTRE;
}
} // end of wxListCtrl::GetColumn
// Sets information about this column
} // end of wxListCtrl::GetColumn
// Sets information about this column
-bool wxListCtrl::SetColumn (
- int nCol
-, wxListItem& rItem
-)
+bool wxListCtrl::SetColumn ( int nCol, wxListItem& rItem )
- PFIELDINFO pFieldInfo = FindOS2ListFieldByColNum( GetHWND()
- ,nCol
- );
- ConvertToOS2ListCol( nCol
- ,rItem
- ,pFieldInfo
- );
+ PFIELDINFO pFieldInfo = FindOS2ListFieldByColNum( GetHWND(), nCol );
+ ConvertToOS2ListCol( nCol, rItem, pFieldInfo );
//
// Since we changed the field pointed to, we invalidate to see the result
//
::WinSendMsg(GetHWND(), CM_INVALIDATEDETAILFIELDINFO, NULL, NULL);
//
// Since we changed the field pointed to, we invalidate to see the result
//
::WinSendMsg(GetHWND(), CM_INVALIDATEDETAILFIELDINFO, NULL, NULL);
} // end of wxListCtrl::SetColumn
// Gets the column width
} // end of wxListCtrl::SetColumn
// Gets the column width
-int wxListCtrl::GetColumnWidth (
- int nCol
-) const
+int wxListCtrl::GetColumnWidth ( int nCol ) const
- PFIELDINFO pFieldInfo = FindOS2ListFieldByColNum ( GetHWND()
- ,nCol
- );
+ PFIELDINFO pFieldInfo = FindOS2ListFieldByColNum ( GetHWND(), nCol );
if (!pFieldInfo)
return 0;
if (!pFieldInfo)
return 0;
} // end of wxListCtrl::GetColumnWidth
// Sets the column width
} // end of wxListCtrl::GetColumnWidth
// Sets the column width
-bool wxListCtrl::SetColumnWidth (
- int nCol
-, int nWidth
-)
+bool wxListCtrl::SetColumnWidth ( int nCol, int nWidth )
- int nCol2 = nCol;
- int nWidth2 = nWidth;
+ int nCol2 = nCol;
+ int nWidth2 = nWidth;
if (GetWindowStyleFlag() & wxLC_LIST)
nCol2 = -1;
if (GetWindowStyleFlag() & wxLC_LIST)
nCol2 = -1;
- PFIELDINFO pFieldInfo = FindOS2ListFieldByColNum( GetHWND()
- ,nCol
- );
+ PFIELDINFO pFieldInfo = FindOS2ListFieldByColNum( GetHWND(), nCol );
pFieldInfo->cxWidth = nWidth;
::WinSendMsg(GetHWND(), CM_INVALIDATEDETAILFIELDINFO, NULL, NULL);
pFieldInfo->cxWidth = nWidth;
::WinSendMsg(GetHWND(), CM_INVALIDATEDETAILFIELDINFO, NULL, NULL);
} // end of wxListCtrl::SetColumnWidth
// Gets the number of items that can fit vertically in the
} // end of wxListCtrl::SetColumnWidth
// Gets the number of items that can fit vertically in the
}
// Gets information about the item
}
// Gets information about the item
-bool wxListCtrl::GetItem (
- wxListItem& rInfo
-) const
+bool wxListCtrl::GetItem ( wxListItem& rInfo ) const
- PMYRECORD pRecord = FindOS2ListRecordByID( GetHWND()
- ,rInfo.GetId()
- );
+ PMYRECORD pRecord = FindOS2ListRecordByID( GetHWND(), rInfo.GetId() );
//
// Give NULL as hwnd as we already have everything we need
//
//
// Give NULL as hwnd as we already have everything we need
//
- ConvertFromOS2ListItem( NULL
- ,rInfo
- ,pRecord
- );
- return TRUE;
+ ConvertFromOS2ListItem( NULL, rInfo, pRecord );
+ return true;
} // end of wxListCtrl::GetItem
// Sets information about the item
} // end of wxListCtrl::GetItem
// Sets information about the item
-bool wxListCtrl::SetItem (
- wxListItem& rInfo
-)
+bool wxListCtrl::SetItem ( wxListItem& rInfo )
- PFIELDINFO pFieldInfo = FindOS2ListFieldByColNum ( GetHWND()
- ,rInfo.GetColumn()
- );
- PMYRECORD pRecord = FindOS2ListRecordByID( GetHWND()
- ,rInfo.GetId()
- );
+ PFIELDINFO pFieldInfo = FindOS2ListFieldByColNum ( GetHWND(), rInfo.GetColumn() );
+ PMYRECORD pRecord = FindOS2ListRecordByID( GetHWND(), rInfo.GetId() );
ConvertToOS2ListItem( this
,rInfo
ConvertToOS2ListItem( this
,rInfo
- m_bAnyInternalData = TRUE;
+ m_bAnyInternalData = true;
pData = new CListItemInternalData();
pRecord->m_ulUserData = (unsigned long)pData;
};
pData = new CListItemInternalData();
pRecord->m_ulUserData = (unsigned long)pData;
};
//
// We need to update the item immediately to show the new image
//
//
// We need to update the item immediately to show the new image
//
- bool bUpdateNow = (rInfo.GetMask() & wxLIST_MASK_IMAGE) != 0;
+ bool bUpdateNow = (rInfo.GetMask() & wxLIST_MASK_IMAGE) != 0;
//
// Check whether it has any custom attributes
//
if (rInfo.HasAttributes())
{
//
// Check whether it has any custom attributes
//
if (rInfo.HasAttributes())
{
//
// If the colour has changed, we must redraw the item
//
//
// If the colour has changed, we must redraw the item
//
}
if (::WinIsWindowVisible(GetHWND()))
{
}
if (::WinIsWindowVisible(GetHWND()))
{
} // end of wxListCtrl::SetItem
long wxListCtrl::SetItem (
} // end of wxListCtrl::SetItem
long wxListCtrl::SetItem (
} // end of wxListCtrl::GetItemState
// Sets the item state
} // end of wxListCtrl::GetItemState
// Sets the item state
-bool wxListCtrl::SetItemState (
- long lItem
-, long lState
-, long lStateMask
-)
+bool wxListCtrl::SetItemState ( long lItem, long lState, long lStateMask )
- PMYRECORD pRecord = FindOS2ListRecordByID( GetHWND()
- ,lItem
- );
+ PMYRECORD pRecord = FindOS2ListRecordByID( GetHWND(), lItem );
//
// Don't use SetItem() here as it doesn't work with the virtual list
// controls
//
//
// Don't use SetItem() here as it doesn't work with the virtual list
// controls
//
- ConvertToOS2Flags( lState
- ,pRecord
- );
+ ConvertToOS2Flags( lState, pRecord );
//
// for the virtual list controls we need to refresh the previously focused
//
// for the virtual list controls we need to refresh the previously focused
RefreshItem(lFocusOld);
}
}
RefreshItem(lFocusOld);
}
}
} // end of wxListCtrl::SetItemState
// Sets the item image
} // end of wxListCtrl::SetItemState
// Sets the item image
} // end of wxListCtrl::SetItemData
// Gets the item rectangle
} // end of wxListCtrl::SetItemData
// Gets the item rectangle
-bool wxListCtrl::GetItemRect (
- long lItem
-, wxRect& rRect
-, int nCode
-) const
+bool wxListCtrl::GetItemRect ( long lItem,
+ wxRect& rRect,
+ int nCode ) const
- bool bSuccess;
- PMYRECORD pRecord = FindOS2ListRecordByID( GetHWND()
- ,lItem
- );
- QUERYRECORDRECT vQueryRect;
- RECTL vRect;
- int nHeight;
+ bool bSuccess;
+ PMYRECORD pRecord = FindOS2ListRecordByID( GetHWND(), lItem );
+ QUERYRECORDRECT vQueryRect;
+ RECTL vRect;
+ int nHeight;
vQueryRect.cb = sizeof(QUERYRECORDRECT);
vQueryRect.pRecord = &pRecord->m_vRecord;
vQueryRect.fRightSplitWindow = TRUE;
vQueryRect.cb = sizeof(QUERYRECORDRECT);
vQueryRect.pRecord = &pRecord->m_vRecord;
vQueryRect.fRightSplitWindow = TRUE;
//
// remember OS/2 is backwards
//
//
// remember OS/2 is backwards
//
- GetClientSize( NULL
- ,&nHeight
- );
+ GetClientSize( NULL, &nHeight );
rRect.x = vRect.xLeft;
rRect.y = nHeight - vRect.yTop;
rRect.width = vRect.xRight;
rRect.height = nHeight - vRect.yBottom;
rRect.x = vRect.xLeft;
rRect.y = nHeight - vRect.yTop;
rRect.width = vRect.xRight;
rRect.height = nHeight - vRect.yBottom;
return bSuccess;
} // end of wxListCtrl::GetItemRect
// Gets the item position
return bSuccess;
} // end of wxListCtrl::GetItemRect
// Gets the item position
-bool wxListCtrl::GetItemPosition (
- long lItem
-, wxPoint& rPos
-) const
+bool wxListCtrl::GetItemPosition ( long lItem, wxPoint& rPos ) const
- bool bSuccess;
- PMYRECORD pRecord = FindOS2ListRecordByID( GetHWND()
- ,lItem
- );
- QUERYRECORDRECT vQueryRect;
- RECTL vRect;
- int nHeight;
+ bool bSuccess;
+ PMYRECORD pRecord = FindOS2ListRecordByID( GetHWND() , lItem );
+ QUERYRECORDRECT vQueryRect;
+ RECTL vRect;
+ int nHeight;
vQueryRect.cb = sizeof(QUERYRECORDRECT);
vQueryRect.pRecord = &pRecord->m_vRecord;
vQueryRect.fRightSplitWindow = TRUE;
vQueryRect.cb = sizeof(QUERYRECORDRECT);
vQueryRect.pRecord = &pRecord->m_vRecord;
vQueryRect.fRightSplitWindow = TRUE;
//
// remember OS/2 is backwards
//
//
// remember OS/2 is backwards
//
- GetClientSize( NULL
- ,&nHeight
- );
+ GetClientSize( NULL, &nHeight );
rPos.x = vRect.xLeft;
rPos.y = nHeight - vRect.yTop;
rPos.x = vRect.xLeft;
rPos.y = nHeight - vRect.yTop;
return bSuccess;
} // end of wxListCtrl::GetItemPosition
// Sets the item position.
return bSuccess;
} // end of wxListCtrl::GetItemPosition
// Sets the item position.
-bool wxListCtrl::SetItemPosition (
- long lItem
-, const wxPoint& rPos
-)
+bool wxListCtrl::SetItemPosition ( long lItem, const wxPoint& rPos )
{
//
// Items cannot be positioned in X/Y coord in OS/2
//
{
//
// Items cannot be positioned in X/Y coord in OS/2
//
} // end of wxListCtrl::SetItemPosition
// Gets the number of items in the list control
} // end of wxListCtrl::SetItemPosition
// Gets the number of items in the list control
} // end of wxListCtrl::GetItemCount
// Retrieves the spacing between icons in pixels.
} // end of wxListCtrl::GetItemCount
// Retrieves the spacing between icons in pixels.
-// If small is TRUE, gets the spacing for the small icon
+// If bIsSmall is true, gets the spacing for the small icon
// view, otherwise the large icon view.
// view, otherwise the large icon view.
-int wxListCtrl::GetItemSpacing (
- bool bIsSmall
-) const
+int wxListCtrl::GetItemSpacing ( bool bIsSmall ) const
return NULL;
} // end of wxListCtrl::GetImageList
return NULL;
} // end of wxListCtrl::GetImageList
-void wxListCtrl::SetImageList (
- wxImageList* pImageList
-, int nWhich
-)
+void wxListCtrl::SetImageList ( wxImageList* pImageList,
+ int nWhich )
{
if (nWhich == wxIMAGE_LIST_NORMAL)
{
if (m_bOwnsImageListNormal)
delete m_pImageListNormal;
m_pImageListNormal = pImageList;
{
if (nWhich == wxIMAGE_LIST_NORMAL)
{
if (m_bOwnsImageListNormal)
delete m_pImageListNormal;
m_pImageListNormal = pImageList;
- m_bOwnsImageListNormal = FALSE;
+ m_bOwnsImageListNormal = false;
}
else if (nWhich == wxIMAGE_LIST_SMALL)
{
if (m_bOwnsImageListSmall)
delete m_pImageListSmall;
m_pImageListSmall = pImageList;
}
else if (nWhich == wxIMAGE_LIST_SMALL)
{
if (m_bOwnsImageListSmall)
delete m_pImageListSmall;
m_pImageListSmall = pImageList;
- m_bOwnsImageListSmall = FALSE;
+ m_bOwnsImageListSmall = false;
}
else if (nWhich == wxIMAGE_LIST_STATE)
{
if (m_bOwnsImageListState)
delete m_pImageListState;
m_pImageListState = pImageList;
}
else if (nWhich == wxIMAGE_LIST_STATE)
{
if (m_bOwnsImageListState)
delete m_pImageListState;
m_pImageListState = pImageList;
- m_bOwnsImageListState = FALSE;
+ m_bOwnsImageListState = false;
}
} // end of wxListCtrl::SetImageList
}
} // end of wxListCtrl::SetImageList
-void wxListCtrl::AssignImageList (
- wxImageList* pImageList
-, int nWhich
-)
+void wxListCtrl::AssignImageList ( wxImageList* pImageList, int nWhich )
- SetImageList( pImageList
- ,nWhich
- );
+ SetImageList( pImageList, nWhich );
+
if (nWhich == wxIMAGE_LIST_NORMAL )
if (nWhich == wxIMAGE_LIST_NORMAL )
- m_bOwnsImageListNormal = TRUE;
+ m_bOwnsImageListNormal = true;
else if (nWhich == wxIMAGE_LIST_SMALL )
else if (nWhich == wxIMAGE_LIST_SMALL )
- m_bOwnsImageListSmall = TRUE;
+ m_bOwnsImageListSmall = true;
else if (nWhich == wxIMAGE_LIST_STATE )
else if (nWhich == wxIMAGE_LIST_STATE )
- m_bOwnsImageListState = TRUE;
+ m_bOwnsImageListState = true;
} // end of wxListCtrl::AssignImageList
// ----------------------------------------------------------------------------
} // end of wxListCtrl::AssignImageList
// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
// Arranges the items
// ----------------------------------------------------------------------------
// Arranges the items
-bool wxListCtrl::Arrange (
- int nFlag
-)
+bool wxListCtrl::Arrange ( int nFlag )
- ULONG ulType = 0L;
- ULONG ulFlags = 0L;
+ ULONG ulType = 0L;
+ ULONG ulFlags = 0L;
if (nFlag == wxLIST_ALIGN_SNAP_TO_GRID)
{
if (nFlag == wxLIST_ALIGN_SNAP_TO_GRID)
{
//
// We do not support CMA_ARRANGESELECTED
//
//
// We do not support CMA_ARRANGESELECTED
//
} // end of wxListCtrl::Arrange
// Deletes an item
} // end of wxListCtrl::Arrange
// Deletes an item
-bool wxListCtrl::DeleteItem (
- long lItem
-)
+bool wxListCtrl::DeleteItem ( long lItem )
- PMYRECORD pRecord = FindOS2ListRecordByID( GetHWND()
- ,lItem
- );
+ PMYRECORD pRecord = FindOS2ListRecordByID( GetHWND(), lItem );
if (LONGFROMMR(::WinSendMsg( GetHWND()
,CM_REMOVERECORD
,(MPARAM)pRecord
,MPFROM2SHORT(1, CMA_FREE)
)) == -1L)
{
if (LONGFROMMR(::WinSendMsg( GetHWND()
,CM_REMOVERECORD
,(MPARAM)pRecord
,MPFROM2SHORT(1, CMA_FREE)
)) == -1L)
{
vRectWin.y = vRectItem.GetBottom();
RefreshRect(vRectWin);
}
vRectWin.y = vRectItem.GetBottom();
RefreshRect(vRectWin);
}
} // end of wxListCtrl::DeleteItem
// Deletes all items
} // end of wxListCtrl::DeleteItem
// Deletes all items
}
wxASSERT_MSG(m_nColCount == 0, wxT("no columns should be left"));
}
wxASSERT_MSG(m_nColCount == 0, wxT("no columns should be left"));
} // end of wxListCtrl::DeleteAllColumns
// Deletes a column
} // end of wxListCtrl::DeleteAllColumns
// Deletes a column
-bool wxListCtrl::DeleteColumn (
- int nCol
-)
+bool wxListCtrl::DeleteColumn ( int nCol )
- bool bSuccess = FALSE;
- PFIELDINFO pField = FindOS2ListFieldByColNum( GetHWND()
- ,nCol
- );
+ bool bSuccess = false;
+ PFIELDINFO pField = FindOS2ListFieldByColNum( GetHWND(), nCol );
bSuccess = ((LONG)::WinSendMsg( GetHWND()
,CM_REMOVEDETAILFIELDINFO
,MPFROMP(pField)
bSuccess = ((LONG)::WinSendMsg( GetHWND()
,CM_REMOVEDETAILFIELDINFO
,MPFROMP(pField)
// End label editing, optionally cancelling the edit. Under OS/2 you close
// the record for editting
// End label editing, optionally cancelling the edit. Under OS/2 you close
// the record for editting
-bool wxListCtrl::EndEditLabel (
- bool WXUNUSED(bCancel)
-)
+bool wxListCtrl::EndEditLabel ( bool WXUNUSED(bCancel) )
{
::WinSendMsg( GetHWND()
,CM_CLOSEEDIT
,(MPARAM)0
,(MPARAM)0
);
{
::WinSendMsg( GetHWND()
,CM_CLOSEEDIT
,(MPARAM)0
,(MPARAM)0
);
} // end of wxListCtrl::EndEditLabel
// Ensures this item is visible
} // end of wxListCtrl::EndEditLabel
// Ensures this item is visible
-bool wxListCtrl::EnsureVisible (
- long lItem
-)
+bool wxListCtrl::EnsureVisible ( long lItem )
- PMYRECORD pRecord = FindOS2ListRecordByID( GetHWND()
- ,lItem
- );
+ PMYRECORD pRecord = FindOS2ListRecordByID( GetHWND(), lItem );
::WinSendMsg( GetHWND()
,CM_INVALIDATERECORD
,MPFROMP(pRecord)
,MPFROM2SHORT((SHORT)1, CMA_NOREPOSITION)
);
::WinSendMsg( GetHWND()
,CM_INVALIDATERECORD
,MPFROMP(pRecord)
,MPFROM2SHORT((SHORT)1, CMA_NOREPOSITION)
);
} // end of wxListCtrl::EnsureVisible
// Find an item whose label matches this string, starting from the item after 'start'
} // end of wxListCtrl::EnsureVisible
// Find an item whose label matches this string, starting from the item after 'start'
);
if (bNeedInternalData)
{
);
if (bNeedInternalData)
{
- m_bAnyInternalData = TRUE;
+ m_bAnyInternalData = true;
//
// Internal stucture that manages data
//
// Internal stucture that manages data
// scroll the control by the given number of pixels (exception: in list view,
// dx is interpreted as number of columns)
// scroll the control by the given number of pixels (exception: in list view,
// dx is interpreted as number of columns)
-bool wxListCtrl::ScrollList (
- int nDx
-, int nDy
-)
+bool wxListCtrl::ScrollList ( int nDx, int nDy )
{
if (nDx > 0)
::WinSendMsg( GetHWND()
{
if (nDx > 0)
::WinSendMsg( GetHWND()
,(MPARAM)CMA_VERTICAL
,(MPARAM)nDy
);
,(MPARAM)CMA_VERTICAL
,(MPARAM)nDy
);
} // end of wxListCtrl::ScrollList
} // end of wxListCtrl::ScrollList
-bool wxListCtrl::SortItems (
- wxListCtrlCompare fn
-, long lData
-)
+bool wxListCtrl::SortItems ( wxListCtrlCompare fn, long lData )
- SInternalDataSort vInternalData;
+ SInternalDataSort vInternalData;
vInternalData.m_fnUser = fn;
vInternalData.m_lData = lData;
vInternalData.m_fnUser = fn;
vInternalData.m_lData = lData;
))
{
wxLogDebug(_T("CM_SORTRECORD failed"));
))
{
wxLogDebug(_T("CM_SORTRECORD failed"));
} // end of wxListCtrl::SortItems
// ----------------------------------------------------------------------------
// message processing
// ----------------------------------------------------------------------------
} // end of wxListCtrl::SortItems
// ----------------------------------------------------------------------------
// message processing
// ----------------------------------------------------------------------------
-bool wxListCtrl::OS2Command (
- WXUINT uCmd
-, WXWORD wId
-)
+bool wxListCtrl::OS2Command ( WXUINT uCmd, WXWORD wId )
{
if (uCmd == CN_ENDEDIT)
{
{
if (uCmd == CN_ENDEDIT)
{
- wxCommandEvent vEvent( wxEVT_COMMAND_TEXT_UPDATED
- ,wId
- );
+ wxCommandEvent vEvent( wxEVT_COMMAND_TEXT_UPDATED, wId );
vEvent.SetEventObject( this );
ProcessCommand(vEvent);
vEvent.SetEventObject( this );
ProcessCommand(vEvent);
}
else if (uCmd == CN_KILLFOCUS)
{
}
else if (uCmd == CN_KILLFOCUS)
{
- wxCommandEvent vEvent( wxEVT_KILL_FOCUS
- ,wId
- );
+ wxCommandEvent vEvent( wxEVT_KILL_FOCUS, wId );
vEvent.SetEventObject( this );
ProcessCommand(vEvent);
vEvent.SetEventObject( this );
ProcessCommand(vEvent);
} // end of wxListCtrl::OS2Command
// Necessary for drawing hrules and vrules, if specified
} // end of wxListCtrl::OS2Command
// Necessary for drawing hrules and vrules, if specified
-void wxListCtrl::OnPaint (
- wxPaintEvent& rEvent
-)
+void wxListCtrl::OnPaint ( wxPaintEvent& rEvent )
{
wxPaintDC vDc(this);
wxPen vPen(wxSystemSettings::GetColour( wxSYS_COLOUR_3DLIGHT)
{
wxPaintDC vDc(this);
wxPen vPen(wxSystemSettings::GetColour( wxSYS_COLOUR_3DLIGHT)
RefreshRect(vRect);
} // end of wxListCtrl::RefreshItem
RefreshRect(vRect);
} // end of wxListCtrl::RefreshItem
-void wxListCtrl::RefreshItems (
- long lItemFrom
-, long lItemTo
-)
+void wxListCtrl::RefreshItems ( long lItemFrom, long lItemTo )
- wxRect vRect1;
- wxRect vRect2;
+ wxRect vRect1;
+ wxRect vRect2;
- GetItemRect( lItemFrom
- ,vRect1
- );
- GetItemRect( lItemTo
- ,vRect2
- );
+ GetItemRect( lItemFrom , vRect1 );
+ GetItemRect( lItemTo , vRect2 );
vRect.height = vRect2.GetBottom() - vRect1.GetTop();
RefreshRect(vRect);
} // end of wxListCtrl::RefreshItems
vRect.height = vRect2.GetBottom() - vRect1.GetTop();
RefreshRect(vRect);
} // end of wxListCtrl::RefreshItems
-MRESULT wxListCtrl::OS2WindowProc(
- WXUINT uMsg
-, WXWPARAM wParam
-, WXLPARAM lParam
-)
+MRESULT wxListCtrl::OS2WindowProc( WXUINT uMsg,
+ WXWPARAM wParam,
+ WXLPARAM lParam )
- bool bProcessed = FALSE;
+ bool bProcessed = false;
MRESULT lRc;
wxListEvent vEvent( wxEVT_NULL
,m_windowId
MRESULT lRc;
wxListEvent vEvent( wxEVT_NULL
,m_windowId
#include "wx/settings.h"
#include "wx/intl.h"
#include "wx/log.h"
#include "wx/settings.h"
#include "wx/intl.h"
#include "wx/log.h"
+ #include "wx/textctrl.h"
#include <stdio.h>
#endif
#include <stdio.h>
#endif
#include "wx/caret.h"
#endif // wxUSE_CARET
#include "wx/caret.h"
#endif // wxUSE_CARET
-
-#include "wx/textctrl.h"
-
#include "wx/log.h"
#include "wx/settings.h"
#include "wx/dcclient.h"
#include "wx/log.h"
#include "wx/settings.h"
#include "wx/dcclient.h"
+ #include "wx/textctrl.h"
-#include "wx/textctrl.h"
#include "wx/imaglist.h"
#include "wx/listctrl.h"
#include "wx/imaglist.h"
#include "wx/listctrl.h"
+#include "wx/textctrl.h"
+
- #include "wx/textctrl.h"
#include "wx/settings.h"
#include "wx/brush.h"
#include "wx/utils.h"
#include "wx/settings.h"
#include "wx/brush.h"
#include "wx/utils.h"
#include "wx/statbox.h"
#include "wx/intl.h"
#include "wx/log.h"
#include "wx/statbox.h"
#include "wx/intl.h"
#include "wx/log.h"
+ #include "wx/textctrl.h"
#endif
#if wxUSE_OWNER_DRAWN && !defined(__WXUNIVERSAL__)
#endif
#if wxUSE_OWNER_DRAWN && !defined(__WXUNIVERSAL__)
#include "wx/spinctrl.h"
#endif // wxUSE_SPINCTRL
#include "wx/spinctrl.h"
#endif // wxUSE_SPINCTRL
-#include "wx/textctrl.h"
#include "wx/notebook.h"
#include "wx/listctrl.h"
#include "wx/notebook.h"
#include "wx/listctrl.h"
+#include "wx/textctrl.h"
#ifndef WX_PRECOMP
#include "wx/log.h"
#ifndef WX_PRECOMP
#include "wx/log.h"
#include "wx/dcclient.h"
#include "wx/validate.h"
#include "wx/dcclient.h"
#include "wx/validate.h"
- #include "wx/textctrl.h"
#include "wx/clipbrd.h"
#include "wx/textfile.h"
#include "wx/clipbrd.h"
#include "wx/textfile.h"
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
+// Name: src/xrc/xh_gdctl.cpp
// Purpose: XRC resource for wxGenericDirCtrl
// Author: Markus Greither
// Created: 2002/01/20
// Purpose: XRC resource for wxGenericDirCtrl
// Author: Markus Greither
// Created: 2002/01/20
// Copyright: (c) 2002 Markus Greither
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
// Copyright: (c) 2002 Markus Greither
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#if wxUSE_XRC && wxUSE_DIRDLG
#if wxUSE_XRC && wxUSE_DIRDLG
-#include "wx/textctrl.h"
#include "wx/xrc/xh_gdctl.h"
#include "wx/xrc/xh_gdctl.h"
+
+#ifndef WX_PRECOMP
+ #include "wx/textctrl.h"
+#endif
+
#include "wx/dirctrl.h"
IMPLEMENT_DYNAMIC_CLASS(wxGenericDirCtrlXmlHandler, wxXmlResourceHandler)
#include "wx/dirctrl.h"
IMPLEMENT_DYNAMIC_CLASS(wxGenericDirCtrlXmlHandler, wxXmlResourceHandler)
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
+// Name: src/xrc/xh_listc.cpp
// Purpose: XRC resource for wxListCtrl
// Author: Brian Gavin
// Created: 2000/09/09
// Purpose: XRC resource for wxListCtrl
// Author: Brian Gavin
// Created: 2000/09/09
+#if wxUSE_XRC && wxUSE_LISTCTRL
-#include "wx/textctrl.h"
#include "wx/xrc/xh_listc.h"
#include "wx/xrc/xh_listc.h"
+
+#ifndef WX_PRECOMP
+ #include "wx/textctrl.h"
+#endif
+
return IsOfClass(node, wxT("wxListCtrl"));
}
return IsOfClass(node, wxT("wxListCtrl"));
}
+#endif // wxUSE_XRC && wxUSE_LISTCTRL
+#if wxUSE_XRC && wxUSE_TEXTCTRL
#include "wx/xrc/xh_text.h"
#include "wx/xrc/xh_text.h"
-#include "wx/textctrl.h"
+
+#ifndef WX_PRECOMP
+ #include "wx/textctrl.h"
+#endif
IMPLEMENT_DYNAMIC_CLASS(wxTextCtrlXmlHandler, wxXmlResourceHandler)
IMPLEMENT_DYNAMIC_CLASS(wxTextCtrlXmlHandler, wxXmlResourceHandler)
return IsOfClass(node, wxT("wxTextCtrl"));
}
return IsOfClass(node, wxT("wxTextCtrl"));
}
+#endif // wxUSE_XRC && wxUSE_TEXTCTRL