The colour is called Aquamarine, not Aquaramine. No,
you cannot eat it either. Also, menubar short cuts work now. Some more focus goodies. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2282 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -231,9 +231,9 @@ void MyFrame::FileOpen(wxCommandEvent& WXUNUSED(event) )
|
|||||||
if (dialog.ShowModal() == wxID_OK)
|
if (dialog.ShowModal() == wxID_OK)
|
||||||
{
|
{
|
||||||
wxString info;
|
wxString info;
|
||||||
info.Printf("Full file name: %s\n"
|
info.Printf(_T("Full file name: %s\n")
|
||||||
"Path: %s\n"
|
_T("Path: %s\n")
|
||||||
"Name: %s",
|
_T("Name: %s"),
|
||||||
dialog.GetPath().c_str(),
|
dialog.GetPath().c_str(),
|
||||||
dialog.GetDirectory().c_str(),
|
dialog.GetDirectory().c_str(),
|
||||||
dialog.GetFilename().c_str());
|
dialog.GetFilename().c_str());
|
||||||
@@ -250,8 +250,8 @@ void MyFrame::FileSave(wxCommandEvent& WXUNUSED(event) )
|
|||||||
|
|
||||||
if (dialog.ShowModal() == wxID_OK)
|
if (dialog.ShowModal() == wxID_OK)
|
||||||
{
|
{
|
||||||
char buf[400];
|
wxChar buf[400];
|
||||||
sprintf(buf, "%s, filter %d", (const char *)dialog.GetPath(), dialog.GetFilterIndex());
|
wxSprintf(buf, _T("%s, filter %d"), (const wxChar*)dialog.GetPath(), dialog.GetFilterIndex());
|
||||||
wxMessageDialog dialog2(this, wxString(buf), "Selected path");
|
wxMessageDialog dialog2(this, wxString(buf), "Selected path");
|
||||||
dialog2.ShowModal();
|
dialog2.ShowModal();
|
||||||
}
|
}
|
||||||
|
@@ -86,7 +86,7 @@ static wxString wxColourDialogNames[NUM_COLS]={_T("ORANGE"),
|
|||||||
_T("FIREBRICK"),
|
_T("FIREBRICK"),
|
||||||
_T("CORAL"),
|
_T("CORAL"),
|
||||||
_T("FOREST GREEN"),
|
_T("FOREST GREEN"),
|
||||||
_T("AQUARAMINE"),
|
_T("AQUAMARINE"),
|
||||||
_T("BLUE"),
|
_T("BLUE"),
|
||||||
_T("NAVY"),
|
_T("NAVY"),
|
||||||
_T("THISTLE"),
|
_T("THISTLE"),
|
||||||
|
@@ -193,6 +193,16 @@ gtk_frame_realized_callback( GtkWidget *widget, wxFrame *win )
|
|||||||
win->SetIcon( icon );
|
win->SetIcon( icon );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!win->m_sizeSet)
|
||||||
|
{
|
||||||
|
/* by calling GtkOnSize here, we don't have to call
|
||||||
|
either after showing the frame, which would entail
|
||||||
|
much ugly flicker or from within the size_allocate
|
||||||
|
handler, because GTK 1.1.X forbids that. */
|
||||||
|
|
||||||
|
win->GtkOnSize( win->m_x, win->m_y, win->m_width, win->m_height );
|
||||||
|
}
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -331,11 +341,11 @@ bool wxFrame::Create( wxWindow *parent, wxWindowID id, const wxString &title,
|
|||||||
gtk_container_add( GTK_CONTAINER(m_mainWidget), m_wxwindow );
|
gtk_container_add( GTK_CONTAINER(m_mainWidget), m_wxwindow );
|
||||||
|
|
||||||
/* we allow the frame to get the focus as otherwise no
|
/* we allow the frame to get the focus as otherwise no
|
||||||
keye vents will get sent to it. the point with this is
|
key events will get sent to it. the point with this is
|
||||||
that the menu's key accelerators work by interceting
|
that the menu's key accelerators work by interceting
|
||||||
key events here */
|
key events here */
|
||||||
GTK_WIDGET_SET_FLAGS( m_wxwindow, GTK_CAN_FOCUS );
|
GTK_WIDGET_SET_FLAGS( m_wxwindow, GTK_CAN_FOCUS );
|
||||||
GTK_WIDGET_SET_FLAGS (m_wxwindow, GTK_HAS_FOCUS);
|
gtk_widget_grab_focus( m_wxwindow );
|
||||||
|
|
||||||
if (m_parent) m_parent->AddChild( this );
|
if (m_parent) m_parent->AddChild( this );
|
||||||
|
|
||||||
@@ -381,6 +391,7 @@ bool wxFrame::Show( bool show )
|
|||||||
{
|
{
|
||||||
wxASSERT_MSG( (m_widget != NULL), _T("invalid frame") );
|
wxASSERT_MSG( (m_widget != NULL), _T("invalid frame") );
|
||||||
|
|
||||||
|
#if 0
|
||||||
if (show && !m_sizeSet)
|
if (show && !m_sizeSet)
|
||||||
{
|
{
|
||||||
/* by calling GtkOnSize here, we don't have to call
|
/* by calling GtkOnSize here, we don't have to call
|
||||||
@@ -390,6 +401,7 @@ bool wxFrame::Show( bool show )
|
|||||||
|
|
||||||
GtkOnSize( m_x, m_y, m_width, m_height );
|
GtkOnSize( m_x, m_y, m_width, m_height );
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
return wxWindow::Show( show );
|
return wxWindow::Show( show );
|
||||||
}
|
}
|
||||||
@@ -764,8 +776,8 @@ void wxFrame::SetMenuBar( wxMenuBar *menuBar )
|
|||||||
{
|
{
|
||||||
/* support for native key accelerators indicated by underscroes */
|
/* support for native key accelerators indicated by underscroes */
|
||||||
#if (GTK_MINOR_VERSION > 0) && (GTK_MICRO_VERSION > 0)
|
#if (GTK_MINOR_VERSION > 0) && (GTK_MICRO_VERSION > 0)
|
||||||
gtk_accel_group_attach( m_frameMenuBar->m_accel, GTK_OBJECT(m_wxwindow));
|
gtk_accel_group_attach( m_frameMenuBar->m_accel, GTK_OBJECT(m_widget));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
wxNode *node = m_frameMenuBar->GetMenus().First();
|
wxNode *node = m_frameMenuBar->GetMenus().First();
|
||||||
while (node)
|
while (node)
|
||||||
|
@@ -286,6 +286,7 @@ static gint gtk_window_key_press_callback( GtkWidget *widget, GdkEventKey *gdk_e
|
|||||||
wxPrintf( win->GetClassInfo()->GetClassName() );
|
wxPrintf( win->GetClassInfo()->GetClassName() );
|
||||||
wxPrintf( _T(".\n") );
|
wxPrintf( _T(".\n") );
|
||||||
*/
|
*/
|
||||||
|
|
||||||
long key_code = 0;
|
long key_code = 0;
|
||||||
switch (gdk_event->keyval)
|
switch (gdk_event->keyval)
|
||||||
{
|
{
|
||||||
@@ -1544,10 +1545,10 @@ bool wxWindow::Create( wxWindow *parent, wxWindowID id,
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* we always allow a window to get the focus as long as it
|
||||||
|
doesn't have any children. */
|
||||||
if (m_windowStyle & wxTAB_TRAVERSAL)
|
if (m_windowStyle & wxTAB_TRAVERSAL)
|
||||||
{
|
{
|
||||||
/* we now allow a window to get the focus as long as it
|
|
||||||
doesn't have any children. */
|
|
||||||
GTK_WIDGET_SET_FLAGS( m_wxwindow, GTK_CAN_FOCUS );
|
GTK_WIDGET_SET_FLAGS( m_wxwindow, GTK_CAN_FOCUS );
|
||||||
m_acceptsFocus = FALSE;
|
m_acceptsFocus = FALSE;
|
||||||
}
|
}
|
||||||
@@ -1556,6 +1557,9 @@ bool wxWindow::Create( wxWindow *parent, wxWindowID id,
|
|||||||
GTK_WIDGET_SET_FLAGS( m_wxwindow, GTK_CAN_FOCUS );
|
GTK_WIDGET_SET_FLAGS( m_wxwindow, GTK_CAN_FOCUS );
|
||||||
m_acceptsFocus = TRUE;
|
m_acceptsFocus = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* grab the actual focus */
|
||||||
|
gtk_widget_grab_focus( m_wxwindow );
|
||||||
|
|
||||||
#if (GTK_MINOR_VERSION == 0)
|
#if (GTK_MINOR_VERSION == 0)
|
||||||
// shut the viewport up
|
// shut the viewport up
|
||||||
|
@@ -193,6 +193,16 @@ gtk_frame_realized_callback( GtkWidget *widget, wxFrame *win )
|
|||||||
win->SetIcon( icon );
|
win->SetIcon( icon );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!win->m_sizeSet)
|
||||||
|
{
|
||||||
|
/* by calling GtkOnSize here, we don't have to call
|
||||||
|
either after showing the frame, which would entail
|
||||||
|
much ugly flicker or from within the size_allocate
|
||||||
|
handler, because GTK 1.1.X forbids that. */
|
||||||
|
|
||||||
|
win->GtkOnSize( win->m_x, win->m_y, win->m_width, win->m_height );
|
||||||
|
}
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -331,11 +341,11 @@ bool wxFrame::Create( wxWindow *parent, wxWindowID id, const wxString &title,
|
|||||||
gtk_container_add( GTK_CONTAINER(m_mainWidget), m_wxwindow );
|
gtk_container_add( GTK_CONTAINER(m_mainWidget), m_wxwindow );
|
||||||
|
|
||||||
/* we allow the frame to get the focus as otherwise no
|
/* we allow the frame to get the focus as otherwise no
|
||||||
keye vents will get sent to it. the point with this is
|
key events will get sent to it. the point with this is
|
||||||
that the menu's key accelerators work by interceting
|
that the menu's key accelerators work by interceting
|
||||||
key events here */
|
key events here */
|
||||||
GTK_WIDGET_SET_FLAGS( m_wxwindow, GTK_CAN_FOCUS );
|
GTK_WIDGET_SET_FLAGS( m_wxwindow, GTK_CAN_FOCUS );
|
||||||
GTK_WIDGET_SET_FLAGS (m_wxwindow, GTK_HAS_FOCUS);
|
gtk_widget_grab_focus( m_wxwindow );
|
||||||
|
|
||||||
if (m_parent) m_parent->AddChild( this );
|
if (m_parent) m_parent->AddChild( this );
|
||||||
|
|
||||||
@@ -381,6 +391,7 @@ bool wxFrame::Show( bool show )
|
|||||||
{
|
{
|
||||||
wxASSERT_MSG( (m_widget != NULL), _T("invalid frame") );
|
wxASSERT_MSG( (m_widget != NULL), _T("invalid frame") );
|
||||||
|
|
||||||
|
#if 0
|
||||||
if (show && !m_sizeSet)
|
if (show && !m_sizeSet)
|
||||||
{
|
{
|
||||||
/* by calling GtkOnSize here, we don't have to call
|
/* by calling GtkOnSize here, we don't have to call
|
||||||
@@ -390,6 +401,7 @@ bool wxFrame::Show( bool show )
|
|||||||
|
|
||||||
GtkOnSize( m_x, m_y, m_width, m_height );
|
GtkOnSize( m_x, m_y, m_width, m_height );
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
return wxWindow::Show( show );
|
return wxWindow::Show( show );
|
||||||
}
|
}
|
||||||
@@ -764,8 +776,8 @@ void wxFrame::SetMenuBar( wxMenuBar *menuBar )
|
|||||||
{
|
{
|
||||||
/* support for native key accelerators indicated by underscroes */
|
/* support for native key accelerators indicated by underscroes */
|
||||||
#if (GTK_MINOR_VERSION > 0) && (GTK_MICRO_VERSION > 0)
|
#if (GTK_MINOR_VERSION > 0) && (GTK_MICRO_VERSION > 0)
|
||||||
gtk_accel_group_attach( m_frameMenuBar->m_accel, GTK_OBJECT(m_wxwindow));
|
gtk_accel_group_attach( m_frameMenuBar->m_accel, GTK_OBJECT(m_widget));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
wxNode *node = m_frameMenuBar->GetMenus().First();
|
wxNode *node = m_frameMenuBar->GetMenus().First();
|
||||||
while (node)
|
while (node)
|
||||||
|
@@ -286,6 +286,7 @@ static gint gtk_window_key_press_callback( GtkWidget *widget, GdkEventKey *gdk_e
|
|||||||
wxPrintf( win->GetClassInfo()->GetClassName() );
|
wxPrintf( win->GetClassInfo()->GetClassName() );
|
||||||
wxPrintf( _T(".\n") );
|
wxPrintf( _T(".\n") );
|
||||||
*/
|
*/
|
||||||
|
|
||||||
long key_code = 0;
|
long key_code = 0;
|
||||||
switch (gdk_event->keyval)
|
switch (gdk_event->keyval)
|
||||||
{
|
{
|
||||||
@@ -1544,10 +1545,10 @@ bool wxWindow::Create( wxWindow *parent, wxWindowID id,
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* we always allow a window to get the focus as long as it
|
||||||
|
doesn't have any children. */
|
||||||
if (m_windowStyle & wxTAB_TRAVERSAL)
|
if (m_windowStyle & wxTAB_TRAVERSAL)
|
||||||
{
|
{
|
||||||
/* we now allow a window to get the focus as long as it
|
|
||||||
doesn't have any children. */
|
|
||||||
GTK_WIDGET_SET_FLAGS( m_wxwindow, GTK_CAN_FOCUS );
|
GTK_WIDGET_SET_FLAGS( m_wxwindow, GTK_CAN_FOCUS );
|
||||||
m_acceptsFocus = FALSE;
|
m_acceptsFocus = FALSE;
|
||||||
}
|
}
|
||||||
@@ -1556,6 +1557,9 @@ bool wxWindow::Create( wxWindow *parent, wxWindowID id,
|
|||||||
GTK_WIDGET_SET_FLAGS( m_wxwindow, GTK_CAN_FOCUS );
|
GTK_WIDGET_SET_FLAGS( m_wxwindow, GTK_CAN_FOCUS );
|
||||||
m_acceptsFocus = TRUE;
|
m_acceptsFocus = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* grab the actual focus */
|
||||||
|
gtk_widget_grab_focus( m_wxwindow );
|
||||||
|
|
||||||
#if (GTK_MINOR_VERSION == 0)
|
#if (GTK_MINOR_VERSION == 0)
|
||||||
// shut the viewport up
|
// shut the viewport up
|
||||||
|
Reference in New Issue
Block a user