fix for radio items creation
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@17025 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1071,14 +1071,16 @@ bool wxMenu::GtkAppend(wxMenuItem *mitem)
|
||||
// text has "_" instead of "&" after mitem->SetText() so don't use it
|
||||
wxString text( mitem->GetText() );
|
||||
|
||||
// buffer containing the menu text in multibyte form
|
||||
char buf[200];
|
||||
strcpy( buf, "/" );
|
||||
strncat( buf, wxGTK_CONV(text), WXSIZEOF(buf) - 2 );
|
||||
buf[WXSIZEOF(buf) - 1] = '\0';
|
||||
// buffers containing the menu item path and type in multibyte form
|
||||
char bufPath[256],
|
||||
bufType[256];
|
||||
|
||||
strcpy( bufPath, "/" );
|
||||
strncat( bufPath, wxGTK_CONV(text), WXSIZEOF(bufPath) - 2 );
|
||||
bufPath[WXSIZEOF(bufPath) - 1] = '\0';
|
||||
|
||||
GtkItemFactoryEntry entry;
|
||||
entry.path = buf;
|
||||
entry.path = bufPath;
|
||||
entry.callback = (GtkItemFactoryCallback) gtk_menu_clicked_callback;
|
||||
entry.callback_action = 0;
|
||||
|
||||
@@ -1095,7 +1097,7 @@ bool wxMenu::GtkAppend(wxMenuItem *mitem)
|
||||
{
|
||||
// start of a new radio group
|
||||
item_type = "<RadioItem>";
|
||||
m_pathLastRadio = buf + 1;
|
||||
m_pathLastRadio = bufPath + 1;
|
||||
}
|
||||
else // continue the radio group
|
||||
{
|
||||
@@ -1103,10 +1105,9 @@ bool wxMenu::GtkAppend(wxMenuItem *mitem)
|
||||
pathRadio.Replace(wxT("_"), wxT(""));
|
||||
pathRadio.Prepend(wxT("<main>/"));
|
||||
|
||||
char buf2[200];
|
||||
strncpy(buf2, wxGTK_CONV(pathRadio), WXSIZEOF(buf2));
|
||||
buf2[WXSIZEOF(buf2) - 1] = '\0';
|
||||
item_type = buf2;
|
||||
strncpy(bufType, wxGTK_CONV(pathRadio), WXSIZEOF(bufType));
|
||||
bufType[WXSIZEOF(bufType) - 1] = '\0';
|
||||
item_type = bufType;
|
||||
}
|
||||
|
||||
// continue the existing radio group, if any
|
||||
|
@@ -1071,14 +1071,16 @@ bool wxMenu::GtkAppend(wxMenuItem *mitem)
|
||||
// text has "_" instead of "&" after mitem->SetText() so don't use it
|
||||
wxString text( mitem->GetText() );
|
||||
|
||||
// buffer containing the menu text in multibyte form
|
||||
char buf[200];
|
||||
strcpy( buf, "/" );
|
||||
strncat( buf, wxGTK_CONV(text), WXSIZEOF(buf) - 2 );
|
||||
buf[WXSIZEOF(buf) - 1] = '\0';
|
||||
// buffers containing the menu item path and type in multibyte form
|
||||
char bufPath[256],
|
||||
bufType[256];
|
||||
|
||||
strcpy( bufPath, "/" );
|
||||
strncat( bufPath, wxGTK_CONV(text), WXSIZEOF(bufPath) - 2 );
|
||||
bufPath[WXSIZEOF(bufPath) - 1] = '\0';
|
||||
|
||||
GtkItemFactoryEntry entry;
|
||||
entry.path = buf;
|
||||
entry.path = bufPath;
|
||||
entry.callback = (GtkItemFactoryCallback) gtk_menu_clicked_callback;
|
||||
entry.callback_action = 0;
|
||||
|
||||
@@ -1095,7 +1097,7 @@ bool wxMenu::GtkAppend(wxMenuItem *mitem)
|
||||
{
|
||||
// start of a new radio group
|
||||
item_type = "<RadioItem>";
|
||||
m_pathLastRadio = buf + 1;
|
||||
m_pathLastRadio = bufPath + 1;
|
||||
}
|
||||
else // continue the radio group
|
||||
{
|
||||
@@ -1103,10 +1105,9 @@ bool wxMenu::GtkAppend(wxMenuItem *mitem)
|
||||
pathRadio.Replace(wxT("_"), wxT(""));
|
||||
pathRadio.Prepend(wxT("<main>/"));
|
||||
|
||||
char buf2[200];
|
||||
strncpy(buf2, wxGTK_CONV(pathRadio), WXSIZEOF(buf2));
|
||||
buf2[WXSIZEOF(buf2) - 1] = '\0';
|
||||
item_type = buf2;
|
||||
strncpy(bufType, wxGTK_CONV(pathRadio), WXSIZEOF(bufType));
|
||||
bufType[WXSIZEOF(bufType) - 1] = '\0';
|
||||
item_type = bufType;
|
||||
}
|
||||
|
||||
// continue the existing radio group, if any
|
||||
|
Reference in New Issue
Block a user