friend wxFrame;
friend wxDialog;
friend wxTreeCtrl;
+ friend wxNotebook;
GdkPixmap *GetPixmap() const;
GdkBitmap *GetBitmap() const;
friend wxFrame;
friend wxDialog;
friend wxTreeCtrl;
+ friend wxNotebook;
GdkPixmap *GetPixmap() const;
GdkBitmap *GetBitmap() const;
CreateToolBar(wxNO_BORDER|wxTB_FLAT|wxTB_HORIZONTAL);
InitToolBar(GetToolBar());
-#ifdef __WXMSW__
// Accelerators
wxAcceleratorEntry entries[3];
entries[0].Set(wxACCEL_CTRL, (int) 'N', MDI_NEW_WINDOW);
entries[2].Set(wxACCEL_CTRL, (int) 'A', MDI_ABOUT);
wxAcceleratorTable accel(3, entries);
SetAcceleratorTable(accel);
-#endif
}
void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event) )
common/memory.cpp \
common/module.cpp \
common/object.cpp \
+ common/odbc.cpp \
common/postscrp.cpp \
common/prntbase.cpp \
common/resource.cpp \
#include "wx/accel.h"
+#include <ctype.h>
+
//-----------------------------------------------------------------------------
// wxAcceleratorTable
//-----------------------------------------------------------------------------
public:
wxAccelRefData(void);
+ ~wxAccelRefData(void);
wxList m_accels;
};
wxAccelRefData::wxAccelRefData(void)
{
- m_accels.DeleteContents( TRUE );
+}
+
+wxAccelRefData::~wxAccelRefData(void)
+{
+ wxNode *node = m_accels.First();
+ while (node)
+ {
+ wxAcceleratorEntry *entry = (wxAcceleratorEntry *)node->Data();
+ delete entry;
+ node = node->Next();
+ }
}
//-----------------------------------------------------------------------------
m_refData = new wxAccelRefData();
for (int i = 0; i < n; i++)
{
- M_ACCELDATA->m_accels.Append( (wxObject*)
- new wxAcceleratorEntry( entries[n].GetFlags(), entries[n].GetKeyCode(), entries[n].GetCommand() ) );
+ int flag = entries[i].GetFlags();
+ int keycode = entries[i].GetKeyCode();
+ int command = entries[i].GetCommand();
+ if ((keycode >= (int)'A') && (keycode <= (int)'Z')) keycode = (int)tolower( (char)keycode );
+ M_ACCELDATA->m_accels.Append( (wxObject*) new wxAcceleratorEntry( flag, keycode, command ) );
}
}
if (!ret)
{
- int command = win->GetAcceleratorTable()->GetCommand( event );
- if (command != -1)
- {
- wxCommandEvent command_event( wxEVT_COMMAND_MENU_SELECTED, command );
- ret = win->GetEventHandler()->ProcessEvent( command_event );
+ wxWindow *ancestor = win;
+ while (ancestor)
+ {
+ int command = ancestor->GetAcceleratorTable()->GetCommand( event );
+ if (command != -1)
+ {
+ wxCommandEvent command_event( wxEVT_COMMAND_MENU_SELECTED, command );
+ ret = ancestor->GetEventHandler()->ProcessEvent( command_event );
+ break;
+ }
+ ancestor = ancestor->GetParent();
}
}
if (theFont) fontToUse = *theFont;
GdkFont *font = fontToUse.GetInternalFont( 1.0 );
- if (x) (*y) = gdk_string_width( font, string );
+ if (x) (*x) = gdk_string_width( font, string );
if (y) (*y) = font->ascent + font->descent;
if (descent) (*descent) = font->descent;
if (externalLeading) (*externalLeading) = 0; // ??
#include "wx/accel.h"
+#include <ctype.h>
+
//-----------------------------------------------------------------------------
// wxAcceleratorTable
//-----------------------------------------------------------------------------
public:
wxAccelRefData(void);
+ ~wxAccelRefData(void);
wxList m_accels;
};
wxAccelRefData::wxAccelRefData(void)
{
- m_accels.DeleteContents( TRUE );
+}
+
+wxAccelRefData::~wxAccelRefData(void)
+{
+ wxNode *node = m_accels.First();
+ while (node)
+ {
+ wxAcceleratorEntry *entry = (wxAcceleratorEntry *)node->Data();
+ delete entry;
+ node = node->Next();
+ }
}
//-----------------------------------------------------------------------------
m_refData = new wxAccelRefData();
for (int i = 0; i < n; i++)
{
- M_ACCELDATA->m_accels.Append( (wxObject*)
- new wxAcceleratorEntry( entries[n].GetFlags(), entries[n].GetKeyCode(), entries[n].GetCommand() ) );
+ int flag = entries[i].GetFlags();
+ int keycode = entries[i].GetKeyCode();
+ int command = entries[i].GetCommand();
+ if ((keycode >= (int)'A') && (keycode <= (int)'Z')) keycode = (int)tolower( (char)keycode );
+ M_ACCELDATA->m_accels.Append( (wxObject*) new wxAcceleratorEntry( flag, keycode, command ) );
}
}
if (!ret)
{
- int command = win->GetAcceleratorTable()->GetCommand( event );
- if (command != -1)
- {
- wxCommandEvent command_event( wxEVT_COMMAND_MENU_SELECTED, command );
- ret = win->GetEventHandler()->ProcessEvent( command_event );
+ wxWindow *ancestor = win;
+ while (ancestor)
+ {
+ int command = ancestor->GetAcceleratorTable()->GetCommand( event );
+ if (command != -1)
+ {
+ wxCommandEvent command_event( wxEVT_COMMAND_MENU_SELECTED, command );
+ ret = ancestor->GetEventHandler()->ProcessEvent( command_event );
+ break;
+ }
+ ancestor = ancestor->GetParent();
}
}
if (theFont) fontToUse = *theFont;
GdkFont *font = fontToUse.GetInternalFont( 1.0 );
- if (x) (*y) = gdk_string_width( font, string );
+ if (x) (*x) = gdk_string_width( font, string );
if (y) (*y) = font->ascent + font->descent;
if (descent) (*descent) = font->descent;
if (externalLeading) (*externalLeading) = 0; // ??