Include wx/textctrl.h according to precompiled headers of wx/wx.h (with other minor cleaning).

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@39583 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Włodzimierz Skiba
2006-06-06 07:23:19 +00:00
parent 88f5a9ba6e
commit fec9cc08e7
32 changed files with 353 additions and 452 deletions

View File

@@ -1,18 +1,20 @@
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// Name: cocoa/textctrl.mm // Name: src/cocoa/textctrl.mm
// Purpose: wxTextCtrl // Purpose: wxTextCtrl
// Author: David Elliott // Author: David Elliott
// Modified by: // Modified by:
// Created: 2003/03/16 // Created: 2003/03/16
// RCS-ID: $Id: // RCS-ID: $Id$
// Copyright: (c) 2003 David Elliott // Copyright: (c) 2003 David Elliott
// Licence: wxWidgets licence // Licence: wxWidgets licence
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
#include "wx/wxprec.h" #include "wx/wxprec.h"
#include "wx/textctrl.h"
#ifndef WX_PRECOMP #ifndef WX_PRECOMP
#include "wx/app.h" #include "wx/app.h"
#include "wx/textctrl.h"
#include "wx/log.h" #include "wx/log.h"
#endif //WX_PRECOMP #endif //WX_PRECOMP
@@ -220,4 +222,3 @@ wxSize wxTextCtrl::DoGetBestSize() const
wxLogTrace(wxTRACE_COCOA_Window_Size,wxT("wxTextCtrl=%p::DoGetBestSize()==(%d,%d)"),this,size.x,size.y); wxLogTrace(wxTRACE_COCOA_Window_Size,wxT("wxTextCtrl=%p::DoGetBestSize()==(%d,%d)"),this,size.x,size.y);
return size; return size;
} }

View File

@@ -28,7 +28,9 @@
#include "wx/clrpicker.h" #include "wx/clrpicker.h"
#include "wx/textctrl.h" #ifndef WX_PRECOMP
#include "wx/textctrl.h"
#endif
// ============================================================================ // ============================================================================

View File

@@ -28,7 +28,10 @@
#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/fontenum.h"
#include "wx/tokenzr.h" #include "wx/tokenzr.h"

View File

@@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
// Name: common/pickerbase.cpp // Name: src/common/pickerbase.cpp
// Purpose: wxPickerBase class implementation // Purpose: wxPickerBase class implementation
// Author: Francesco Montorsi // Author: Francesco Montorsi
// Modified by: // Modified by:
@@ -26,7 +26,9 @@
#include "wx/pickerbase.h" #include "wx/pickerbase.h"
#include "wx/textctrl.h" #ifndef WX_PRECOMP
#include "wx/textctrl.h"
#endif
// ============================================================================ // ============================================================================
// implementation // implementation
@@ -107,7 +109,7 @@ void wxPickerBase::OnTextCtrlKillFocus(wxFocusEvent &)
wxASSERT(m_text); wxASSERT(m_text);
// don't leave the textctrl empty // don't leave the textctrl empty
if (m_text->GetValue().IsEmpty()) if (m_text->GetValue().empty())
UpdateTextCtrlFromPicker(); UpdateTextCtrlFromPicker();
} }

View File

@@ -31,11 +31,11 @@
#include "wx/msgdlg.h" #include "wx/msgdlg.h"
#include "wx/cmndata.h" #include "wx/cmndata.h"
#include "wx/choice.h" #include "wx/choice.h"
#include "wx/textctrl.h"
#endif #endif
#include "wx/module.h" #include "wx/module.h"
#include "wx/layout.h" #include "wx/layout.h"
#include "wx/textctrl.h"
#include "wx/textdlg.h" #include "wx/textdlg.h"
#include "wx/filefn.h" #include "wx/filefn.h"
#include "wx/gdicmn.h" #include "wx/gdicmn.h"

View File

@@ -33,9 +33,9 @@
#include "wx/checkbox.h" #include "wx/checkbox.h"
#include "wx/choice.h" #include "wx/choice.h"
#include "wx/stattext.h" #include "wx/stattext.h"
#include "wx/textctrl.h"
#endif #endif
#include "wx/textctrl.h"
#include "wx/longlong.h" #include "wx/longlong.h"
#include "wx/sizer.h" #include "wx/sizer.h"
#include "wx/tokenzr.h" #include "wx/tokenzr.h"

View File

@@ -33,10 +33,10 @@
#include "wx/timer.h" #include "wx/timer.h"
#include "wx/settings.h" #include "wx/settings.h"
#include "wx/listbox.h" #include "wx/listbox.h"
#include "wx/textctrl.h"
#endif #endif
#include "wx/generic/treectlg.h" #include "wx/generic/treectlg.h"
#include "wx/textctrl.h"
#include "wx/imaglist.h" #include "wx/imaglist.h"
#include "wx/renderer.h" #include "wx/renderer.h"

View File

@@ -17,12 +17,11 @@
#ifndef WX_PRECOMP #ifndef WX_PRECOMP
#include "wx/intl.h" #include "wx/intl.h"
#include "wx/settings.h" #include "wx/settings.h"
#include "wx/textctrl.h" // for wxEVT_COMMAND_TEXT_UPDATED
#endif #endif
#include "wx/arrstr.h" #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 // We use GtkCombo which has been deprecated since GTK+ 2.3.0
// in favour of GtkComboBox for <GTK2.4 runtime // in favour of GtkComboBox for <GTK2.4 runtime
// We also use GtkList // We also use GtkList

View File

@@ -19,10 +19,10 @@
#ifndef WX_PRECOMP #ifndef WX_PRECOMP
#include "wx/wx.h" #include "wx/wx.h"
#include "wx/log.h" #include "wx/log.h"
#include "wx/textctrl.h"
#endif #endif
#include "wx/gtk/treectrl.h" #include "wx/gtk/treectrl.h"
#include "wx/textctrl.h"
#include <gtk/gtk.h> #include <gtk/gtk.h>
@@ -103,7 +103,7 @@ bool wxTreeCtrl::Create(wxWindow *parent, wxWindowID id, const wxPoint& pos,
if (y < 0) if (y < 0)
y = 0; y = 0;
m_needParent = TRUE; m_needParent = true;
printf("precreate\n"); printf("precreate\n");
PreCreation( parent, id, pos, size, style, name ); PreCreation( parent, id, pos, size, style, name );
@@ -133,9 +133,9 @@ printf("postcreate\n");
gtk_widget_realize(GTK_WIDGET(m_tree)); gtk_widget_realize(GTK_WIDGET(m_tree));
Show(TRUE); Show(true);
return TRUE; return true;
} }
wxTreeCtrl::~wxTreeCtrl(void) { wxTreeCtrl::~wxTreeCtrl(void) {
@@ -739,49 +739,54 @@ long wxTreeCtrl::GetFirstVisibleItem(void) const {
return (-1); return (-1);
} }
long wxTreeCtrl::GetNextVisibleItem(long item) const { long wxTreeCtrl::GetNextVisibleItem(long item) const
GtkTreeItem *p; {
GtkTreeItem *next = NULL; GtkTreeItem *p;
GtkTreeItem *next = NULL;
p = findGtkTreeItem(item); p = findGtkTreeItem(item);
GList *list = gtk_container_get_children(GTK_CONTAINER(p)); GList *list = gtk_container_get_children(GTK_CONTAINER(p));
next = GTK_TREE_ITEM(list->data); 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) if (next != NULL)
return (long)gtk_object_get_data(GTK_OBJECT(next), "id"); return (long)gtk_object_get_data(GTK_OBJECT(next), "id");
return (-1); return wxNOT_FOUND;
} }
bool wxTreeCtrl::GetItem(wxTreeItem& info) const { bool wxTreeCtrl::GetItem(wxTreeItem& info) const
GtkTreeItem *p; {
GtkTreeItem *p;
p = findGtkTreeItem(info.m_itemId); p = findGtkTreeItem(info.m_itemId);
if (p == NULL) { if (p == NULL)
wxLogSysError("TreeCtrl::GetItem failed"); {
return FALSE; wxLogSysError("TreeCtrl::GetItem failed");
} return false;
}
wxConvertFromGtkTreeItem(info, p); wxConvertFromGtkTreeItem(info, p);
return TRUE; return true;
} }
bool wxTreeCtrl::SetItem(wxTreeItem& info) { bool wxTreeCtrl::SetItem(wxTreeItem& info)
GtkTreeItem *p; {
GtkTreeItem *p;
p = findGtkTreeItem(info.m_itemId); p = findGtkTreeItem(info.m_itemId);
if (p == NULL) { if (p == NULL)
wxLogSysError("TreeCtrl::SetItem failed"); {
return FALSE; wxLogSysError("TreeCtrl::SetItem failed");
} return false;
}
wxConvertToGtkTreeItem(this, info, &p); wxConvertToGtkTreeItem(this, info, &p);
return TRUE; return true;
} }
int wxTreeCtrl::GetItemState(long item, long stateMask) const { int wxTreeCtrl::GetItemState(long item, long stateMask) const {
@@ -797,30 +802,32 @@ int wxTreeCtrl::GetItemState(long item, long stateMask) const {
return info.m_state; return info.m_state;
} }
bool wxTreeCtrl::SetItemState(long item, long state, long stateMask) { bool wxTreeCtrl::SetItemState(long item, long state, long stateMask)
wxTreeItem info; {
wxTreeItem info;
info.m_mask = wxTREE_MASK_STATE ; info.m_mask = wxTREE_MASK_STATE ;
info.m_state = state; info.m_state = state;
info.m_stateMask = stateMask; info.m_stateMask = stateMask;
info.m_itemId = item; info.m_itemId = item;
return SetItem(info); return SetItem(info);
} }
*/ */
// Operations // Operations
/* /*
bool wxTreeCtrl::DeleteChildren(long item) { bool wxTreeCtrl::DeleteChildren(long item)
GtkTreeItem *p; {
GtkTreeItem *p;
p = findGtkTreeItem(item); p = findGtkTreeItem(item);
if (p == NULL) if (p == NULL)
return FALSE; return false;
gtk_tree_item_remove_subtree(GTK_TREE_ITEM(p)); gtk_tree_item_remove_subtree(GTK_TREE_ITEM(p));
return TRUE; return true;
} }
*/ */

View File

@@ -27,6 +27,7 @@
#include "wx/dialog.h" #include "wx/dialog.h"
#include "wx/settings.h" #include "wx/settings.h"
#include "wx/msgdlg.h" #include "wx/msgdlg.h"
#include "wx/textctrl.h"
#endif #endif
#include "wx/layout.h" #include "wx/layout.h"
@@ -49,10 +50,6 @@
#include "wx/caret.h" #include "wx/caret.h"
#endif // wxUSE_CARET #endif // wxUSE_CARET
#if wxUSE_TEXTCTRL
#include "wx/textctrl.h"
#endif
#include "wx/statusbr.h" #include "wx/statusbr.h"
#include "wx/fontutil.h" #include "wx/fontutil.h"

View File

@@ -17,12 +17,11 @@
#ifndef WX_PRECOMP #ifndef WX_PRECOMP
#include "wx/intl.h" #include "wx/intl.h"
#include "wx/settings.h" #include "wx/settings.h"
#include "wx/textctrl.h" // for wxEVT_COMMAND_TEXT_UPDATED
#endif #endif
#include "wx/arrstr.h" #include "wx/arrstr.h"
#include "wx/textctrl.h" // for wxEVT_COMMAND_TEXT_UPDATED
#include "wx/gtk1/private.h" #include "wx/gtk1/private.h"
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------

View File

@@ -17,9 +17,9 @@
#ifndef WX_PRECOMP #ifndef WX_PRECOMP
#include "wx/utils.h" #include "wx/utils.h"
#include "wx/textctrl.h" // for wxEVT_COMMAND_TEXT_UPDATED
#endif #endif
#include "wx/textctrl.h" // for wxEVT_COMMAND_TEXT_UPDATED
#include "wx/math.h" #include "wx/math.h"
#include "wx/gtk1/private.h" #include "wx/gtk1/private.h"

View File

@@ -19,10 +19,10 @@
#ifndef WX_PRECOMP #ifndef WX_PRECOMP
#include "wx/wx.h" #include "wx/wx.h"
#include "wx/log.h" #include "wx/log.h"
#include "wx/textctrl.h"
#endif #endif
#include "wx/gtk1/treectrl.h" #include "wx/gtk1/treectrl.h"
#include "wx/textctrl.h"
#include <gtk/gtk.h> #include <gtk/gtk.h>
@@ -103,7 +103,7 @@ bool wxTreeCtrl::Create(wxWindow *parent, wxWindowID id, const wxPoint& pos,
if (y < 0) if (y < 0)
y = 0; y = 0;
m_needParent = TRUE; m_needParent = true;
printf("precreate\n"); printf("precreate\n");
PreCreation( parent, id, pos, size, style, name ); PreCreation( parent, id, pos, size, style, name );
@@ -133,7 +133,7 @@ printf("postcreate\n");
gtk_widget_realize(GTK_WIDGET(m_tree)); gtk_widget_realize(GTK_WIDGET(m_tree));
Show(TRUE); Show(true);
return TRUE; return TRUE;
} }
@@ -728,62 +728,68 @@ long wxTreeCtrl::GetChild(long item) const {
return (-1); return (-1);
} }
long wxTreeCtrl::GetFirstVisibleItem(void) const { long wxTreeCtrl::GetFirstVisibleItem(void) const
GtkTreeItem *next = NULL; {
GtkTreeItem *next = NULL;
GList *list = gtk_container_children(GTK_CONTAINER(m_anchor)); GList *list = gtk_container_children(GTK_CONTAINER(m_anchor));
next = GTK_TREE_ITEM(list->data); 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) if (next != NULL)
return (long)gtk_object_get_data(GTK_OBJECT(next), "id"); return (long)gtk_object_get_data(GTK_OBJECT(next), "id");
return (-1); return wxNOT_FOUND;
} }
long wxTreeCtrl::GetNextVisibleItem(long item) const { long wxTreeCtrl::GetNextVisibleItem(long item) const
GtkTreeItem *p; {
GtkTreeItem *next = NULL; GtkTreeItem *p;
GtkTreeItem *next = NULL;
p = findGtkTreeItem(item); p = findGtkTreeItem(item);
GList *list = gtk_container_children(GTK_CONTAINER(p)); GList *list = gtk_container_children(GTK_CONTAINER(p));
next = GTK_TREE_ITEM(list->data); 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) if (next != NULL)
return (long)gtk_object_get_data(GTK_OBJECT(next), "id"); return (long)gtk_object_get_data(GTK_OBJECT(next), "id");
return (-1); return wxNOT_FOUND;
} }
bool wxTreeCtrl::GetItem(wxTreeItem& info) const { bool wxTreeCtrl::GetItem(wxTreeItem& info) const
GtkTreeItem *p; {
GtkTreeItem *p;
p = findGtkTreeItem(info.m_itemId); p = findGtkTreeItem(info.m_itemId);
if (p == NULL) { if (p == NULL)
wxLogSysError("TreeCtrl::GetItem failed"); {
return FALSE; wxLogSysError("TreeCtrl::GetItem failed");
} return false;
}
wxConvertFromGtkTreeItem(info, p); wxConvertFromGtkTreeItem(info, p);
return TRUE; return true;
} }
bool wxTreeCtrl::SetItem(wxTreeItem& info) { bool wxTreeCtrl::SetItem(wxTreeItem& info)
GtkTreeItem *p; {
GtkTreeItem *p;
p = findGtkTreeItem(info.m_itemId); p = findGtkTreeItem(info.m_itemId);
if (p == NULL) { if (p == NULL)
wxLogSysError("TreeCtrl::SetItem failed"); {
return FALSE; wxLogSysError("TreeCtrl::SetItem failed");
} return false;
}
wxConvertToGtkTreeItem(this, info, &p); wxConvertToGtkTreeItem(this, info, &p);
return TRUE; return true;
} }
int wxTreeCtrl::GetItemState(long item, long stateMask) const { int wxTreeCtrl::GetItemState(long item, long stateMask) const {
@@ -813,16 +819,17 @@ bool wxTreeCtrl::SetItemState(long item, long state, long stateMask) {
// Operations // Operations
/* /*
bool wxTreeCtrl::DeleteChildren(long item) { bool wxTreeCtrl::DeleteChildren(long item)
GtkTreeItem *p; {
GtkTreeItem *p;
p = findGtkTreeItem(item); p = findGtkTreeItem(item);
if (p == NULL) if (p == NULL)
return FALSE; return false;
gtk_tree_item_remove_subtree(GTK_TREE_ITEM(p)); gtk_tree_item_remove_subtree(GTK_TREE_ITEM(p));
return TRUE; return true;
} }
*/ */

View File

@@ -27,6 +27,7 @@
#include "wx/dialog.h" #include "wx/dialog.h"
#include "wx/settings.h" #include "wx/settings.h"
#include "wx/msgdlg.h" #include "wx/msgdlg.h"
#include "wx/textctrl.h"
#endif #endif
#include "wx/layout.h" #include "wx/layout.h"
@@ -45,10 +46,6 @@
#include "wx/caret.h" #include "wx/caret.h"
#endif // wxUSE_CARET #endif // wxUSE_CARET
#if wxUSE_TEXTCTRL
#include "wx/textctrl.h"
#endif
#include "wx/statusbr.h" #include "wx/statusbr.h"
#include "wx/fontutil.h" #include "wx/fontutil.h"

View File

@@ -36,11 +36,11 @@
#include "wx/menu.h" #include "wx/menu.h"
#include "wx/settings.h" #include "wx/settings.h"
#include "wx/msgdlg.h" #include "wx/msgdlg.h"
#include "wx/textctrl.h"
#endif // WXPRECOMP #endif // WXPRECOMP
#include "wx/html/helpfrm.h" #include "wx/html/helpfrm.h"
#include "wx/html/helpctrl.h" #include "wx/html/helpctrl.h"
#include "wx/textctrl.h"
#include "wx/notebook.h" #include "wx/notebook.h"
#include "wx/imaglist.h" #include "wx/imaglist.h"
#include "wx/treectrl.h" #include "wx/treectrl.h"

View File

@@ -36,12 +36,12 @@
#include "wx/menu.h" #include "wx/menu.h"
#include "wx/settings.h" #include "wx/settings.h"
#include "wx/msgdlg.h" #include "wx/msgdlg.h"
#include "wx/textctrl.h"
#endif // WXPRECOMP #endif // WXPRECOMP
#include "wx/html/helpfrm.h" #include "wx/html/helpfrm.h"
#include "wx/html/helpdlg.h" #include "wx/html/helpdlg.h"
#include "wx/html/helpctrl.h" #include "wx/html/helpctrl.h"
#include "wx/textctrl.h"
#include "wx/notebook.h" #include "wx/notebook.h"
#include "wx/imaglist.h" #include "wx/imaglist.h"
#include "wx/treectrl.h" #include "wx/treectrl.h"

View File

@@ -29,13 +29,13 @@
#include "wx/cursor.h" #include "wx/cursor.h"
#include "wx/dialog.h" #include "wx/dialog.h"
#include "wx/msgdlg.h" #include "wx/msgdlg.h"
#include "wx/textctrl.h"
#endif #endif
#include "wx/gdicmn.h" #include "wx/gdicmn.h"
#include "wx/module.h" #include "wx/module.h"
#include "wx/memory.h" #include "wx/memory.h"
#include "wx/tooltip.h" #include "wx/tooltip.h"
#include "wx/textctrl.h"
#include "wx/docview.h" #include "wx/docview.h"
#include "wx/filename.h" #include "wx/filename.h"

View File

@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// Name: spinbutt.cpp // Name: src/mac/carbon/spinbutt.cpp
// Purpose: wxSpinCtrl // Purpose: wxSpinCtrl
// Author: Robert // Author: Robert
// Modified by: Mark Newsam (Based on GTK file) // Modified by: Mark Newsam (Based on GTK file)
@@ -13,8 +13,12 @@
#if wxUSE_SPINCTRL #if wxUSE_SPINCTRL
#include "wx/spinbutt.h" #include "wx/spinbutt.h"
#ifndef WX_PRECOMP
#include "wx/textctrl.h"
#endif
#include "wx/spinctrl.h" #include "wx/spinctrl.h"
#include "wx/textctrl.h"
#include "wx/containr.h" #include "wx/containr.h"
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@@ -47,7 +51,7 @@ public:
{ {
// Hand button down events to wxSpinCtrl. Doesn't work. // Hand button down events to wxSpinCtrl. Doesn't work.
if (event.GetEventType() == wxEVT_LEFT_DOWN && m_spin->ProcessEvent( event )) if (event.GetEventType() == wxEVT_LEFT_DOWN && m_spin->ProcessEvent( event ))
return TRUE; return true;
return wxTextCtrl::ProcessEvent( event ); return wxTextCtrl::ProcessEvent( event );
} }
@@ -139,7 +143,7 @@ END_EVENT_TABLE()
IMPLEMENT_DYNAMIC_CLASS(wxSpinCtrl, wxControl) 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() END_EVENT_TABLE()
WX_DELEGATE_TO_CONTROL_CONTAINER(wxSpinCtrl) WX_DELEGATE_TO_CONTROL_CONTAINER(wxSpinCtrl)
@@ -201,9 +205,9 @@ bool wxSpinCtrl::Create(wxWindow *parent,
} }
if ( size.y == -1 ) { if ( size.y == -1 ) {
csize.y = m_text->GetSize().y + 2 * TEXTBORDER ; //allow for text border highlights csize.y = m_text->GetSize().y + 2 * TEXTBORDER ; //allow for text border highlights
if ( m_btn->GetSize().y > csize.y ) if ( m_btn->GetSize().y > csize.y )
csize.y = m_btn->GetSize().y ; csize.y = m_btn->GetSize().y ;
} }
//SetSize(csize); //SetSize(csize);
@@ -211,7 +215,7 @@ bool wxSpinCtrl::Create(wxWindow *parent,
//MacPostControlCreate(pos, csize); //MacPostControlCreate(pos, csize);
SetInitialBestSize(csize); SetInitialBestSize(csize);
return TRUE; return true;
} }
wxSpinCtrl::~wxSpinCtrl() wxSpinCtrl::~wxSpinCtrl()
@@ -270,15 +274,15 @@ void wxSpinCtrl::DoMoveWindow(int x, int y, int width, int height)
bool wxSpinCtrl::Enable(bool enable) bool wxSpinCtrl::Enable(bool enable)
{ {
if ( !wxControl::Enable(enable) ) if ( !wxControl::Enable(enable) )
return FALSE; return false;
return TRUE; return true;
} }
bool wxSpinCtrl::Show(bool show) bool wxSpinCtrl::Show(bool show)
{ {
if ( !wxControl::Show(show) ) if ( !wxControl::Show(show) )
return FALSE; return false;
return TRUE; return true;
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@@ -302,7 +306,7 @@ bool wxSpinCtrl::GetTextValue(int *val) const
*val = l; *val = l;
return TRUE; return true;
} }
int wxSpinCtrl::GetValue() const int wxSpinCtrl::GetValue() const

View File

@@ -28,6 +28,7 @@
#include "wx/msgdlg.h" #include "wx/msgdlg.h"
#include "wx/scrolbar.h" #include "wx/scrolbar.h"
#include "wx/statbox.h" #include "wx/statbox.h"
#include "wx/textctrl.h"
#endif #endif
#include "wx/layout.h" #include "wx/layout.h"
@@ -36,7 +37,6 @@
#include "wx/menuitem.h" #include "wx/menuitem.h"
#include "wx/spinctrl.h" #include "wx/spinctrl.h"
#include "wx/geometry.h" #include "wx/geometry.h"
#include "wx/textctrl.h"
#include "wx/toolbar.h" #include "wx/toolbar.h"

View File

@@ -33,13 +33,13 @@
#include "wx/cursor.h" #include "wx/cursor.h"
#include "wx/dialog.h" #include "wx/dialog.h"
#include "wx/msgdlg.h" #include "wx/msgdlg.h"
#include "wx/textctrl.h"
#endif #endif
#include "wx/gdicmn.h" #include "wx/gdicmn.h"
#include "wx/module.h" #include "wx/module.h"
#include "wx/memory.h" #include "wx/memory.h"
#include "wx/tooltip.h" #include "wx/tooltip.h"
#include "wx/textctrl.h"
#include "wx/docview.h" #include "wx/docview.h"
#include "wx/filename.h" #include "wx/filename.h"

View File

@@ -16,15 +16,13 @@
#if wxUSE_SPINCTRL #if wxUSE_SPINCTRL
#include "wx/spinctrl.h"
#ifndef WX_PRECOMP #ifndef WX_PRECOMP
#include "wx/textctrl.h" #include "wx/textctrl.h"
#endif //WX_PRECOMP #endif //WX_PRECOMP
#include "wx/spinbutt.h" #include "wx/spinbutt.h"
#include "wx/spinctrl.h"
#include "wx/spinctrl.h"
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// constants // constants

View File

@@ -32,9 +32,9 @@
#include "wx/log.h" #include "wx/log.h"
#include "wx/settings.h" #include "wx/settings.h"
#include "wx/dcclient.h" #include "wx/dcclient.h"
#include "wx/textctrl.h"
#endif #endif
#include "wx/textctrl.h"
#include "wx/imaglist.h" #include "wx/imaglist.h"
#include "wx/listctrl.h" #include "wx/listctrl.h"

View File

@@ -46,6 +46,7 @@
#include "wx/sizer.h" #include "wx/sizer.h"
#include "wx/intl.h" #include "wx/intl.h"
#include "wx/log.h" #include "wx/log.h"
#include "wx/textctrl.h"
#endif #endif
#if wxUSE_OWNER_DRAWN && !defined(__WXUNIVERSAL__) #if wxUSE_OWNER_DRAWN && !defined(__WXUNIVERSAL__)
@@ -89,7 +90,6 @@
#include "wx/spinctrl.h" #include "wx/spinctrl.h"
#endif // wxUSE_SPINCTRL #endif // wxUSE_SPINCTRL
#include "wx/textctrl.h"
#include "wx/notebook.h" #include "wx/notebook.h"
#include "wx/listctrl.h" #include "wx/listctrl.h"
@@ -3393,7 +3393,7 @@ bool wxWindowMSW::HandleTooltipNotify(WXUINT code,
// Truncate tooltip length if needed as otherwise we might not have // Truncate tooltip length if needed as otherwise we might not have
// enough space for it in the buffer and MultiByteToWideChar() would // enough space for it in the buffer and MultiByteToWideChar() would
// return an error // 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 // Convert to WideChar without adding the NULL character. The NULL
// character is added afterwards (this is more efficient). // character is added afterwards (this is more efficient).

View File

@@ -32,9 +32,9 @@
#include "wx/log.h" #include "wx/log.h"
#include "wx/settings.h" #include "wx/settings.h"
#include "wx/dcclient.h" #include "wx/dcclient.h"
#include "wx/textctrl.h"
#endif #endif
#include "wx/textctrl.h"
#include "wx/imaglist.h" #include "wx/imaglist.h"
#include "wx/listctrl.h" #include "wx/listctrl.h"
@@ -487,14 +487,12 @@ SHORT EXPENTRY InternalDataCompareFunc (
// none // none
// //
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
void ConvertFromOS2ListItem ( void ConvertFromOS2ListItem ( HWND hWndListCtrl,
HWND hWndListCtrl wxListItem& rInfo,
, wxListItem& rInfo PMYRECORD pRecord )
, PMYRECORD pRecord
)
{ {
CListItemInternalData* pInternaldata = (CListItemInternalData *)pRecord->m_ulUserData; CListItemInternalData* pInternaldata = (CListItemInternalData *)pRecord->m_ulUserData;
bool bNeedText = FALSE; bool bNeedText = false;
if (pInternaldata) if (pInternaldata)
rInfo.SetData(pInternaldata->m_lParam); rInfo.SetData(pInternaldata->m_lParam);
@@ -826,30 +824,28 @@ void wxListCtrl::Init ()
m_pImageListNormal = NULL; m_pImageListNormal = NULL;
m_pImageListSmall = NULL; m_pImageListSmall = NULL;
m_pImageListState = NULL; m_pImageListState = NULL;
m_bOwnsImageListNormal = FALSE; m_bOwnsImageListNormal = false;
m_bOwnsImageListSmall = FALSE; m_bOwnsImageListSmall = false;
m_bOwnsImageListState = FALSE; m_bOwnsImageListState = false;
m_lBaseStyle = 0L; m_lBaseStyle = 0L;
m_nColCount = 0; m_nColCount = 0;
m_pTextCtrl = NULL; m_pTextCtrl = NULL;
m_bAnyInternalData = FALSE; m_bAnyInternalData = false;
m_bHasAnyAttr = FALSE; m_bHasAnyAttr = false;
} // end of wxListCtrl::Init } // end of wxListCtrl::Init
bool wxListCtrl::Create ( bool wxListCtrl::Create ( wxWindow* pParent,
wxWindow* pParent wxWindowID vId,
, wxWindowID vId const wxPoint& rPos,
, const wxPoint& rPos const wxSize& rSize,
, const wxSize& rSize long lStyle,
, long lStyle const wxValidator& rValidator,
, const wxValidator& rValidator const wxString& rsName )
, const wxString& rsName
)
{ {
int nX = rPos.x; int nX = rPos.x;
int nY = rPos.y; int nY = rPos.y;
int nWidth = rSize.x; int nWidth = rSize.x;
int nHeight = rSize.y; int nHeight = rSize.y;
#if wxUSE_VALIDATORS #if wxUSE_VALIDATORS
SetValidator(rValidator); SetValidator(rValidator);
@@ -869,7 +865,7 @@ bool wxListCtrl::Create (
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) if (GetWindowStyleFlag() & wxCLIP_SIBLINGS)
lSstyle |= WS_CLIPSIBLINGS; lSstyle |= WS_CLIPSIBLINGS;
@@ -879,23 +875,19 @@ bool wxListCtrl::Create (
,nWidth ,nWidth
,nHeight ,nHeight
)) ))
return FALSE; return false;
if (pParent) if (pParent)
pParent->AddChild(this); pParent->AddChild(this);
return TRUE; return true;
} // end of wxListCtrl::Create } // end of wxListCtrl::Create
bool wxListCtrl::DoCreateControl ( bool wxListCtrl::DoCreateControl ( int nX, int nY,
int nX int nWidth, int nHeight )
, int nY
, int nWidth
, int nHeight
)
{ {
DWORD lWstyle = m_lBaseStyle; DWORD lWstyle = m_lBaseStyle;
long lOldStyle = 0; // Dummy long lOldStyle = 0; // Dummy
CNRINFO vCnrInfo; CNRINFO vCnrInfo;
lWstyle |= ConvertToOS2Style( lOldStyle lWstyle |= ConvertToOS2Style( lOldStyle
,GetWindowStyleFlag() ,GetWindowStyleFlag()
@@ -914,7 +906,7 @@ bool wxListCtrl::DoCreateControl (
); );
if (!m_hWnd) if (!m_hWnd)
{ {
return FALSE; return false;
} }
// //
@@ -925,7 +917,7 @@ bool wxListCtrl::DoCreateControl (
,MPFROMP(&vCnrInfo) ,MPFROMP(&vCnrInfo)
,(MPARAM)(USHORT)sizeof(CNRINFO) ,(MPARAM)(USHORT)sizeof(CNRINFO)
)) ))
return FALSE; return false;
lWstyle = ConvertViewToOS2Style(GetWindowStyleFlag()); lWstyle = ConvertViewToOS2Style(GetWindowStyleFlag());
vCnrInfo.flWindowAttr |= lWstyle; vCnrInfo.flWindowAttr |= lWstyle;
if (!::WinSendMsg( GetHWND() if (!::WinSendMsg( GetHWND()
@@ -933,7 +925,7 @@ bool wxListCtrl::DoCreateControl (
,MPFROMP(&vCnrInfo) ,MPFROMP(&vCnrInfo)
,(MPARAM)CMA_FLWINDOWATTR ,(MPARAM)CMA_FLWINDOWATTR
)) ))
return FALSE; return false;
// //
// And now set needed arrangement flags // And now set needed arrangement flags
@@ -944,36 +936,30 @@ bool wxListCtrl::DoCreateControl (
,(MPARAM)CMA_ARRANGEGRID ,(MPARAM)CMA_ARRANGEGRID
,(MPARAM)lWstyle ,(MPARAM)lWstyle
)) ))
return FALSE; return false;
SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW)); SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW));
SetForegroundColour(GetParent()->GetForegroundColour()); SetForegroundColour(GetParent()->GetForegroundColour());
SubclassWin(m_hWnd); SubclassWin(m_hWnd);
SetFont(*wxSMALL_FONT); SetFont(*wxSMALL_FONT);
SetXComp(0); SetXComp(0);
SetYComp(0); SetYComp(0);
SetSize( nX SetSize( nX, nY, nWidth, nHeight );
,nY return true;
,nWidth
,nHeight
);
return TRUE;
} // end of wxListCtrl::DoCreateControl } // end of wxListCtrl::DoCreateControl
void wxListCtrl::UpdateStyle () void wxListCtrl::UpdateStyle ()
{ {
if (GetHWND()) if (GetHWND())
{ {
long lDummy; long lDummy;
DWORD dwStyleNew = ConvertToOS2Style( lDummy DWORD dwStyleNew = ConvertToOS2Style( lDummy, GetWindowStyleFlag() );
,GetWindowStyleFlag()
);
dwStyleNew |= m_lBaseStyle; dwStyleNew |= m_lBaseStyle;
// //
// Get the current window style. // 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.
@@ -989,12 +975,12 @@ void wxListCtrl::FreeAllInternalData ()
{ {
if (m_bAnyInternalData) if (m_bAnyInternalData)
{ {
int n = GetItemCount(); int n = GetItemCount();
int i = 0; int i = 0;
for (i = 0; i < n; i++) for (i = 0; i < n; i++)
DeleteInternalData(this, (long)i); DeleteInternalData(this, (long)i);
m_bAnyInternalData = FALSE; m_bAnyInternalData = false;
} }
} // end of wxListCtrl::FreeAllInternalData } // end of wxListCtrl::FreeAllInternalData
@@ -1149,57 +1135,48 @@ long wxListCtrl::ConvertViewToOS2Style (
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// Sets the foreground, i.e. text, colour // Sets the foreground, i.e. text, colour
bool wxListCtrl::SetForegroundColour ( bool wxListCtrl::SetForegroundColour (const wxColour& rCol)
const wxColour& rCol)
{ {
ULONG ulColor = wxColourToRGB(rCol); ULONG ulColor = wxColourToRGB(rCol);
if (!wxWindow::SetForegroundColour(rCol)) if (!wxWindow::SetForegroundColour(rCol))
return FALSE; return false;
::WinSetPresParam( GetHWND() ::WinSetPresParam( GetHWND()
,PP_FOREGROUNDCOLOR ,PP_FOREGROUNDCOLOR
,sizeof(ULONG) ,sizeof(ULONG)
,&ulColor ,&ulColor
); );
return TRUE; return true;
} // end of wxListCtrl::SetForegroundColour } // end of wxListCtrl::SetForegroundColour
// Sets the background colour // Sets the background colour
bool wxListCtrl::SetBackgroundColour ( bool wxListCtrl::SetBackgroundColour ( const wxColour& rCol )
const wxColour& rCol
)
{ {
if (!wxWindow::SetBackgroundColour(rCol)) if (!wxWindow::SetBackgroundColour(rCol))
return FALSE; return false;
// //
// We set the same colour for both the "empty" background and the items // We set the same colour for both the "empty" background and the items
// background // background
// //
ULONG ulColor = wxColourToRGB(rCol); ULONG ulColor = wxColourToRGB(rCol);
::WinSetPresParam( GetHWND() ::WinSetPresParam( GetHWND()
,PP_BACKGROUNDCOLOR ,PP_BACKGROUNDCOLOR
,sizeof(ULONG) ,sizeof(ULONG)
,&ulColor ,&ulColor
); );
return TRUE; return true;
} // end of wxListCtrl::SetBackgroundColour } // end of wxListCtrl::SetBackgroundColour
// Gets information about this column // Gets information about this column
bool wxListCtrl::GetColumn ( bool wxListCtrl::GetColumn ( int nCol, wxListItem& rItem ) const
int nCol
, wxListItem& rItem
) const
{ {
PFIELDINFO pFieldInfo = FindOS2ListFieldByColNum ( GetHWND() PFIELDINFO pFieldInfo = FindOS2ListFieldByColNum ( GetHWND(), nCol );
,nCol
);
if (!pFieldInfo) if (!pFieldInfo)
return FALSE; return false;
rItem.SetWidth(pFieldInfo->cxWidth); rItem.SetWidth(pFieldInfo->cxWidth);
if ((rItem.GetMask() & wxLIST_MASK_TEXT) && if ((rItem.GetMask() & wxLIST_MASK_TEXT) &&
(pFieldInfo->flData & CFA_STRING) && (pFieldInfo->flData & CFA_STRING) &&
@@ -1216,37 +1193,25 @@ bool wxListCtrl::GetColumn (
else if (pFieldInfo->flData & CFA_CENTER) else if (pFieldInfo->flData & CFA_CENTER)
rItem.m_format = wxLIST_FORMAT_CENTRE; rItem.m_format = wxLIST_FORMAT_CENTRE;
} }
return TRUE; return true;
} // end of wxListCtrl::GetColumn } // end of wxListCtrl::GetColumn
// Sets information about this column // Sets information about this column
bool wxListCtrl::SetColumn ( bool wxListCtrl::SetColumn ( int nCol, wxListItem& rItem )
int nCol
, wxListItem& rItem
)
{ {
PFIELDINFO pFieldInfo = FindOS2ListFieldByColNum( GetHWND() PFIELDINFO pFieldInfo = FindOS2ListFieldByColNum( GetHWND(), nCol );
,nCol ConvertToOS2ListCol( nCol, rItem, pFieldInfo );
);
ConvertToOS2ListCol( nCol
,rItem
,pFieldInfo
);
// //
// Since we changed the field pointed to, we invalidate to see the result // Since we changed the field pointed to, we invalidate to see the result
// //
::WinSendMsg(GetHWND(), CM_INVALIDATEDETAILFIELDINFO, NULL, NULL); ::WinSendMsg(GetHWND(), CM_INVALIDATEDETAILFIELDINFO, NULL, NULL);
return TRUE; return true;
} // end of wxListCtrl::SetColumn } // end of wxListCtrl::SetColumn
// Gets the column width // Gets the column width
int wxListCtrl::GetColumnWidth ( int wxListCtrl::GetColumnWidth ( int nCol ) const
int nCol
) const
{ {
PFIELDINFO pFieldInfo = FindOS2ListFieldByColNum ( GetHWND() PFIELDINFO pFieldInfo = FindOS2ListFieldByColNum ( GetHWND(), nCol );
,nCol
);
if (!pFieldInfo) if (!pFieldInfo)
return 0; return 0;
@@ -1254,23 +1219,18 @@ int wxListCtrl::GetColumnWidth (
} // end of wxListCtrl::GetColumnWidth } // end of wxListCtrl::GetColumnWidth
// Sets the column width // Sets the column width
bool wxListCtrl::SetColumnWidth ( bool wxListCtrl::SetColumnWidth ( int nCol, int nWidth )
int nCol
, int nWidth
)
{ {
int nCol2 = nCol; int nCol2 = nCol;
int nWidth2 = nWidth; int nWidth2 = nWidth;
if (GetWindowStyleFlag() & wxLC_LIST) if (GetWindowStyleFlag() & wxLC_LIST)
nCol2 = -1; nCol2 = -1;
PFIELDINFO pFieldInfo = FindOS2ListFieldByColNum( GetHWND() PFIELDINFO pFieldInfo = FindOS2ListFieldByColNum( GetHWND(), nCol );
,nCol
);
pFieldInfo->cxWidth = nWidth; pFieldInfo->cxWidth = nWidth;
::WinSendMsg(GetHWND(), CM_INVALIDATEDETAILFIELDINFO, NULL, NULL); ::WinSendMsg(GetHWND(), CM_INVALIDATEDETAILFIELDINFO, NULL, NULL);
return TRUE; return true;
} // end of wxListCtrl::SetColumnWidth } // end of wxListCtrl::SetColumnWidth
// Gets the number of items that can fit vertically in the // Gets the number of items that can fit vertically in the
@@ -1328,35 +1288,22 @@ wxTextCtrl* wxListCtrl::GetEditControl() const
} }
// Gets information about the item // Gets information about the item
bool wxListCtrl::GetItem ( bool wxListCtrl::GetItem ( wxListItem& rInfo ) const
wxListItem& rInfo
) const
{ {
PMYRECORD pRecord = FindOS2ListRecordByID( GetHWND() PMYRECORD pRecord = FindOS2ListRecordByID( GetHWND(), rInfo.GetId() );
,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 ConvertFromOS2ListItem( NULL, rInfo, pRecord );
,rInfo return true;
,pRecord
);
return TRUE;
} // end of wxListCtrl::GetItem } // end of wxListCtrl::GetItem
// Sets information about the item // Sets information about the item
bool wxListCtrl::SetItem ( bool wxListCtrl::SetItem ( wxListItem& rInfo )
wxListItem& rInfo
)
{ {
PFIELDINFO pFieldInfo = FindOS2ListFieldByColNum ( GetHWND() PFIELDINFO pFieldInfo = FindOS2ListFieldByColNum ( GetHWND(), rInfo.GetColumn() );
,rInfo.GetColumn() PMYRECORD pRecord = FindOS2ListRecordByID( GetHWND(), rInfo.GetId() );
);
PMYRECORD pRecord = FindOS2ListRecordByID( GetHWND()
,rInfo.GetId()
);
ConvertToOS2ListItem( this ConvertToOS2ListItem( this
,rInfo ,rInfo
@@ -1382,7 +1329,7 @@ bool wxListCtrl::SetItem (
// //
// Need to set it // Need to set it
// //
m_bAnyInternalData = TRUE; m_bAnyInternalData = true;
pData = new CListItemInternalData(); pData = new CListItemInternalData();
pRecord->m_ulUserData = (unsigned long)pData; pRecord->m_ulUserData = (unsigned long)pData;
}; };
@@ -1407,19 +1354,19 @@ bool wxListCtrl::SetItem (
// //
// 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 // Check whether it has any custom attributes
// //
if (rInfo.HasAttributes()) if (rInfo.HasAttributes())
{ {
m_bHasAnyAttr = TRUE; m_bHasAnyAttr = true;
// //
// If the colour has changed, we must redraw the item // If the colour has changed, we must redraw the item
// //
bUpdateNow = TRUE; bUpdateNow = true;
} }
if (::WinIsWindowVisible(GetHWND())) if (::WinIsWindowVisible(GetHWND()))
{ {
@@ -1435,7 +1382,7 @@ bool wxListCtrl::SetItem (
,NULL ,NULL
,NULL ,NULL
); );
return TRUE; return true;
} // end of wxListCtrl::SetItem } // end of wxListCtrl::SetItem
long wxListCtrl::SetItem ( long wxListCtrl::SetItem (
@@ -1477,23 +1424,15 @@ int wxListCtrl::GetItemState (
} // end of wxListCtrl::GetItemState } // end of wxListCtrl::GetItemState
// Sets the item state // Sets the item state
bool wxListCtrl::SetItemState ( bool wxListCtrl::SetItemState ( long lItem, long lState, long lStateMask )
long lItem
, long lState
, long lStateMask
)
{ {
PMYRECORD pRecord = FindOS2ListRecordByID( GetHWND() PMYRECORD pRecord = FindOS2ListRecordByID( GetHWND(), lItem );
,lItem
);
// //
// Don't use SetItem() here as it doesn't work with the virtual list // Don't use SetItem() here as it doesn't work with the virtual list
// controls // controls
// //
ConvertToOS2Flags( lState ConvertToOS2Flags( lState, pRecord );
,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
@@ -1535,7 +1474,7 @@ bool wxListCtrl::SetItemState (
RefreshItem(lFocusOld); RefreshItem(lFocusOld);
} }
} }
return TRUE; return true;
} // end of wxListCtrl::SetItemState } // end of wxListCtrl::SetItemState
// Sets the item image // Sets the item image
@@ -1620,22 +1559,18 @@ bool wxListCtrl::SetItemData (
} // end of wxListCtrl::SetItemData } // end of wxListCtrl::SetItemData
// Gets the item rectangle // Gets the item rectangle
bool wxListCtrl::GetItemRect ( bool wxListCtrl::GetItemRect ( long lItem,
long lItem wxRect& rRect,
, wxRect& rRect int nCode ) const
, int nCode
) const
{ {
bool bSuccess; bool bSuccess;
PMYRECORD pRecord = FindOS2ListRecordByID( GetHWND() PMYRECORD pRecord = FindOS2ListRecordByID( GetHWND(), lItem );
,lItem QUERYRECORDRECT vQueryRect;
); RECTL vRect;
QUERYRECORDRECT vQueryRect; int nHeight;
RECTL vRect;
int nHeight;
if (!pRecord) if (!pRecord)
return FALSE; return false;
vQueryRect.cb = sizeof(QUERYRECORDRECT); vQueryRect.cb = sizeof(QUERYRECORDRECT);
vQueryRect.pRecord = &pRecord->m_vRecord; vQueryRect.pRecord = &pRecord->m_vRecord;
vQueryRect.fRightSplitWindow = TRUE; vQueryRect.fRightSplitWindow = TRUE;
@@ -1648,33 +1583,26 @@ bool wxListCtrl::GetItemRect (
// //
// remember OS/2 is backwards // remember OS/2 is backwards
// //
GetClientSize( NULL GetClientSize( NULL, &nHeight );
,&nHeight
);
rRect.x = vRect.xLeft; rRect.x = vRect.xLeft;
rRect.y = nHeight - vRect.yTop; rRect.y = nHeight - vRect.yTop;
rRect.width = vRect.xRight; rRect.width = vRect.xRight;
rRect.height = nHeight - vRect.yBottom; rRect.height = nHeight - vRect.yBottom;
bSuccess = TRUE; bSuccess = true;
return bSuccess; return bSuccess;
} // end of wxListCtrl::GetItemRect } // end of wxListCtrl::GetItemRect
// Gets the item position // Gets the item position
bool wxListCtrl::GetItemPosition ( bool wxListCtrl::GetItemPosition ( long lItem, wxPoint& rPos ) const
long lItem
, wxPoint& rPos
) const
{ {
bool bSuccess; bool bSuccess;
PMYRECORD pRecord = FindOS2ListRecordByID( GetHWND() PMYRECORD pRecord = FindOS2ListRecordByID( GetHWND() , lItem );
,lItem QUERYRECORDRECT vQueryRect;
); RECTL vRect;
QUERYRECORDRECT vQueryRect; int nHeight;
RECTL vRect;
int nHeight;
if (!pRecord) if (!pRecord)
return FALSE; return false;
vQueryRect.cb = sizeof(QUERYRECORDRECT); vQueryRect.cb = sizeof(QUERYRECORDRECT);
vQueryRect.pRecord = &pRecord->m_vRecord; vQueryRect.pRecord = &pRecord->m_vRecord;
vQueryRect.fRightSplitWindow = TRUE; vQueryRect.fRightSplitWindow = TRUE;
@@ -1687,25 +1615,20 @@ bool wxListCtrl::GetItemPosition (
// //
// remember OS/2 is backwards // remember OS/2 is backwards
// //
GetClientSize( NULL GetClientSize( NULL, &nHeight );
,&nHeight
);
rPos.x = vRect.xLeft; rPos.x = vRect.xLeft;
rPos.y = nHeight - vRect.yTop; rPos.y = nHeight - vRect.yTop;
bSuccess = TRUE; bSuccess = true;
return bSuccess; return bSuccess;
} // end of wxListCtrl::GetItemPosition } // end of wxListCtrl::GetItemPosition
// Sets the item position. // Sets the item position.
bool wxListCtrl::SetItemPosition ( bool wxListCtrl::SetItemPosition ( long lItem, const wxPoint& rPos )
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
// //
return FALSE; return false;
} // end of wxListCtrl::SetItemPosition } // end of wxListCtrl::SetItemPosition
// Gets the number of items in the list control // Gets the number of items in the list control
@@ -1723,11 +1646,9 @@ int wxListCtrl::GetItemCount () const
} // end of wxListCtrl::GetItemCount } // end of wxListCtrl::GetItemCount
// Retrieves the spacing between icons in pixels. // 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 ( int wxListCtrl::GetItemSpacing ( bool bIsSmall ) const
bool bIsSmall
) const
{ {
CNRINFO vCnrInfo; CNRINFO vCnrInfo;
@@ -1916,48 +1837,42 @@ wxImageList* wxListCtrl::GetImageList (
return NULL; return NULL;
} // end of wxListCtrl::GetImageList } // end of wxListCtrl::GetImageList
void wxListCtrl::SetImageList ( void wxListCtrl::SetImageList ( wxImageList* pImageList,
wxImageList* pImageList int nWhich )
, int nWhich
)
{ {
if (nWhich == wxIMAGE_LIST_NORMAL) if (nWhich == wxIMAGE_LIST_NORMAL)
{ {
if (m_bOwnsImageListNormal) if (m_bOwnsImageListNormal)
delete m_pImageListNormal; delete m_pImageListNormal;
m_pImageListNormal = pImageList; m_pImageListNormal = pImageList;
m_bOwnsImageListNormal = FALSE; m_bOwnsImageListNormal = false;
} }
else if (nWhich == wxIMAGE_LIST_SMALL) else if (nWhich == wxIMAGE_LIST_SMALL)
{ {
if (m_bOwnsImageListSmall) if (m_bOwnsImageListSmall)
delete m_pImageListSmall; delete m_pImageListSmall;
m_pImageListSmall = pImageList; m_pImageListSmall = pImageList;
m_bOwnsImageListSmall = FALSE; m_bOwnsImageListSmall = false;
} }
else if (nWhich == wxIMAGE_LIST_STATE) else if (nWhich == wxIMAGE_LIST_STATE)
{ {
if (m_bOwnsImageListState) if (m_bOwnsImageListState)
delete m_pImageListState; delete m_pImageListState;
m_pImageListState = pImageList; m_pImageListState = pImageList;
m_bOwnsImageListState = FALSE; m_bOwnsImageListState = false;
} }
} // end of wxListCtrl::SetImageList } // end of wxListCtrl::SetImageList
void wxListCtrl::AssignImageList ( void wxListCtrl::AssignImageList ( wxImageList* pImageList, int nWhich )
wxImageList* pImageList
, int nWhich
)
{ {
SetImageList( pImageList SetImageList( pImageList, nWhich );
,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
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@@ -1965,12 +1880,10 @@ void wxListCtrl::AssignImageList (
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// Arranges the items // Arranges the items
bool wxListCtrl::Arrange ( bool wxListCtrl::Arrange ( int nFlag )
int nFlag
)
{ {
ULONG ulType = 0L; ULONG ulType = 0L;
ULONG ulFlags = 0L; ULONG ulFlags = 0L;
if (nFlag == wxLIST_ALIGN_SNAP_TO_GRID) if (nFlag == wxLIST_ALIGN_SNAP_TO_GRID)
{ {
@@ -1992,24 +1905,20 @@ bool wxListCtrl::Arrange (
// //
// We do not support CMA_ARRANGESELECTED // We do not support CMA_ARRANGESELECTED
// //
return TRUE; return true;
} // end of wxListCtrl::Arrange } // end of wxListCtrl::Arrange
// Deletes an item // Deletes an item
bool wxListCtrl::DeleteItem ( bool wxListCtrl::DeleteItem ( long lItem )
long lItem
)
{ {
PMYRECORD pRecord = FindOS2ListRecordByID( GetHWND() PMYRECORD pRecord = FindOS2ListRecordByID( GetHWND(), lItem );
,lItem
);
if (LONGFROMMR(::WinSendMsg( GetHWND() if (LONGFROMMR(::WinSendMsg( GetHWND()
,CM_REMOVERECORD ,CM_REMOVERECORD
,(MPARAM)pRecord ,(MPARAM)pRecord
,MPFROM2SHORT(1, CMA_FREE) ,MPFROM2SHORT(1, CMA_FREE)
)) == -1L) )) == -1L)
{ {
return FALSE; return false;
} }
// //
@@ -2038,7 +1947,7 @@ bool wxListCtrl::DeleteItem (
vRectWin.y = vRectItem.GetBottom(); vRectWin.y = vRectItem.GetBottom();
RefreshRect(vRectWin); RefreshRect(vRectWin);
} }
return TRUE; return true;
} // end of wxListCtrl::DeleteItem } // end of wxListCtrl::DeleteItem
// Deletes all items // Deletes all items
@@ -2061,18 +1970,14 @@ bool wxListCtrl::DeleteAllColumns ()
} }
wxASSERT_MSG(m_nColCount == 0, wxT("no columns should be left")); wxASSERT_MSG(m_nColCount == 0, wxT("no columns should be left"));
return TRUE; return true;
} // end of wxListCtrl::DeleteAllColumns } // end of wxListCtrl::DeleteAllColumns
// Deletes a column // Deletes a column
bool wxListCtrl::DeleteColumn ( bool wxListCtrl::DeleteColumn ( int nCol )
int nCol
)
{ {
bool bSuccess = FALSE; bool bSuccess = false;
PFIELDINFO pField = FindOS2ListFieldByColNum( GetHWND() PFIELDINFO pField = FindOS2ListFieldByColNum( GetHWND(), nCol );
,nCol
);
bSuccess = ((LONG)::WinSendMsg( GetHWND() bSuccess = ((LONG)::WinSendMsg( GetHWND()
,CM_REMOVEDETAILFIELDINFO ,CM_REMOVEDETAILFIELDINFO
,MPFROMP(pField) ,MPFROMP(pField)
@@ -2123,32 +2028,26 @@ wxTextCtrl* wxListCtrl::EditLabel (
// End label editing, optionally cancelling the edit. Under OS/2 you close // End label editing, optionally cancelling the edit. Under OS/2 you close
// the record for editting // the record for editting
bool wxListCtrl::EndEditLabel ( bool wxListCtrl::EndEditLabel ( bool WXUNUSED(bCancel) )
bool WXUNUSED(bCancel)
)
{ {
::WinSendMsg( GetHWND() ::WinSendMsg( GetHWND()
,CM_CLOSEEDIT ,CM_CLOSEEDIT
,(MPARAM)0 ,(MPARAM)0
,(MPARAM)0 ,(MPARAM)0
); );
return TRUE; return true;
} // end of wxListCtrl::EndEditLabel } // end of wxListCtrl::EndEditLabel
// Ensures this item is visible // Ensures this item is visible
bool wxListCtrl::EnsureVisible ( bool wxListCtrl::EnsureVisible ( long lItem )
long lItem
)
{ {
PMYRECORD pRecord = FindOS2ListRecordByID( GetHWND() PMYRECORD pRecord = FindOS2ListRecordByID( GetHWND(), lItem );
,lItem
);
::WinSendMsg( GetHWND() ::WinSendMsg( GetHWND()
,CM_INVALIDATERECORD ,CM_INVALIDATERECORD
,MPFROMP(pRecord) ,MPFROMP(pRecord)
,MPFROM2SHORT((SHORT)1, CMA_NOREPOSITION) ,MPFROM2SHORT((SHORT)1, CMA_NOREPOSITION)
); );
return TRUE; return true;
} // end of wxListCtrl::EnsureVisible } // end of wxListCtrl::EnsureVisible
// Find an item whose label matches this string, starting from the item after 'start' // Find an item whose label matches this string, starting from the item after 'start'
@@ -2390,7 +2289,7 @@ long wxListCtrl::InsertItem (
); );
if (bNeedInternalData) if (bNeedInternalData)
{ {
m_bAnyInternalData = TRUE; m_bAnyInternalData = true;
// //
// Internal stucture that manages data // Internal stucture that manages data
@@ -2536,10 +2435,7 @@ long wxListCtrl::InsertColumn (
// scroll the control by the given number of pixels (exception: in list view, // scroll the control by the given number of pixels (exception: in list view,
// dx is interpreted as number of columns) // dx is interpreted as number of columns)
bool wxListCtrl::ScrollList ( bool wxListCtrl::ScrollList ( int nDx, int nDy )
int nDx
, int nDy
)
{ {
if (nDx > 0) if (nDx > 0)
::WinSendMsg( GetHWND() ::WinSendMsg( GetHWND()
@@ -2553,15 +2449,12 @@ bool wxListCtrl::ScrollList (
,(MPARAM)CMA_VERTICAL ,(MPARAM)CMA_VERTICAL
,(MPARAM)nDy ,(MPARAM)nDy
); );
return TRUE; return true;
} // end of wxListCtrl::ScrollList } // end of wxListCtrl::ScrollList
bool wxListCtrl::SortItems ( bool wxListCtrl::SortItems ( wxListCtrlCompare fn, long lData )
wxListCtrlCompare fn
, long lData
)
{ {
SInternalDataSort vInternalData; SInternalDataSort vInternalData;
vInternalData.m_fnUser = fn; vInternalData.m_fnUser = fn;
vInternalData.m_lData = lData; vInternalData.m_lData = lData;
@@ -2574,47 +2467,38 @@ bool wxListCtrl::SortItems (
)) ))
{ {
wxLogDebug(_T("CM_SORTRECORD failed")); wxLogDebug(_T("CM_SORTRECORD failed"));
return FALSE; return false;
} }
return TRUE; return true;
} // end of wxListCtrl::SortItems } // end of wxListCtrl::SortItems
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// message processing // message processing
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
bool wxListCtrl::OS2Command ( bool wxListCtrl::OS2Command ( WXUINT uCmd, WXWORD wId )
WXUINT uCmd
, WXWORD wId
)
{ {
if (uCmd == CN_ENDEDIT) if (uCmd == CN_ENDEDIT)
{ {
wxCommandEvent vEvent( wxEVT_COMMAND_TEXT_UPDATED wxCommandEvent vEvent( wxEVT_COMMAND_TEXT_UPDATED, wId );
,wId
);
vEvent.SetEventObject( this ); vEvent.SetEventObject( this );
ProcessCommand(vEvent); ProcessCommand(vEvent);
return TRUE; return true;
} }
else if (uCmd == CN_KILLFOCUS) else if (uCmd == CN_KILLFOCUS)
{ {
wxCommandEvent vEvent( wxEVT_KILL_FOCUS wxCommandEvent vEvent( wxEVT_KILL_FOCUS, wId );
,wId
);
vEvent.SetEventObject( this ); vEvent.SetEventObject( this );
ProcessCommand(vEvent); ProcessCommand(vEvent);
return TRUE; return true;
} }
else else
return FALSE; return false;
} // end of wxListCtrl::OS2Command } // end of wxListCtrl::OS2Command
// Necessary for drawing hrules and vrules, if specified // Necessary for drawing hrules and vrules, if specified
void wxListCtrl::OnPaint ( void wxListCtrl::OnPaint ( wxPaintEvent& rEvent )
wxPaintEvent& rEvent
)
{ {
wxPaintDC vDc(this); wxPaintDC vDc(this);
wxPen vPen(wxSystemSettings::GetColour( wxSYS_COLOUR_3DLIGHT) wxPen vPen(wxSystemSettings::GetColour( wxSYS_COLOUR_3DLIGHT)
@@ -2775,34 +2659,25 @@ void wxListCtrl::RefreshItem (
RefreshRect(vRect); RefreshRect(vRect);
} // end of wxListCtrl::RefreshItem } // end of wxListCtrl::RefreshItem
void wxListCtrl::RefreshItems ( void wxListCtrl::RefreshItems ( long lItemFrom, long lItemTo )
long lItemFrom
, long lItemTo
)
{ {
wxRect vRect1; wxRect vRect1;
wxRect vRect2; wxRect vRect2;
GetItemRect( lItemFrom GetItemRect( lItemFrom , vRect1 );
,vRect1 GetItemRect( lItemTo , vRect2 );
);
GetItemRect( lItemTo
,vRect2
);
wxRect vRect = vRect1; wxRect vRect = vRect1;
vRect.height = vRect2.GetBottom() - vRect1.GetTop(); vRect.height = vRect2.GetBottom() - vRect1.GetTop();
RefreshRect(vRect); RefreshRect(vRect);
} // end of wxListCtrl::RefreshItems } // end of wxListCtrl::RefreshItems
MRESULT wxListCtrl::OS2WindowProc( MRESULT wxListCtrl::OS2WindowProc( WXUINT uMsg,
WXUINT uMsg WXWPARAM wParam,
, WXWPARAM wParam WXLPARAM lParam )
, WXLPARAM lParam
)
{ {
bool bProcessed = FALSE; bool bProcessed = false;
MRESULT lRc; MRESULT lRc;
wxListEvent vEvent( wxEVT_NULL wxListEvent vEvent( wxEVT_NULL
,m_windowId ,m_windowId

View File

@@ -46,6 +46,7 @@
#include "wx/settings.h" #include "wx/settings.h"
#include "wx/intl.h" #include "wx/intl.h"
#include "wx/log.h" #include "wx/log.h"
#include "wx/textctrl.h"
#include <stdio.h> #include <stdio.h>
#endif #endif
@@ -73,9 +74,6 @@
#include "wx/caret.h" #include "wx/caret.h"
#endif // wxUSE_CARET #endif // wxUSE_CARET
#include "wx/textctrl.h"
#include <string.h> #include <string.h>
// //

View File

@@ -32,9 +32,9 @@
#include "wx/log.h" #include "wx/log.h"
#include "wx/settings.h" #include "wx/settings.h"
#include "wx/dcclient.h" #include "wx/dcclient.h"
#include "wx/textctrl.h"
#endif #endif
#include "wx/textctrl.h"
#include "wx/imaglist.h" #include "wx/imaglist.h"
#include "wx/listctrl.h" #include "wx/listctrl.h"

View File

@@ -26,8 +26,9 @@
#if wxUSE_TEXTCTRL #if wxUSE_TEXTCTRL
#include "wx/textctrl.h"
#ifndef WX_PRECOMP #ifndef WX_PRECOMP
#include "wx/textctrl.h"
#include "wx/settings.h" #include "wx/settings.h"
#include "wx/brush.h" #include "wx/brush.h"
#include "wx/utils.h" #include "wx/utils.h"

View File

@@ -44,6 +44,7 @@
#include "wx/statbox.h" #include "wx/statbox.h"
#include "wx/intl.h" #include "wx/intl.h"
#include "wx/log.h" #include "wx/log.h"
#include "wx/textctrl.h"
#endif #endif
#if wxUSE_OWNER_DRAWN && !defined(__WXUNIVERSAL__) #if wxUSE_OWNER_DRAWN && !defined(__WXUNIVERSAL__)
@@ -74,7 +75,6 @@
#include "wx/spinctrl.h" #include "wx/spinctrl.h"
#endif // wxUSE_SPINCTRL #endif // wxUSE_SPINCTRL
#include "wx/textctrl.h"
#include "wx/notebook.h" #include "wx/notebook.h"
#include "wx/listctrl.h" #include "wx/listctrl.h"

View File

@@ -125,16 +125,16 @@
#if wxUSE_TEXTCTRL #if wxUSE_TEXTCTRL
#include <ctype.h> #include "wx/textctrl.h"
#ifndef WX_PRECOMP #ifndef WX_PRECOMP
#include "wx/log.h" #include "wx/log.h"
#include "wx/dcclient.h" #include "wx/dcclient.h"
#include "wx/validate.h" #include "wx/validate.h"
#include "wx/textctrl.h"
#endif #endif
#include <ctype.h>
#include "wx/clipbrd.h" #include "wx/clipbrd.h"
#include "wx/textfile.h" #include "wx/textfile.h"

View File

@@ -1,9 +1,9 @@
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// Name: xh_gdctl.cpp // Name: src/xrc/xh_gdctl.cpp
// Purpose: XRC resource for wxGenericDirCtrl // Purpose: XRC resource for wxGenericDirCtrl
// Author: Markus Greither // Author: Markus Greither
// Created: 2002/01/20 // Created: 2002/01/20
// RCS-ID: // RCS-ID: $Id$
// Copyright: (c) 2002 Markus Greither // Copyright: (c) 2002 Markus Greither
// Licence: wxWindows licence // Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
@@ -17,8 +17,12 @@
#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" #include "wx/dirctrl.h"
IMPLEMENT_DYNAMIC_CLASS(wxGenericDirCtrlXmlHandler, wxXmlResourceHandler) IMPLEMENT_DYNAMIC_CLASS(wxGenericDirCtrlXmlHandler, wxXmlResourceHandler)

View File

@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// Name: xh_listc.cpp // Name: src/xrc/xh_listc.cpp
// Purpose: XRC resource for wxListCtrl // Purpose: XRC resource for wxListCtrl
// Author: Brian Gavin // Author: Brian Gavin
// Created: 2000/09/09 // Created: 2000/09/09
@@ -15,10 +15,14 @@
#pragma hdrstop #pragma hdrstop
#endif #endif
#if wxUSE_XRC #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
#include "wx/listctrl.h" #include "wx/listctrl.h"
@@ -70,4 +74,4 @@ bool wxListCtrlXmlHandler::CanHandle(wxXmlNode *node)
return IsOfClass(node, wxT("wxListCtrl")); return IsOfClass(node, wxT("wxListCtrl"));
} }
#endif // wxUSE_XRC #endif // wxUSE_XRC && wxUSE_LISTCTRL

View File

@@ -15,10 +15,13 @@
#pragma hdrstop #pragma hdrstop
#endif #endif
#if wxUSE_XRC #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)
@@ -73,4 +76,4 @@ bool wxTextCtrlXmlHandler::CanHandle(wxXmlNode *node)
return IsOfClass(node, wxT("wxTextCtrl")); return IsOfClass(node, wxT("wxTextCtrl"));
} }
#endif // wxUSE_XRC #endif // wxUSE_XRC && wxUSE_TEXTCTRL