Fixed listbox on windows.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_2_BRANCH@7160 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Brian Smith
2000-04-14 07:53:35 +00:00
parent f6f09fc812
commit 9f6de777bb

View File

@@ -157,7 +157,7 @@ BEGIN_EVENT_TABLE(MyFrame, wxFrame)
EVT_MENU(wxID_COPY, MyFrame::OnCopy) EVT_MENU(wxID_COPY, MyFrame::OnCopy)
EVT_MENU(wxID_PASTE, MyFrame::OnPaste) EVT_MENU(wxID_PASTE, MyFrame::OnPaste)
EVT_LISTBOX_DCLICK(ID_LISTBOX, MyFrame::OnListBoxDoubleClick) EVT_LISTBOX_DCLICK(ID_LISTBOX, MyFrame::OnListBoxDoubleClick)
END_EVENT_TABLE() END_EVENT_TABLE()
// ============================================================================ // ============================================================================
@@ -418,212 +418,230 @@ void MyFrame::OnSaveProject(wxCommandEvent& event)
void MyFrame::OnListBoxDoubleClick( wxCommandEvent &event ) void MyFrame::OnListBoxDoubleClick( wxCommandEvent &event )
{ {
wxString str = event.GetString(); int item;
if(strcmp(str, "closeold")==0)
{
m_textWindow->WriteText("closeold\n");
}
else if(strcmp(str, "system")==0)
{
wxTextEntryDialog dialog2(this,
"Please enter the command to execute",
appName,
"",
wxOK | wxCANCEL);
if (dialog2.ShowModal() == wxID_OK) item = m_listBox->GetSelection();
switch(item)
{
case 0:
{ {
m_textWindow->WriteText("system,"); wxFileDialog dialog2(this, "Choose wxr filename", "", "", "*.wxr", 0);
m_textWindow->WriteText(dialog2.GetValue());
m_textWindow->WriteText("\n"); if (dialog2.ShowModal() == wxID_OK)
{
char tempbuf[1024] = "DialogEd ";
wxString tmp = dialog2.GetFilename();
m_textWindow->WriteText("loadwxr,");
m_textWindow->WriteText(tmp);
m_textWindow->WriteText("\n");
strcat(tempbuf, tmp);
wxExecute(tempbuf);
}
} }
} break;
else if(strcmp(str, "grabfile")==0) case 1:
{
wxFileDialog dialog2(this, "Choose file to grab", "", "", "*", 0);
if (dialog2.ShowModal() == wxID_OK)
{ {
m_textWindow->WriteText("grabfile,"); m_textWindow->WriteText("closeold\n");
m_textWindow->WriteText(dialog2.GetFilename());
m_textWindow->WriteText("\n");
} }
} break;
else if(strcmp(str, "loadwxr")==0) case 2:
{
wxFileDialog dialog2(this, "Choose wxr filename", "", "", "*.wxr", 0);
if (dialog2.ShowModal() == wxID_OK)
{ {
char tempbuf[1024] = "DialogEd "; wxFileDialog dialog2(this, "Choose filename to view", "", "", "*.txt", 0);
wxString tmp = dialog2.GetFilename();
m_textWindow->WriteText("loadwxr,"); if (dialog2.ShowModal() == wxID_OK)
m_textWindow->WriteText(tmp); {
m_textWindow->WriteText("\n"); wxTextEntryDialog dialog3(this,
"Please enter name of the MLE widget",
appName,
"",
wxOK | wxCANCEL);
strcat(tempbuf, tmp); if (dialog3.ShowModal() == wxID_OK)
wxExecute(tempbuf); {
m_textWindow->WriteText("mleview,");
m_textWindow->WriteText(dialog3.GetValue());
m_textWindow->WriteText(",");
m_textWindow->WriteText(dialog2.GetFilename());
m_textWindow->WriteText("\n");
}
}
} }
} break;
else if(strcmp(str, "mleview")==0) case 3:
{
wxFileDialog dialog2(this, "Choose filename to view", "", "", "*.txt", 0);
if (dialog2.ShowModal() == wxID_OK)
{ {
wxTextEntryDialog dialog3(this, wxFileDialog dialog2(this, "Choose script to attach to button", "", "", "*.ini", 0);
"Please enter name of the MLE widget",
if (dialog2.ShowModal() == wxID_OK)
{
wxTextEntryDialog dialog3(this,
"Please enter ID of the button",
appName,
"",
wxOK | wxCANCEL);
if (dialog3.ShowModal() == wxID_OK)
{
m_textWindow->WriteText("setbutton,");
m_textWindow->WriteText(dialog3.GetValue());
m_textWindow->WriteText(",");
m_textWindow->WriteText(dialog2.GetFilename());
m_textWindow->WriteText("\n");
}
}
}
break;
case 4:
{
wxFileDialog dialog2(this, "Choose script to run if not checked", "", "", "*.ini", 0);
if (dialog2.ShowModal() == wxID_OK)
{
wxTextEntryDialog dialog3(this,
"Please enter name of the checkbox widget",
appName,
"",
wxOK | wxCANCEL);
if (dialog3.ShowModal() == wxID_OK)
{
m_textWindow->WriteText("getcheck,");
m_textWindow->WriteText(dialog3.GetValue());
m_textWindow->WriteText(",");
m_textWindow->WriteText(dialog2.GetFilename());
m_textWindow->WriteText("\n");
}
}
}
break;
case 5:
{
wxTextEntryDialog dialog2(this,
"Please enter the message to display to the user",
appName, appName,
"", "",
wxOK | wxCANCEL); wxOK | wxCANCEL);
if (dialog3.ShowModal() == wxID_OK) if (dialog2.ShowModal() == wxID_OK)
{ {
m_textWindow->WriteText("mleview,"); m_textWindow->WriteText("message,\"");
m_textWindow->WriteText(dialog3.GetValue()); m_textWindow->WriteText(dialog2.GetValue());
m_textWindow->WriteText(","); m_textWindow->WriteText("\"\n");
m_textWindow->WriteText(dialog2.GetFilename());
m_textWindow->WriteText("\n");
} }
} }
} break;
else if(strcmp(str, "setbutton")==0) case 6:
{
wxFileDialog dialog2(this, "Choose script to attach to button", "", "", "*.ini", 0);
if (dialog2.ShowModal() == wxID_OK)
{ {
wxTextEntryDialog dialog3(this, wxTextEntryDialog dialog2(this,
"Please enter ID of the button", "Please enter the widget name to disable",
appName, appName,
"", "",
wxOK | wxCANCEL); wxOK | wxCANCEL);
if (dialog3.ShowModal() == wxID_OK) if (dialog2.ShowModal() == wxID_OK)
{ {
m_textWindow->WriteText("setbutton,"); m_textWindow->WriteText("disable,");
m_textWindow->WriteText(dialog3.GetValue()); m_textWindow->WriteText(dialog2.GetValue());
m_textWindow->WriteText(",");
m_textWindow->WriteText(dialog2.GetFilename());
m_textWindow->WriteText("\n"); m_textWindow->WriteText("\n");
} }
} }
} break;
else if(strcmp(str, "startinst")==0) case 7:
{
wxFileDialog dialog2(this, "Choose script to run at installation completion", "", "", "*.ini", 0);
if (dialog2.ShowModal() == wxID_OK)
{ {
wxTextEntryDialog dialog3(this, wxTextEntryDialog dialog2(this,
"Please enter name of the gauge widget", "Please enter text widget name to set from",
appName, appName,
"", "",
wxOK | wxCANCEL); wxOK | wxCANCEL);
if (dialog3.ShowModal() == wxID_OK) if (dialog2.ShowModal() == wxID_OK)
{ {
m_textWindow->WriteText("startinst,"); m_textWindow->WriteText("settext,");
m_textWindow->WriteText(dialog3.GetValue()); m_textWindow->WriteText(dialog2.GetValue());
m_textWindow->WriteText(",");
m_textWindow->WriteText(dialog2.GetFilename());
m_textWindow->WriteText("\n"); m_textWindow->WriteText("\n");
} }
} }
} break;
else if(strcmp(str, "remove")==0) case 8:
{
wxFileDialog dialog2(this, "Choose file to remove", "", "", "*", 0);
if (dialog2.ShowModal() == wxID_OK)
{ {
m_textWindow->WriteText("remove,"); wxTextEntryDialog dialog2(this,
m_textWindow->WriteText(dialog2.GetFilename()); "Please enter text widget name to get from",
m_textWindow->WriteText("\n");
}
}
else if(strcmp(str, "message")==0)
{
wxTextEntryDialog dialog2(this,
"Please enter the message to display to the user",
appName,
"",
wxOK | wxCANCEL);
if (dialog2.ShowModal() == wxID_OK)
{
m_textWindow->WriteText("message,\"");
m_textWindow->WriteText(dialog2.GetValue());
m_textWindow->WriteText("\"\n");
}
}
else if(strcmp(str, "gettext")==0)
{
wxTextEntryDialog dialog2(this,
"Please enter text widget name to get from",
appName,
"",
wxOK | wxCANCEL);
if (dialog2.ShowModal() == wxID_OK)
{
m_textWindow->WriteText("gettext,");
m_textWindow->WriteText(dialog2.GetValue());
m_textWindow->WriteText("\n");
}
}
else if(strcmp(str, "settext")==0)
{
wxTextEntryDialog dialog2(this,
"Please enter text widget name to set from",
appName,
"",
wxOK | wxCANCEL);
if (dialog2.ShowModal() == wxID_OK)
{
m_textWindow->WriteText("settext,");
m_textWindow->WriteText(dialog2.GetValue());
m_textWindow->WriteText("\n");
}
}
else if(strcmp(str, "getcheck")==0)
{
wxFileDialog dialog2(this, "Choose script to run if not checked", "", "", "*.ini", 0);
if (dialog2.ShowModal() == wxID_OK)
{
wxTextEntryDialog dialog3(this,
"Please enter name of the checkbox widget",
appName, appName,
"", "",
wxOK | wxCANCEL); wxOK | wxCANCEL);
if (dialog3.ShowModal() == wxID_OK) if (dialog2.ShowModal() == wxID_OK)
{ {
m_textWindow->WriteText("getcheck,"); m_textWindow->WriteText("gettext,");
m_textWindow->WriteText(dialog3.GetValue()); m_textWindow->WriteText(dialog2.GetValue());
m_textWindow->WriteText(","); m_textWindow->WriteText("\n");
}
}
break;
case 9:
{
wxFileDialog dialog2(this, "Choose file to grab", "", "", "*", 0);
if (dialog2.ShowModal() == wxID_OK)
{
m_textWindow->WriteText("grabfile,");
m_textWindow->WriteText(dialog2.GetFilename()); m_textWindow->WriteText(dialog2.GetFilename());
m_textWindow->WriteText("\n"); m_textWindow->WriteText("\n");
} }
} }
} break;
else if(strcmp(str, "disable")==0) case 10:
{
wxTextEntryDialog dialog2(this,
"Please enter the widget name to disable",
appName,
"",
wxOK | wxCANCEL);
if (dialog2.ShowModal() == wxID_OK)
{ {
m_textWindow->WriteText("disable,"); wxFileDialog dialog2(this, "Choose file to remove", "", "", "*", 0);
m_textWindow->WriteText(dialog2.GetValue());
m_textWindow->WriteText("\n");
}
}
if (dialog2.ShowModal() == wxID_OK)
{
m_textWindow->WriteText("remove,");
m_textWindow->WriteText(dialog2.GetFilename());
m_textWindow->WriteText("\n");
}
}
break;
case 11:
{
wxTextEntryDialog dialog2(this,
"Please enter the command to execute",
appName,
"",
wxOK | wxCANCEL);
if (dialog2.ShowModal() == wxID_OK)
{
m_textWindow->WriteText("system,");
m_textWindow->WriteText(dialog2.GetValue());
m_textWindow->WriteText("\n");
}
}
break;
case 12:
{
wxFileDialog dialog2(this, "Choose script to run at installation completion", "", "", "*.ini", 0);
if (dialog2.ShowModal() == wxID_OK)
{
wxTextEntryDialog dialog3(this,
"Please enter name of the gauge widget",
appName,
"",
wxOK | wxCANCEL);
if (dialog3.ShowModal() == wxID_OK)
{
m_textWindow->WriteText("startinst,");
m_textWindow->WriteText(dialog3.GetValue());
m_textWindow->WriteText(",");
m_textWindow->WriteText(dialog2.GetFilename());
m_textWindow->WriteText("\n");
}
}
}
break;
}
} }