added wxCB_READONLY
fixed MDI bug fixed GTK 1.2.0 compilation in wxMenu::something git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2157 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
f39f922082
commit
a260fe6a43
@ -484,7 +484,7 @@ m_text(NULL), m_notebook(NULL)
|
|||||||
m_notebook->AddPage(panel, "wxChoice", FALSE, Image_Choice);
|
m_notebook->AddPage(panel, "wxChoice", FALSE, Image_Choice);
|
||||||
|
|
||||||
panel = new wxPanel(m_notebook);
|
panel = new wxPanel(m_notebook);
|
||||||
m_combo = new wxComboBox( panel, ID_COMBO, "This", wxPoint(10,10), wxSize(120,-1), 5, choices );
|
m_combo = new wxComboBox( panel, ID_COMBO, "This", wxPoint(10,10), wxSize(120,-1), 5, choices, wxCB_READONLY );
|
||||||
(void)new wxButton( panel, ID_COMBO_SEL_NUM, "Select #2", wxPoint(180,30), wxSize(140,30) );
|
(void)new wxButton( panel, ID_COMBO_SEL_NUM, "Select #2", wxPoint(180,30), wxSize(140,30) );
|
||||||
(void)new wxButton( panel, ID_COMBO_SEL_STR, "Select 'This'", wxPoint(340,30), wxSize(140,30) );
|
(void)new wxButton( panel, ID_COMBO_SEL_STR, "Select 'This'", wxPoint(340,30), wxSize(140,30) );
|
||||||
(void)new wxButton( panel, ID_COMBO_CLEAR, "Clear", wxPoint(180,80), wxSize(140,30) );
|
(void)new wxButton( panel, ID_COMBO_CLEAR, "Clear", wxPoint(180,80), wxSize(140,30) );
|
||||||
|
@ -136,6 +136,9 @@ bool wxComboBox::Create( wxWindow *parent, wxWindowID id, const wxString& value,
|
|||||||
gtk_widget_realize( GTK_COMBO(m_widget)->entry );
|
gtk_widget_realize( GTK_COMBO(m_widget)->entry );
|
||||||
gtk_widget_realize( GTK_COMBO(m_widget)->button );
|
gtk_widget_realize( GTK_COMBO(m_widget)->button );
|
||||||
|
|
||||||
|
if (style & wxCB_READONLY)
|
||||||
|
gtk_entry_set_editable( GTK_ENTRY( GTK_COMBO(m_widget)->entry ), FALSE );
|
||||||
|
|
||||||
gtk_signal_connect( GTK_OBJECT(GTK_COMBO(m_widget)->entry), "changed",
|
gtk_signal_connect( GTK_OBJECT(GTK_COMBO(m_widget)->entry), "changed",
|
||||||
GTK_SIGNAL_FUNC(gtk_text_changed_callback), (gpointer)this);
|
GTK_SIGNAL_FUNC(gtk_text_changed_callback), (gpointer)this);
|
||||||
|
|
||||||
|
@ -112,6 +112,7 @@ void wxMDIParentFrame::OnInternalIdle()
|
|||||||
wxFrame::OnInternalIdle();
|
wxFrame::OnInternalIdle();
|
||||||
|
|
||||||
wxMDIChildFrame *active_child_frame = GetActiveChild();
|
wxMDIChildFrame *active_child_frame = GetActiveChild();
|
||||||
|
bool visible_child_menu = FALSE;
|
||||||
|
|
||||||
wxNode *node = m_clientWindow->m_children.First();
|
wxNode *node = m_clientWindow->m_children.First();
|
||||||
while (node)
|
while (node)
|
||||||
@ -120,7 +121,10 @@ void wxMDIParentFrame::OnInternalIdle()
|
|||||||
if (child_frame->m_menuBar)
|
if (child_frame->m_menuBar)
|
||||||
{
|
{
|
||||||
if (child_frame == active_child_frame)
|
if (child_frame == active_child_frame)
|
||||||
|
{
|
||||||
gtk_widget_show( child_frame->m_menuBar->m_widget );
|
gtk_widget_show( child_frame->m_menuBar->m_widget );
|
||||||
|
visible_child_menu = TRUE;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
gtk_widget_hide( child_frame->m_menuBar->m_widget );
|
gtk_widget_hide( child_frame->m_menuBar->m_widget );
|
||||||
}
|
}
|
||||||
@ -128,7 +132,7 @@ void wxMDIParentFrame::OnInternalIdle()
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* show/hide parent menu bar as required */
|
/* show/hide parent menu bar as required */
|
||||||
if (m_frameMenuBar) m_frameMenuBar->Show( (active_child_frame == NULL) );
|
if (m_frameMenuBar) m_frameMenuBar->Show( !visible_child_menu );
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxMDIParentFrame::GetClientSize(int *width, int *height ) const
|
void wxMDIParentFrame::GetClientSize(int *width, int *height ) const
|
||||||
|
@ -552,7 +552,7 @@ void wxMenu::Append( int id, const wxString &item, const wxString &helpStr, bool
|
|||||||
s << *pc;
|
s << *pc;
|
||||||
}
|
}
|
||||||
|
|
||||||
GtkWidget *menuItem = gtk_item_factory_get_item( m_factory, s );
|
GtkWidget *menuItem = gtk_item_factory_get_widget( m_factory, s );
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
|
@ -136,6 +136,9 @@ bool wxComboBox::Create( wxWindow *parent, wxWindowID id, const wxString& value,
|
|||||||
gtk_widget_realize( GTK_COMBO(m_widget)->entry );
|
gtk_widget_realize( GTK_COMBO(m_widget)->entry );
|
||||||
gtk_widget_realize( GTK_COMBO(m_widget)->button );
|
gtk_widget_realize( GTK_COMBO(m_widget)->button );
|
||||||
|
|
||||||
|
if (style & wxCB_READONLY)
|
||||||
|
gtk_entry_set_editable( GTK_ENTRY( GTK_COMBO(m_widget)->entry ), FALSE );
|
||||||
|
|
||||||
gtk_signal_connect( GTK_OBJECT(GTK_COMBO(m_widget)->entry), "changed",
|
gtk_signal_connect( GTK_OBJECT(GTK_COMBO(m_widget)->entry), "changed",
|
||||||
GTK_SIGNAL_FUNC(gtk_text_changed_callback), (gpointer)this);
|
GTK_SIGNAL_FUNC(gtk_text_changed_callback), (gpointer)this);
|
||||||
|
|
||||||
|
@ -112,6 +112,7 @@ void wxMDIParentFrame::OnInternalIdle()
|
|||||||
wxFrame::OnInternalIdle();
|
wxFrame::OnInternalIdle();
|
||||||
|
|
||||||
wxMDIChildFrame *active_child_frame = GetActiveChild();
|
wxMDIChildFrame *active_child_frame = GetActiveChild();
|
||||||
|
bool visible_child_menu = FALSE;
|
||||||
|
|
||||||
wxNode *node = m_clientWindow->m_children.First();
|
wxNode *node = m_clientWindow->m_children.First();
|
||||||
while (node)
|
while (node)
|
||||||
@ -120,7 +121,10 @@ void wxMDIParentFrame::OnInternalIdle()
|
|||||||
if (child_frame->m_menuBar)
|
if (child_frame->m_menuBar)
|
||||||
{
|
{
|
||||||
if (child_frame == active_child_frame)
|
if (child_frame == active_child_frame)
|
||||||
|
{
|
||||||
gtk_widget_show( child_frame->m_menuBar->m_widget );
|
gtk_widget_show( child_frame->m_menuBar->m_widget );
|
||||||
|
visible_child_menu = TRUE;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
gtk_widget_hide( child_frame->m_menuBar->m_widget );
|
gtk_widget_hide( child_frame->m_menuBar->m_widget );
|
||||||
}
|
}
|
||||||
@ -128,7 +132,7 @@ void wxMDIParentFrame::OnInternalIdle()
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* show/hide parent menu bar as required */
|
/* show/hide parent menu bar as required */
|
||||||
if (m_frameMenuBar) m_frameMenuBar->Show( (active_child_frame == NULL) );
|
if (m_frameMenuBar) m_frameMenuBar->Show( !visible_child_menu );
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxMDIParentFrame::GetClientSize(int *width, int *height ) const
|
void wxMDIParentFrame::GetClientSize(int *width, int *height ) const
|
||||||
|
@ -552,7 +552,7 @@ void wxMenu::Append( int id, const wxString &item, const wxString &helpStr, bool
|
|||||||
s << *pc;
|
s << *pc;
|
||||||
}
|
}
|
||||||
|
|
||||||
GtkWidget *menuItem = gtk_item_factory_get_item( m_factory, s );
|
GtkWidget *menuItem = gtk_item_factory_get_widget( m_factory, s );
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user