public:
wxListCtrl(void);
- wxListCtrl( wxWindow *parent, wxWindowID id,
+ wxListCtrl( wxWindow *parent, wxWindowID id = -1,
const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
- long style = 0, const wxString &name = "listctrl" );
+ long style = wxLC_ICON, const wxValidator& validator = wxDefaultValidator,
+ const wxString &name = "listctrl" )
+ {
+ Create(parent, id, pos, size, style, validator, name);
+ }
~wxListCtrl(void);
- bool Create( wxWindow *parent, wxWindowID id,
+ bool Create( wxWindow *parent, wxWindowID id = -1,
const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
- long style = 0, const wxString &name = "listctrl" );
+ long style = wxLC_ICON, const wxValidator& validator = wxDefaultValidator,
+ const wxString &name = "listctrl" );
void OnSize( wxSizeEvent &event );
bool GetColumn( int col, wxListItem& item );
bool SetColumn( int col, wxListItem& item );
bool m_hasVMT;
bool m_sizeSet;
bool m_resizing;
+ GdkGC *m_scrollGC;
public:
bool m_hasVMT;
bool m_sizeSet;
bool m_resizing;
+ GdkGC *m_scrollGC;
public:
m_imageListState = (wxImageList *) NULL;
}
-wxListCtrl::wxListCtrl( wxWindow *parent, wxWindowID id,
- const wxPoint &pos, const wxSize &size,
- long style, const wxString &name )
-
-{
- Create( parent, id, pos, size, style, name );
-}
-
wxListCtrl::~wxListCtrl(void)
{
}
bool wxListCtrl::Create( wxWindow *parent, wxWindowID id,
const wxPoint &pos, const wxSize &size,
- long style, const wxString &name )
+ long style, const wxValidator &validator,
+ const wxString &name )
{
m_imageListNormal = (wxImageList *) NULL;
m_imageListSmall = (wxImageList *) NULL;
bool ret = wxControl::Create( parent, id, pos, size, s, name );
+ SetValidator( validator );
+
m_mainWin = new wxListMainWindow( this, -1, wxPoint(0,0), size, s );
if (GetWindowStyleFlag() & wxLC_REPORT)
// Name: accel.cpp
// Purpose:
// Author: Robert Roebling
-// Id:
+// Id: $id$
// Copyright: (c) 1998 Robert Roebling
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
// Name: app.cpp
// Purpose:
// Author: Robert Roebling
-// Id: $id$
+// Id: $Id$
// Copyright: (c) 1998 Robert Roebling, Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
m_title = title;
- m_widget = gtk_window_new( GTK_WINDOW_TOPLEVEL );
+ GtkWindowType win_type = GTK_WINDOW_TOPLEVEL;
+ if (style & wxSIMPLE_BORDER) win_type = GTK_WINDOW_POPUP;
+
+ m_widget = gtk_window_new( win_type );
if ((size.x != -1) && (size.y != -1))
gtk_widget_set_usize( m_widget, m_width, m_height );
if ((pos.x != -1) && (pos.y != -1))
m_menus.DeleteContents( TRUE );
- m_widget = gtk_handle_box_new();
-
m_menubar = gtk_menu_bar_new();
-
- gtk_container_add( GTK_CONTAINER(m_widget), m_menubar );
-
- gtk_widget_show( m_menubar );
+
+ m_widget = GTK_WIDGET(m_menubar);
PostCreation();
// Name: tbargtk.cpp
// Purpose: GTK toolbar
// Author: Robert Roebling
-// Modified by:
-// Created: 01/02/97
-// RCS-ID:
+// RCS-ID: $Id$
// Copyright: (c) Robert Roebling
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
m_tools.DeleteContents( TRUE );
- m_widget = gtk_handle_box_new();
-
m_toolbar = GTK_TOOLBAR( gtk_toolbar_new( GTK_ORIENTATION_HORIZONTAL,
GTK_TOOLBAR_ICONS ) );
- gtk_toolbar_set_tooltips( GTK_TOOLBAR(m_toolbar), TRUE );
- gtk_container_add( GTK_CONTAINER(m_widget), GTK_WIDGET(m_toolbar) );
-
- gtk_widget_show( GTK_WIDGET(m_toolbar) );
+ m_widget = GTK_WIDGET(m_toolbar);
+
+ gtk_toolbar_set_tooltips( GTK_TOOLBAR(m_toolbar), TRUE );
PostCreation();
(gpointer)tool
);
- // VZ: we don't want GDK_NO_EXPOSE events because for some reason our
- // toolbar buttons get them (it doesn't happen in a standalone GTK+ program
- // for unknown reasons) and it prevents tooltips from appearing.
- gtk_widget_set_events( GTK_WIDGET(item),
- gtk_widget_get_events( GTK_WIDGET(item) ) &
- ~GDK_EXPOSURE_MASK);
tool->m_item = item;
gtk_signal_connect( GTK_OBJECT(tool->m_item),
m_pDropTarget = (wxDropTarget *) NULL;
m_resizing = FALSE;
m_hasOwnStyle = FALSE;
+ m_scrollGC = (GdkGC*) NULL;
}
bool wxWindow::Create( wxWindow *parent, wxWindowID id,
m_wxwindow = gtk_myfixed_new();
- if (m_wxwindow) GTK_WIDGET_UNSET_FLAGS( m_widget, GTK_CAN_FOCUS );
+ GTK_WIDGET_UNSET_FLAGS( m_widget, GTK_CAN_FOCUS );
if (m_windowStyle & wxTAB_TRAVERSAL == wxTAB_TRAVERSAL)
GTK_WIDGET_UNSET_FLAGS( m_wxwindow, GTK_CAN_FOCUS );
gtk_widget_show( m_wxwindow );
PostCreation();
-
+
Show( TRUE );
return TRUE;
DestroyChildren();
+ if (m_scrollGC) gdk_gc_unref( m_scrollGC );
+
if (m_wxwindow) gtk_widget_destroy( m_wxwindow );
if (m_widget) gtk_widget_destroy( m_widget );
if (m_widget && m_parent) gtk_widget_realize( m_widget );
- if (m_wxwindow)
- {
- gtk_widget_realize( m_wxwindow );
- gdk_gc_set_exposures( m_wxwindow->style->fg_gc[0], TRUE );
- }
+ if (m_wxwindow) gtk_widget_realize( m_wxwindow );
SetCursor( *wxSTANDARD_CURSOR );
int d_y = 0;
if (dx > 0) d_x = dx;
if (dy > 0) d_y = dy;
- gdk_window_copy_area( m_wxwindow->window, m_wxwindow->style->fg_gc[0], d_x, d_y,
+
+ if (!m_scrollGC)
+ {
+ m_scrollGC = gdk_gc_new( m_wxwindow->window );
+ gdk_gc_set_exposures( m_scrollGC, TRUE );
+ }
+
+ gdk_window_copy_area( m_wxwindow->window, m_scrollGC, d_x, d_y,
m_wxwindow->window, s_x, s_y, w, h );
wxRect rect;
// Name: accel.cpp
// Purpose:
// Author: Robert Roebling
-// Id:
+// Id: $id$
// Copyright: (c) 1998 Robert Roebling
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
// Name: app.cpp
// Purpose:
// Author: Robert Roebling
-// Id: $id$
+// Id: $Id$
// Copyright: (c) 1998 Robert Roebling, Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
m_title = title;
- m_widget = gtk_window_new( GTK_WINDOW_TOPLEVEL );
+ GtkWindowType win_type = GTK_WINDOW_TOPLEVEL;
+ if (style & wxSIMPLE_BORDER) win_type = GTK_WINDOW_POPUP;
+
+ m_widget = gtk_window_new( win_type );
if ((size.x != -1) && (size.y != -1))
gtk_widget_set_usize( m_widget, m_width, m_height );
if ((pos.x != -1) && (pos.y != -1))
m_menus.DeleteContents( TRUE );
- m_widget = gtk_handle_box_new();
-
m_menubar = gtk_menu_bar_new();
-
- gtk_container_add( GTK_CONTAINER(m_widget), m_menubar );
-
- gtk_widget_show( m_menubar );
+
+ m_widget = GTK_WIDGET(m_menubar);
PostCreation();
// Name: tbargtk.cpp
// Purpose: GTK toolbar
// Author: Robert Roebling
-// Modified by:
-// Created: 01/02/97
-// RCS-ID:
+// RCS-ID: $Id$
// Copyright: (c) Robert Roebling
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
m_tools.DeleteContents( TRUE );
- m_widget = gtk_handle_box_new();
-
m_toolbar = GTK_TOOLBAR( gtk_toolbar_new( GTK_ORIENTATION_HORIZONTAL,
GTK_TOOLBAR_ICONS ) );
- gtk_toolbar_set_tooltips( GTK_TOOLBAR(m_toolbar), TRUE );
- gtk_container_add( GTK_CONTAINER(m_widget), GTK_WIDGET(m_toolbar) );
-
- gtk_widget_show( GTK_WIDGET(m_toolbar) );
+ m_widget = GTK_WIDGET(m_toolbar);
+
+ gtk_toolbar_set_tooltips( GTK_TOOLBAR(m_toolbar), TRUE );
PostCreation();
(gpointer)tool
);
- // VZ: we don't want GDK_NO_EXPOSE events because for some reason our
- // toolbar buttons get them (it doesn't happen in a standalone GTK+ program
- // for unknown reasons) and it prevents tooltips from appearing.
- gtk_widget_set_events( GTK_WIDGET(item),
- gtk_widget_get_events( GTK_WIDGET(item) ) &
- ~GDK_EXPOSURE_MASK);
tool->m_item = item;
gtk_signal_connect( GTK_OBJECT(tool->m_item),
m_pDropTarget = (wxDropTarget *) NULL;
m_resizing = FALSE;
m_hasOwnStyle = FALSE;
+ m_scrollGC = (GdkGC*) NULL;
}
bool wxWindow::Create( wxWindow *parent, wxWindowID id,
m_wxwindow = gtk_myfixed_new();
- if (m_wxwindow) GTK_WIDGET_UNSET_FLAGS( m_widget, GTK_CAN_FOCUS );
+ GTK_WIDGET_UNSET_FLAGS( m_widget, GTK_CAN_FOCUS );
if (m_windowStyle & wxTAB_TRAVERSAL == wxTAB_TRAVERSAL)
GTK_WIDGET_UNSET_FLAGS( m_wxwindow, GTK_CAN_FOCUS );
gtk_widget_show( m_wxwindow );
PostCreation();
-
+
Show( TRUE );
return TRUE;
DestroyChildren();
+ if (m_scrollGC) gdk_gc_unref( m_scrollGC );
+
if (m_wxwindow) gtk_widget_destroy( m_wxwindow );
if (m_widget) gtk_widget_destroy( m_widget );
if (m_widget && m_parent) gtk_widget_realize( m_widget );
- if (m_wxwindow)
- {
- gtk_widget_realize( m_wxwindow );
- gdk_gc_set_exposures( m_wxwindow->style->fg_gc[0], TRUE );
- }
+ if (m_wxwindow) gtk_widget_realize( m_wxwindow );
SetCursor( *wxSTANDARD_CURSOR );
int d_y = 0;
if (dx > 0) d_x = dx;
if (dy > 0) d_y = dy;
- gdk_window_copy_area( m_wxwindow->window, m_wxwindow->style->fg_gc[0], d_x, d_y,
+
+ if (!m_scrollGC)
+ {
+ m_scrollGC = gdk_gc_new( m_wxwindow->window );
+ gdk_gc_set_exposures( m_scrollGC, TRUE );
+ }
+
+ gdk_window_copy_area( m_wxwindow->window, m_scrollGC, d_x, d_y,
m_wxwindow->window, s_x, s_y, w, h );
wxRect rect;