Resize fine tuning
thread_list no longer keyed git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1056 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -285,8 +285,6 @@ void wxFrame::SetSize( int x, int y, int width, int height, int sizeFlags )
|
|||||||
gtk_widget_set_usize( m_widget, m_width, m_height );
|
gtk_widget_set_usize( m_widget, m_width, m_height );
|
||||||
}
|
}
|
||||||
|
|
||||||
m_sizeSet = TRUE;
|
|
||||||
|
|
||||||
wxSizeEvent event( wxSize(m_width,m_height), GetId() );
|
wxSizeEvent event( wxSize(m_width,m_height), GetId() );
|
||||||
event.SetEventObject( this );
|
event.SetEventObject( this );
|
||||||
GetEventHandler()->ProcessEvent( event );
|
GetEventHandler()->ProcessEvent( event );
|
||||||
@@ -368,7 +366,7 @@ void wxFrame::GtkOnSize( int WXUNUSED(x), int WXUNUSED(y), int width, int height
|
|||||||
gtk_widget_set_usize( m_widget, m_width, m_height );
|
gtk_widget_set_usize( m_widget, m_width, m_height );
|
||||||
|
|
||||||
// This emulates the new wxMSW behaviour
|
// This emulates the new wxMSW behaviour
|
||||||
|
|
||||||
if (m_frameMenuBar)
|
if (m_frameMenuBar)
|
||||||
{
|
{
|
||||||
m_frameMenuBar->m_x = 1;
|
m_frameMenuBar->m_x = 1;
|
||||||
@@ -454,7 +452,7 @@ void wxFrame::OnSize( wxSizeEvent &WXUNUSED(event) )
|
|||||||
// yes: set it's size to fill all the frame
|
// yes: set it's size to fill all the frame
|
||||||
int client_x, client_y;
|
int client_x, client_y;
|
||||||
GetClientSize( &client_x, &client_y );
|
GetClientSize( &client_x, &client_y );
|
||||||
child->SetSize( 1, 1, client_x-2, client_y);
|
child->SetSize( 1, 1, client_x-2, client_y-2 );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -495,6 +493,8 @@ void wxFrame::SetMenuBar( wxMenuBar *menuBar )
|
|||||||
m_frameMenuBar->m_widget, m_frameMenuBar->m_x, m_frameMenuBar->m_y );
|
m_frameMenuBar->m_widget, m_frameMenuBar->m_x, m_frameMenuBar->m_y );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (m_sizeSet) GtkOnSize( m_x, m_y, m_width, m_height );
|
||||||
}
|
}
|
||||||
|
|
||||||
wxMenuBar *wxFrame::GetMenuBar(void) const
|
wxMenuBar *wxFrame::GetMenuBar(void) const
|
||||||
@@ -511,6 +511,8 @@ wxToolBar* wxFrame::CreateToolBar(long style, wxWindowID id, const wxString& nam
|
|||||||
m_frameToolBar = OnCreateToolBar( style, id, name );
|
m_frameToolBar = OnCreateToolBar( style, id, name );
|
||||||
|
|
||||||
GetChildren()->DeleteObject( m_frameToolBar );
|
GetChildren()->DeleteObject( m_frameToolBar );
|
||||||
|
|
||||||
|
if (m_sizeSet) GtkOnSize( m_x, m_y, m_width, m_height );
|
||||||
|
|
||||||
return m_frameToolBar;
|
return m_frameToolBar;
|
||||||
}
|
}
|
||||||
@@ -533,6 +535,8 @@ wxStatusBar* wxFrame::CreateStatusBar( int number, long style, wxWindowID id, co
|
|||||||
|
|
||||||
m_frameStatusBar = OnCreateStatusBar( number, style, id, name );
|
m_frameStatusBar = OnCreateStatusBar( number, style, id, name );
|
||||||
|
|
||||||
|
if (m_sizeSet) GtkOnSize( m_x, m_y, m_width, m_height );
|
||||||
|
|
||||||
return m_frameStatusBar;
|
return m_frameStatusBar;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -380,7 +380,7 @@ public:
|
|||||||
wxMainMutex = new wxMutex();
|
wxMainMutex = new wxMutex();
|
||||||
wxThreadGuiInit();
|
wxThreadGuiInit();
|
||||||
p_mainid = pthread_self();
|
p_mainid = pthread_self();
|
||||||
p_threads_list = wxList(wxKEY_INTEGER);
|
// p_threads_list = wxList(wxKEY_INTEGER);
|
||||||
wxMainMutex->Lock();
|
wxMainMutex->Lock();
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@@ -186,15 +186,15 @@ static void gtk_window_draw_callback( GtkWidget *WXUNUSED(widget), GdkRectangle
|
|||||||
|
|
||||||
static gint gtk_window_key_press_callback( GtkWidget *widget, GdkEventKey *gdk_event, wxWindow *win )
|
static gint gtk_window_key_press_callback( GtkWidget *widget, GdkEventKey *gdk_event, wxWindow *win )
|
||||||
{
|
{
|
||||||
printf( "OnKeyPress.\n " );
|
|
||||||
|
|
||||||
if (!win->HasVMT()) return FALSE;
|
if (!win->HasVMT()) return FALSE;
|
||||||
if (g_blockEventsOnDrag) return FALSE;
|
if (g_blockEventsOnDrag) return FALSE;
|
||||||
|
|
||||||
|
/*
|
||||||
printf( "OnKeyPress from " );
|
printf( "OnKeyPress from " );
|
||||||
if (win->GetClassInfo() && win->GetClassInfo()->GetClassName())
|
if (win->GetClassInfo() && win->GetClassInfo()->GetClassName())
|
||||||
printf( win->GetClassInfo()->GetClassName() );
|
printf( win->GetClassInfo()->GetClassName() );
|
||||||
printf( ".\n" );
|
printf( ".\n" );
|
||||||
|
*/
|
||||||
|
|
||||||
long key_code = 0;
|
long key_code = 0;
|
||||||
switch (gdk_event->keyval)
|
switch (gdk_event->keyval)
|
||||||
@@ -286,19 +286,13 @@ static gint gtk_window_key_press_callback( GtkWidget *widget, GdkEventKey *gdk_e
|
|||||||
event.m_y = 0;
|
event.m_y = 0;
|
||||||
event.SetEventObject( win );
|
event.SetEventObject( win );
|
||||||
|
|
||||||
printf( "process key.\n" );
|
|
||||||
|
|
||||||
bool ret = win->GetEventHandler()->ProcessEvent( event );
|
bool ret = win->GetEventHandler()->ProcessEvent( event );
|
||||||
|
|
||||||
printf( "no handler.\n" );
|
|
||||||
|
|
||||||
if (!ret)
|
if (!ret)
|
||||||
{
|
{
|
||||||
wxWindow *ancestor = win;
|
wxWindow *ancestor = win;
|
||||||
while (ancestor)
|
while (ancestor)
|
||||||
{
|
{
|
||||||
printf( "check accel in %s .\n", WXSTRINGCAST ancestor->GetName() );
|
|
||||||
|
|
||||||
int command = ancestor->GetAcceleratorTable()->GetCommand( event );
|
int command = ancestor->GetAcceleratorTable()->GetCommand( event );
|
||||||
if (command != -1)
|
if (command != -1)
|
||||||
{
|
{
|
||||||
|
@@ -285,8 +285,6 @@ void wxFrame::SetSize( int x, int y, int width, int height, int sizeFlags )
|
|||||||
gtk_widget_set_usize( m_widget, m_width, m_height );
|
gtk_widget_set_usize( m_widget, m_width, m_height );
|
||||||
}
|
}
|
||||||
|
|
||||||
m_sizeSet = TRUE;
|
|
||||||
|
|
||||||
wxSizeEvent event( wxSize(m_width,m_height), GetId() );
|
wxSizeEvent event( wxSize(m_width,m_height), GetId() );
|
||||||
event.SetEventObject( this );
|
event.SetEventObject( this );
|
||||||
GetEventHandler()->ProcessEvent( event );
|
GetEventHandler()->ProcessEvent( event );
|
||||||
@@ -368,7 +366,7 @@ void wxFrame::GtkOnSize( int WXUNUSED(x), int WXUNUSED(y), int width, int height
|
|||||||
gtk_widget_set_usize( m_widget, m_width, m_height );
|
gtk_widget_set_usize( m_widget, m_width, m_height );
|
||||||
|
|
||||||
// This emulates the new wxMSW behaviour
|
// This emulates the new wxMSW behaviour
|
||||||
|
|
||||||
if (m_frameMenuBar)
|
if (m_frameMenuBar)
|
||||||
{
|
{
|
||||||
m_frameMenuBar->m_x = 1;
|
m_frameMenuBar->m_x = 1;
|
||||||
@@ -454,7 +452,7 @@ void wxFrame::OnSize( wxSizeEvent &WXUNUSED(event) )
|
|||||||
// yes: set it's size to fill all the frame
|
// yes: set it's size to fill all the frame
|
||||||
int client_x, client_y;
|
int client_x, client_y;
|
||||||
GetClientSize( &client_x, &client_y );
|
GetClientSize( &client_x, &client_y );
|
||||||
child->SetSize( 1, 1, client_x-2, client_y);
|
child->SetSize( 1, 1, client_x-2, client_y-2 );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -495,6 +493,8 @@ void wxFrame::SetMenuBar( wxMenuBar *menuBar )
|
|||||||
m_frameMenuBar->m_widget, m_frameMenuBar->m_x, m_frameMenuBar->m_y );
|
m_frameMenuBar->m_widget, m_frameMenuBar->m_x, m_frameMenuBar->m_y );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (m_sizeSet) GtkOnSize( m_x, m_y, m_width, m_height );
|
||||||
}
|
}
|
||||||
|
|
||||||
wxMenuBar *wxFrame::GetMenuBar(void) const
|
wxMenuBar *wxFrame::GetMenuBar(void) const
|
||||||
@@ -511,6 +511,8 @@ wxToolBar* wxFrame::CreateToolBar(long style, wxWindowID id, const wxString& nam
|
|||||||
m_frameToolBar = OnCreateToolBar( style, id, name );
|
m_frameToolBar = OnCreateToolBar( style, id, name );
|
||||||
|
|
||||||
GetChildren()->DeleteObject( m_frameToolBar );
|
GetChildren()->DeleteObject( m_frameToolBar );
|
||||||
|
|
||||||
|
if (m_sizeSet) GtkOnSize( m_x, m_y, m_width, m_height );
|
||||||
|
|
||||||
return m_frameToolBar;
|
return m_frameToolBar;
|
||||||
}
|
}
|
||||||
@@ -533,6 +535,8 @@ wxStatusBar* wxFrame::CreateStatusBar( int number, long style, wxWindowID id, co
|
|||||||
|
|
||||||
m_frameStatusBar = OnCreateStatusBar( number, style, id, name );
|
m_frameStatusBar = OnCreateStatusBar( number, style, id, name );
|
||||||
|
|
||||||
|
if (m_sizeSet) GtkOnSize( m_x, m_y, m_width, m_height );
|
||||||
|
|
||||||
return m_frameStatusBar;
|
return m_frameStatusBar;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -380,7 +380,7 @@ public:
|
|||||||
wxMainMutex = new wxMutex();
|
wxMainMutex = new wxMutex();
|
||||||
wxThreadGuiInit();
|
wxThreadGuiInit();
|
||||||
p_mainid = pthread_self();
|
p_mainid = pthread_self();
|
||||||
p_threads_list = wxList(wxKEY_INTEGER);
|
// p_threads_list = wxList(wxKEY_INTEGER);
|
||||||
wxMainMutex->Lock();
|
wxMainMutex->Lock();
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@@ -186,15 +186,15 @@ static void gtk_window_draw_callback( GtkWidget *WXUNUSED(widget), GdkRectangle
|
|||||||
|
|
||||||
static gint gtk_window_key_press_callback( GtkWidget *widget, GdkEventKey *gdk_event, wxWindow *win )
|
static gint gtk_window_key_press_callback( GtkWidget *widget, GdkEventKey *gdk_event, wxWindow *win )
|
||||||
{
|
{
|
||||||
printf( "OnKeyPress.\n " );
|
|
||||||
|
|
||||||
if (!win->HasVMT()) return FALSE;
|
if (!win->HasVMT()) return FALSE;
|
||||||
if (g_blockEventsOnDrag) return FALSE;
|
if (g_blockEventsOnDrag) return FALSE;
|
||||||
|
|
||||||
|
/*
|
||||||
printf( "OnKeyPress from " );
|
printf( "OnKeyPress from " );
|
||||||
if (win->GetClassInfo() && win->GetClassInfo()->GetClassName())
|
if (win->GetClassInfo() && win->GetClassInfo()->GetClassName())
|
||||||
printf( win->GetClassInfo()->GetClassName() );
|
printf( win->GetClassInfo()->GetClassName() );
|
||||||
printf( ".\n" );
|
printf( ".\n" );
|
||||||
|
*/
|
||||||
|
|
||||||
long key_code = 0;
|
long key_code = 0;
|
||||||
switch (gdk_event->keyval)
|
switch (gdk_event->keyval)
|
||||||
@@ -286,19 +286,13 @@ static gint gtk_window_key_press_callback( GtkWidget *widget, GdkEventKey *gdk_e
|
|||||||
event.m_y = 0;
|
event.m_y = 0;
|
||||||
event.SetEventObject( win );
|
event.SetEventObject( win );
|
||||||
|
|
||||||
printf( "process key.\n" );
|
|
||||||
|
|
||||||
bool ret = win->GetEventHandler()->ProcessEvent( event );
|
bool ret = win->GetEventHandler()->ProcessEvent( event );
|
||||||
|
|
||||||
printf( "no handler.\n" );
|
|
||||||
|
|
||||||
if (!ret)
|
if (!ret)
|
||||||
{
|
{
|
||||||
wxWindow *ancestor = win;
|
wxWindow *ancestor = win;
|
||||||
while (ancestor)
|
while (ancestor)
|
||||||
{
|
{
|
||||||
printf( "check accel in %s .\n", WXSTRINGCAST ancestor->GetName() );
|
|
||||||
|
|
||||||
int command = ancestor->GetAcceleratorTable()->GetCommand( event );
|
int command = ancestor->GetAcceleratorTable()->GetCommand( event );
|
||||||
if (command != -1)
|
if (command != -1)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user