frame->SetIcon( wxICON(mondrian) );
- // submenu
- wxMenu *sub_menu = new wxMenu( wxMENU_TEAROFF );
- sub_menu->Append(MINIMAL_ABOUT, "&About", "About this sample");
- sub_menu->Append(MINIMAL_ABOUT, "&About", "About this sample");
- sub_menu->Append(MINIMAL_ABOUT, "&About", "About this sample");
-
wxMenu *file_menu = new wxMenu;
file_menu->Append(MINIMAL_ABOUT, "&About\tF1");
file_menu->Append(MINIMAL_QUIT, "E&xit\tAlt-X", "Quit controls sample");
- file_menu->Append( 0, "&Submenu", sub_menu );
- wxMenuBar *menu_bar = new wxMenuBar( wxMB_DOCKABLE );
+ wxMenuBar *menu_bar = new wxMenuBar;
menu_bar->Append(file_menu, "&File");
#if wxUSE_TOOLTIPS
// TODO: this should be an error log function
wxFAIL_MSG("set a valid font before calling GetTextExtent!");
- *width = -1;
- *height = -1;
+ if (width) *width = -1;
+ if (height) *height = -1;
return;
}
XTextExtents((XFontStruct*) pFontStruct, (char*) (const char*) string, slen, &direction,
&ascent, &descent2, &overall);
- *width = XDEV2LOGREL (overall.width);
- *height = YDEV2LOGREL (ascent + descent2);
+ if (width) *width = XDEV2LOGREL (overall.width);
+ if (height) *height = YDEV2LOGREL (ascent + descent2);
if (descent)
*descent = descent2;
if (externalLeading)
void wxWindowDC::DoSetClippingRegion( long x, long y, long width, long height )
{
- wxDC::SetClippingRegion( x, y, width, height );
+ wxDC::DoSetClippingRegion( x, y, width, height );
if (m_userRegion)
XDestroyRegion ((Region) m_userRegion);
{
wxRect box = region.GetBox();
- wxDC::SetClippingRegion( box.x, box.y, box.width, box.height );
+ wxDC::DoSetClippingRegion( box.x, box.y, box.width, box.height );
if (m_userRegion)
XDestroyRegion ((Region) m_userRegion);
#include "wx/msgdlg.h"
#include "wx/frame.h"
#include "wx/scrolwin.h"
-
+#include "wx/module.h"
#include "wx/menuitem.h"
#include "wx/log.h"
// global variables for this module
// ----------------------------------------------------------------------------
-static wxHashTable *gs_wxWidgetHashTable;
+extern wxHashTable *wxWidgetHashTable;
// ----------------------------------------------------------------------------
// private functions
bool wxAddWindowToTable(Widget w, wxWindow *win)
{
wxWindow *oldItem = NULL;
- if ((oldItem = (wxWindow *)gs_wxWidgetHashTable->Get ((long) w)))
+ if ((oldItem = (wxWindow *)wxWidgetHashTable->Get ((long) w)))
{
wxLogDebug("Widget table clash: new widget is %ld, %s",
(long)w, win->GetClassInfo()->GetClassName());
return FALSE;
}
- gs_wxWidgetHashTable->Put((long) w, win);
+ wxWidgetHashTable->Put((long) w, win);
return TRUE;
}
wxWindow *wxGetWindowFromTable(Widget w)
{
- return (wxWindow *)gs_wxWidgetHashTable->Get((long) w);
+ return (wxWindow *)wxWidgetHashTable->Get((long) w);
}
void wxDeleteWindowFromTable(Widget w)
{
- gs_wxWidgetHashTable->Delete((long)w);
+ wxWidgetHashTable->Delete((long)w);
}
// ----------------------------------------------------------------------------