size_t HTTPFileLoader::ReadAt(s64 absolutePos, size_t bytes, void *data) { s64 absoluteEnd = std::min(absolutePos + (s64)bytes, filesize_); if (absolutePos >= filesize_ || bytes == 0) { // Read outside of the file or no read at all, just fail immediately. return 0; } Connect(); char requestHeaders[4096]; // Note that the Range header is *inclusive*. snprintf(requestHeaders, sizeof(requestHeaders), "Range: bytes=%lld-%lld\r\n", absolutePos, absoluteEnd - 1); int err = client_.SendRequest("GET", url_.Resource().c_str(), requestHeaders, nullptr); if (err < 0) { Disconnect(); return 0; } Buffer readbuf; std::vector<std::string> responseHeaders; int code = client_.ReadResponseHeaders(&readbuf, responseHeaders); if (code != 206) { ERROR_LOG(LOADER, "HTTP server did not respond with range, received code=%03d", code); Disconnect(); return 0; } // TODO: Expire cache via ETag, etc. // We don't support multipart/byteranges responses. bool supportedResponse = false; for (std::string header : responseHeaders) { if (startsWithNoCase(header, "Content-Range:")) { // TODO: More correctness. Whitespace can be missing or different. s64 first = -1, last = -1, total = -1; std::string lowerHeader = header; std::transform(lowerHeader.begin(), lowerHeader.end(), lowerHeader.begin(), tolower); if (sscanf(lowerHeader.c_str(), "content-range: bytes %lld-%lld/%lld", &first, &last, &total) >= 2) { if (first == absolutePos && last == absoluteEnd - 1) { supportedResponse = true; } else { ERROR_LOG(LOADER, "Unexpected HTTP range: got %lld-%lld, wanted %lld-%lld.", first, last, absolutePos, absoluteEnd - 1); } } else { ERROR_LOG(LOADER, "Unexpected HTTP range response: %s", header.c_str()); } } } // TODO: Would be nice to read directly. Buffer output; int res = client_.ReadResponseEntity(&readbuf, responseHeaders, &output); if (res != 0) { ERROR_LOG(LOADER, "Unable to read HTTP response entity: %d", res); // Let's take anything we got anyway. Not worse than returning nothing? } // TODO: Keepalive instead. Disconnect(); if (!supportedResponse) { ERROR_LOG(LOADER, "HTTP server did not respond with the range we wanted."); return 0; } size_t readBytes = output.size(); output.Take(readBytes, (char *)data); filepos_ = absolutePos + readBytes; return readBytes; }
SpiralsPanel::SpiralsPanel(wxWindow* parent) { //(*Initialize(SpiralsPanel) wxFlexGridSizer* FlexGridSizer4; wxFlexGridSizer* FlexGridSizer45; wxFlexGridSizer* FlexGridSizer3; wxTextCtrl* TextCtrl37; wxFlexGridSizer* FlexGridSizer130; wxTextCtrl* TextCtrl39; wxFlexGridSizer* FlexGridSizer2; wxFlexGridSizer* FlexGridSizer129; wxFlexGridSizer* FlexGridSizer1; wxStaticText* StaticText36; wxTextCtrl* TextCtrl38; wxTextCtrl* TextCtrl36; Create(parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL, _T("wxID_ANY")); FlexGridSizer45 = new wxFlexGridSizer(0, 1, 0, 0); FlexGridSizer45->AddGrowableCol(0); FlexGridSizer129 = new wxFlexGridSizer(0, 4, 0, 0); FlexGridSizer129->AddGrowableCol(1); StaticText34 = new wxStaticText(this, ID_STATICTEXT38, _("Palette Rep"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT38")); FlexGridSizer129->Add(StaticText34, 1, wxALL|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5); FlexGridSizer1 = new wxFlexGridSizer(0, 2, 0, 0); FlexGridSizer1->AddGrowableCol(0); Slider_Spirals_Count = new wxSlider(this, ID_SLIDER_Spirals_Count, 1, 1, 5, wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_SLIDER_Spirals_Count")); FlexGridSizer1->Add(Slider_Spirals_Count, 1, wxALL|wxEXPAND, 2); BitmapButton_VCSpiralsCount = new ValueCurveButton(this, ID_VALUECURVE_Spirals_Count, valuecurvenotselected_24, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|wxNO_BORDER, wxDefaultValidator, _T("ID_VALUECURVE_Spirals_Count")); FlexGridSizer1->Add(BitmapButton_VCSpiralsCount, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 2); FlexGridSizer129->Add(FlexGridSizer1, 1, wxALL|wxEXPAND, 2); TextCtrl36 = new wxTextCtrl(this, IDD_TEXTCTRL_Spirals_Count, _("1"), wxDefaultPosition, wxDLG_UNIT(this,wxSize(25,-1)), 0, wxDefaultValidator, _T("IDD_TEXTCTRL_Spirals_Count")); TextCtrl36->SetMaxLength(2); FlexGridSizer129->Add(TextCtrl36, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); BitmapButton_SpiralsCount = new wxBitmapButton(this, ID_BITMAPBUTTON_SLIDER_Spirals_Count, padlock16x16_blue_xpm, wxDefaultPosition, wxSize(13,13), wxBU_AUTODRAW|wxNO_BORDER, wxDefaultValidator, _T("ID_BITMAPBUTTON_SLIDER_Spirals_Count")); BitmapButton_SpiralsCount->SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_ACTIVECAPTION)); FlexGridSizer129->Add(BitmapButton_SpiralsCount, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 1); StaticText36 = new wxStaticText(this, wxID_ANY, _("Spiral Wraps"), wxDefaultPosition, wxDefaultSize, 0, _T("wxID_ANY")); FlexGridSizer129->Add(StaticText36, 1, wxALL|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5); FlexGridSizer2 = new wxFlexGridSizer(0, 2, 0, 0); FlexGridSizer2->AddGrowableCol(0); Slider_Spirals_Rotation = new wxSlider(this, ID_SLIDER_Spirals_Rotation, 20, -300, 300, wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_SLIDER_Spirals_Rotation")); Slider_Spirals_Rotation->SetToolTip(_("Number of times a band wraps around the matrix")); FlexGridSizer2->Add(Slider_Spirals_Rotation, 1, wxALL|wxEXPAND, 2); BitmapButton_VCSpirals_Rotation = new ValueCurveButton(this, ID_VALUECURVE_Spirals_Rotation, valuecurvenotselected_24, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|wxNO_BORDER, wxDefaultValidator, _T("ID_VALUECURVE_Spirals_Rotation")); FlexGridSizer2->Add(BitmapButton_VCSpirals_Rotation, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 2); FlexGridSizer129->Add(FlexGridSizer2, 1, wxALL|wxEXPAND, 2); TextCtrl37 = new wxTextCtrl(this, IDD_TEXTCTRL_Spirals_Rotation, _("2.0"), wxDefaultPosition, wxDLG_UNIT(this,wxSize(25,-1)), 0, wxDefaultValidator, _T("IDD_TEXTCTRL_Spirals_Rotation")); TextCtrl37->SetMaxLength(5); FlexGridSizer129->Add(TextCtrl37, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); BitmapButton_SpiralsRotation = new wxBitmapButton(this, ID_BITMAPBUTTON_SLIDER_Spirals_Rotation, padlock16x16_blue_xpm, wxDefaultPosition, wxSize(13,13), wxBU_AUTODRAW|wxNO_BORDER, wxDefaultValidator, _T("ID_BITMAPBUTTON_SLIDER_Spirals_Rotation")); BitmapButton_SpiralsRotation->SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_ACTIVECAPTION)); FlexGridSizer129->Add(BitmapButton_SpiralsRotation, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 1); StaticText38 = new wxStaticText(this, ID_STATICTEXT42, _("Thickness"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT42")); FlexGridSizer129->Add(StaticText38, 1, wxALL|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5); FlexGridSizer3 = new wxFlexGridSizer(0, 2, 0, 0); FlexGridSizer3->AddGrowableCol(0); Slider_Spirals_Thickness = new wxSlider(this, ID_SLIDER_Spirals_Thickness, 50, 0, 100, wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_SLIDER_Spirals_Thickness")); FlexGridSizer3->Add(Slider_Spirals_Thickness, 1, wxALL|wxEXPAND, 2); BitmapButton_VCSpirals_Thickness = new ValueCurveButton(this, ID_VALUECURVE_Spirals_Thickness, valuecurvenotselected_24, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|wxNO_BORDER, wxDefaultValidator, _T("ID_VALUECURVE_Spirals_Thickness")); FlexGridSizer3->Add(BitmapButton_VCSpirals_Thickness, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 2); FlexGridSizer129->Add(FlexGridSizer3, 1, wxALL|wxEXPAND, 2); TextCtrl38 = new wxTextCtrl(this, IDD_TEXTCTRL_Spirals_Thickness, _("50"), wxDefaultPosition, wxDLG_UNIT(this,wxSize(25,-1)), 0, wxDefaultValidator, _T("IDD_TEXTCTRL_Spirals_Thickness")); TextCtrl38->SetMaxLength(3); FlexGridSizer129->Add(TextCtrl38, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); BitmapButton_SpiralsThickness = new wxBitmapButton(this, ID_BITMAPBUTTON_SLIDER_Spirals_Thickness, padlock16x16_blue_xpm, wxDefaultPosition, wxSize(13,13), wxBU_AUTODRAW|wxNO_BORDER, wxDefaultValidator, _T("ID_BITMAPBUTTON_SLIDER_Spirals_Thickness")); BitmapButton_SpiralsThickness->SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_ACTIVECAPTION)); FlexGridSizer129->Add(BitmapButton_SpiralsThickness, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 1); StaticText40 = new wxStaticText(this, ID_STATICTEXT44, _("Movement"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT44")); FlexGridSizer129->Add(StaticText40, 1, wxALL|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5); FlexGridSizer4 = new wxFlexGridSizer(0, 2, 0, 0); FlexGridSizer4->AddGrowableCol(0); Slider_Spirals_Movement = new wxSlider(this, IDD_SLIDER_Spirals_Movement, 10, -200, 200, wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("IDD_SLIDER_Spirals_Movement")); FlexGridSizer4->Add(Slider_Spirals_Movement, 1, wxALL|wxEXPAND, 5); BitmapButton_VCSpirals_Movement = new ValueCurveButton(this, ID_VALUECURVE_Spirals_Movement, valuecurvenotselected_24, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|wxNO_BORDER, wxDefaultValidator, _T("ID_VALUECURVE_Spirals_Movement")); FlexGridSizer4->Add(BitmapButton_VCSpirals_Movement, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 2); FlexGridSizer129->Add(FlexGridSizer4, 1, wxALL|wxEXPAND, 2); TextCtrl39 = new wxTextCtrl(this, ID_TEXTCTRL_Spirals_Movement, _("1.0"), wxDefaultPosition, wxDLG_UNIT(this,wxSize(25,-1)), 0, wxDefaultValidator, _T("ID_TEXTCTRL_Spirals_Movement")); TextCtrl39->SetMaxLength(4); FlexGridSizer129->Add(TextCtrl39, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); BitmapButton_SpiralsDirection = new wxBitmapButton(this, ID_BITMAPBUTTON_SLIDER_Spirals_Direction, padlock16x16_blue_xpm, wxDefaultPosition, wxSize(13,13), wxBU_AUTODRAW|wxNO_BORDER, wxDefaultValidator, _T("ID_BITMAPBUTTON_SLIDER_Spirals_Direction")); BitmapButton_SpiralsDirection->SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_ACTIVECAPTION)); FlexGridSizer129->Add(BitmapButton_SpiralsDirection, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 1); FlexGridSizer45->Add(FlexGridSizer129, 1, wxALL|wxEXPAND, 0); FlexGridSizer130 = new wxFlexGridSizer(0, 5, 0, 0); CheckBox_Spirals_Blend = new wxCheckBox(this, ID_CHECKBOX_Spirals_Blend, _("Blend"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_CHECKBOX_Spirals_Blend")); CheckBox_Spirals_Blend->SetValue(false); FlexGridSizer130->Add(CheckBox_Spirals_Blend, 1, wxALL|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 2); BitmapButton_SpiralsBlend = new wxBitmapButton(this, ID_BITMAPBUTTON_CHECKBOX_Spirals_Blend, padlock16x16_blue_xpm, wxDefaultPosition, wxSize(13,13), wxBU_AUTODRAW|wxNO_BORDER, wxDefaultValidator, _T("ID_BITMAPBUTTON_CHECKBOX_Spirals_Blend")); BitmapButton_SpiralsBlend->SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_ACTIVECAPTION)); FlexGridSizer130->Add(BitmapButton_SpiralsBlend, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 1); wxSize __SpacerSize_1 = wxDLG_UNIT(this,wxSize(20,-1)); FlexGridSizer130->Add(__SpacerSize_1.GetWidth(),__SpacerSize_1.GetHeight(),1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); CheckBox_Spirals_3D = new wxCheckBox(this, ID_CHECKBOX_Spirals_3D, _("3D"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_CHECKBOX_Spirals_3D")); CheckBox_Spirals_3D->SetValue(false); FlexGridSizer130->Add(CheckBox_Spirals_3D, 1, wxALL|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 2); BitmapButton_Spirals3D = new wxBitmapButton(this, ID_BITMAPBUTTON_CHECKBOX_Spirals_3D, padlock16x16_blue_xpm, wxDefaultPosition, wxSize(13,13), wxBU_AUTODRAW|wxNO_BORDER, wxDefaultValidator, _T("ID_BITMAPBUTTON_CHECKBOX_Spirals_3D")); BitmapButton_Spirals3D->SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_ACTIVECAPTION)); FlexGridSizer130->Add(BitmapButton_Spirals3D, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 1); CheckBox_Spirals_Grow = new wxCheckBox(this, ID_CHECKBOX_Spirals_Grow, _("Grow"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_CHECKBOX_Spirals_Grow")); CheckBox_Spirals_Grow->SetValue(false); FlexGridSizer130->Add(CheckBox_Spirals_Grow, 1, wxALL|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 2); BitmapButton_SpiralsGrow = new wxBitmapButton(this, ID_BITMAPBUTTON_CHECKBOX_Spirals_Grow, padlock16x16_blue_xpm, wxDefaultPosition, wxSize(13,13), wxBU_AUTODRAW|wxNO_BORDER, wxDefaultValidator, _T("ID_BITMAPBUTTON_CHECKBOX_Spirals_Grow")); BitmapButton_SpiralsGrow->SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_ACTIVECAPTION)); FlexGridSizer130->Add(BitmapButton_SpiralsGrow, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 1); wxSize __SpacerSize_2 = wxDLG_UNIT(this,wxSize(20,-1)); FlexGridSizer130->Add(__SpacerSize_2.GetWidth(),__SpacerSize_2.GetHeight(),1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); CheckBox_Spirlas_Shrink = new wxCheckBox(this, ID_CHECKBOX_Spirals_Shrink, _("Shrink"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_CHECKBOX_Spirals_Shrink")); CheckBox_Spirlas_Shrink->SetValue(false); FlexGridSizer130->Add(CheckBox_Spirlas_Shrink, 1, wxALL|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 2); BitmapButton_SpiralsShrink = new wxBitmapButton(this, ID_BITMAPBUTTON_CHECKBOX_Spirals_Shrink, padlock16x16_blue_xpm, wxDefaultPosition, wxSize(13,13), wxBU_AUTODRAW|wxNO_BORDER, wxDefaultValidator, _T("ID_BITMAPBUTTON_CHECKBOX_Spirals_Shrink")); BitmapButton_SpiralsShrink->SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_ACTIVECAPTION)); FlexGridSizer130->Add(BitmapButton_SpiralsShrink, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 1); FlexGridSizer45->Add(FlexGridSizer130, 1, wxALL|wxEXPAND, 0); SetSizer(FlexGridSizer45); FlexGridSizer45->Fit(this); FlexGridSizer45->SetSizeHints(this); Connect(ID_SLIDER_Spirals_Count,wxEVT_COMMAND_SLIDER_UPDATED,(wxObjectEventFunction)&SpiralsPanel::UpdateLinkedTextCtrlVC); Connect(ID_VALUECURVE_Spirals_Count,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&SpiralsPanel::OnVCButtonClick); Connect(IDD_TEXTCTRL_Spirals_Count,wxEVT_COMMAND_TEXT_UPDATED,(wxObjectEventFunction)&SpiralsPanel::UpdateLinkedSlider); Connect(ID_BITMAPBUTTON_SLIDER_Spirals_Count,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&SpiralsPanel::OnLockButtonClick); Connect(ID_SLIDER_Spirals_Rotation,wxEVT_COMMAND_SLIDER_UPDATED,(wxObjectEventFunction)&SpiralsPanel::UpdateLinkedTextCtrlFloatVC); Connect(ID_VALUECURVE_Spirals_Rotation,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&SpiralsPanel::OnVCButtonClick); Connect(IDD_TEXTCTRL_Spirals_Rotation,wxEVT_COMMAND_TEXT_UPDATED,(wxObjectEventFunction)&SpiralsPanel::UpdateLinkedSliderFloat); Connect(ID_BITMAPBUTTON_SLIDER_Spirals_Rotation,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&SpiralsPanel::OnLockButtonClick); Connect(ID_SLIDER_Spirals_Thickness,wxEVT_COMMAND_SLIDER_UPDATED,(wxObjectEventFunction)&SpiralsPanel::UpdateLinkedTextCtrlVC); Connect(ID_VALUECURVE_Spirals_Thickness,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&SpiralsPanel::OnVCButtonClick); Connect(IDD_TEXTCTRL_Spirals_Thickness,wxEVT_COMMAND_TEXT_UPDATED,(wxObjectEventFunction)&SpiralsPanel::UpdateLinkedSlider); Connect(ID_BITMAPBUTTON_SLIDER_Spirals_Thickness,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&SpiralsPanel::OnLockButtonClick); Connect(IDD_SLIDER_Spirals_Movement,wxEVT_COMMAND_SLIDER_UPDATED,(wxObjectEventFunction)&SpiralsPanel::UpdateLinkedTextCtrlFloatVC); Connect(ID_VALUECURVE_Spirals_Movement,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&SpiralsPanel::OnVCButtonClick); Connect(ID_TEXTCTRL_Spirals_Movement,wxEVT_COMMAND_TEXT_UPDATED,(wxObjectEventFunction)&SpiralsPanel::UpdateLinkedSliderFloat); Connect(ID_BITMAPBUTTON_SLIDER_Spirals_Direction,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&SpiralsPanel::OnLockButtonClick); Connect(ID_BITMAPBUTTON_CHECKBOX_Spirals_Blend,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&SpiralsPanel::OnLockButtonClick); Connect(ID_BITMAPBUTTON_CHECKBOX_Spirals_3D,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&SpiralsPanel::OnLockButtonClick); Connect(ID_BITMAPBUTTON_CHECKBOX_Spirals_Grow,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&SpiralsPanel::OnLockButtonClick); Connect(ID_BITMAPBUTTON_CHECKBOX_Spirals_Shrink,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&SpiralsPanel::OnLockButtonClick); //*) SetName("ID_PANEL_SPIRALS"); Connect(wxID_ANY, EVT_VC_CHANGED, (wxObjectEventFunction)&SpiralsPanel::OnVCChanged, 0, this); BitmapButton_VCSpiralsCount->GetValue()->SetLimits(1, 5); BitmapButton_VCSpirals_Movement->GetValue()->SetLimits(-200, 200); BitmapButton_VCSpirals_Rotation->GetValue()->SetLimits(-300, 300); BitmapButton_VCSpirals_Thickness->GetValue()->SetLimits(0, 100); }
HTTPFileLoader::HTTPFileLoader(const std::string &filename) : filesize_(0), filepos_(0), url_(filename), filename_(filename), connected_(false) { if (!client_.Resolve(url_.Host().c_str(), url_.Port())) { return; } Connect(); int err = client_.SendRequest("HEAD", url_.Resource().c_str()); if (err < 0) { Disconnect(); return; } Buffer readbuf; std::vector<std::string> responseHeaders; int code = client_.ReadResponseHeaders(&readbuf, responseHeaders); if (code != 200) { // Leave size at 0, invalid. ERROR_LOG(LOADER, "HTTP request failed, got %03d for %s", code, filename.c_str()); Disconnect(); return; } // TODO: Expire cache via ETag, etc. bool acceptsRange = false; for (std::string header : responseHeaders) { if (startsWithNoCase(header, "Content-Length:")) { size_t size_pos = header.find_first_of(' '); if (size_pos != header.npos) { size_pos = header.find_first_not_of(' ', size_pos); } if (size_pos != header.npos) { // TODO: Find a way to get this to work right on Symbian? #ifndef __SYMBIAN32__ filesize_ = atoll(&header[size_pos]); #else filesize_ = atoi(&header[size_pos]); #endif } } if (startsWithNoCase(header, "Accept-Ranges:")) { std::string lowerHeader = header; std::transform(lowerHeader.begin(), lowerHeader.end(), lowerHeader.begin(), tolower); // TODO: Delimited. if (lowerHeader.find("bytes") != lowerHeader.npos) { acceptsRange = true; } } } // TODO: Keepalive instead. Disconnect(); if (!acceptsRange) { WARN_LOG(LOADER, "HTTP server did not advertise support for range requests."); } if (filesize_ == 0) { ERROR_LOG(LOADER, "Could not determine file size for %s", filename.c_str()); } // If we didn't end up with a filesize_ (e.g. chunked response), give up. File invalid. }
ModelDialog::ModelDialog(wxWindow* parent,wxWindowID id) { //(*Initialize(ModelDialog) wxFlexGridSizer* FlexGridSizer4; wxFlexGridSizer* FlexGridSizer3; wxFlexGridSizer* FlexGridSizer5; wxFlexGridSizer* FlexGridSizer2; wxBoxSizer* BoxSizer2; wxBoxSizer* BoxSizer1; wxFlexGridSizer* FlexGridSizer6; wxFlexGridSizer* FlexGridSizer1; wxStdDialogButtonSizer* StdDialogButtonSizer1; Create(parent, wxID_ANY, _("Model"), wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE, _T("wxID_ANY")); SetHelpText(_("Pixels Start in the upper left and go right or down depending on Vertical or Horizontal orientation. Trees are always Vertical.")); FlexGridSizer1 = new wxFlexGridSizer(0, 3, 0, 0); FlexGridSizer2 = new wxFlexGridSizer(0, 2, 0, 0); StaticText1 = new wxStaticText(this, ID_STATICTEXT1, _("Model Name"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT1")); FlexGridSizer2->Add(StaticText1, 1, wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 5); TextCtrl_Name = new wxTextCtrl(this, ID_TEXTCTRL1, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_TEXTCTRL1")); FlexGridSizer2->Add(TextCtrl_Name, 1, wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5); StaticText5 = new wxStaticText(this, ID_STATICTEXT5, _("Display As"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT5")); FlexGridSizer2->Add(StaticText5, 1, wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 5); Choice_DisplayAs = new wxChoice(this, ID_CHOICE_DisplayAs, wxDefaultPosition, wxDefaultSize, 0, 0, 0, wxDefaultValidator, _T("ID_CHOICE_DisplayAs")); Choice_DisplayAs->SetSelection( Choice_DisplayAs->Append(_("Tree 360")) ); Choice_DisplayAs->Append(_("Tree 270")); Choice_DisplayAs->Append(_("Tree 180")); Choice_DisplayAs->Append(_("Tree 90")); Choice_DisplayAs->Append(_("Vert Matrix")); Choice_DisplayAs->Append(_("Horiz Matrix")); Choice_DisplayAs->Append(_("Single Line")); Choice_DisplayAs->Append(_("Arches")); Choice_DisplayAs->Append(_("Window Frame")); Choice_DisplayAs->Append(_("Star")); Choice_DisplayAs->Append(_("Wreath")); Choice_DisplayAs->Append(_("Custom")); FlexGridSizer2->Add(Choice_DisplayAs, 1, wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5); StaticText9 = new wxStaticText(this, ID_STATICTEXT12, _("Type of String"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT12")); FlexGridSizer2->Add(StaticText9, 1, wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 5); Choice_StringType = new wxChoice(this, ID_CHOICE_STRING_TYPE, wxDefaultPosition, wxDefaultSize, 0, 0, 0, wxDefaultValidator, _T("ID_CHOICE_STRING_TYPE")); Choice_StringType->SetSelection( Choice_StringType->Append(_("RGB Nodes")) ); Choice_StringType->Append(_("RBG Nodes")); Choice_StringType->Append(_("GBR Nodes")); Choice_StringType->Append(_("GRB Nodes")); Choice_StringType->Append(_("BRG Nodes")); Choice_StringType->Append(_("BGR Nodes")); Choice_StringType->Append(_("3 Channel RGB")); Choice_StringType->Append(_("Single Color Red")); Choice_StringType->Append(_("Single Color Green")); Choice_StringType->Append(_("Single Color Blue")); Choice_StringType->Append(_("Single Color White")); Choice_StringType->Append(_("Strobes White 3fps")); FlexGridSizer2->Add(Choice_StringType, 1, wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5); StaticText_Strings = new wxStaticText(this, ID_STATICTEXT2, _("Actual # of Strings"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT2")); FlexGridSizer2->Add(StaticText_Strings, 1, wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 5); SpinCtrl_parm1 = new wxSpinCtrl(this, ID_SPINCTRL1, _T("1"), wxDefaultPosition, wxSize(60,21), 0, 1, 1000, 1, _T("ID_SPINCTRL1")); SpinCtrl_parm1->SetValue(_T("1")); FlexGridSizer2->Add(SpinCtrl_parm1, 1, wxALL|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5); StaticText_Nodes = new wxStaticText(this, ID_STATICTEXT3, _("# of RGB Nodes per String"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT3")); FlexGridSizer2->Add(StaticText_Nodes, 1, wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 5); SpinCtrl_parm2 = new wxSpinCtrl(this, ID_SPINCTRL2, _T("50"), wxDefaultPosition, wxSize(60,21), 0, 1, 65535, 50, _T("ID_SPINCTRL2")); SpinCtrl_parm2->SetValue(_T("50")); FlexGridSizer2->Add(SpinCtrl_parm2, 1, wxALL|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5); StaticText_Strands = new wxStaticText(this, ID_STATICTEXT4, _("# of Strands per String"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT4")); StaticText_Strands->SetHelpText(_("How many times is a string folded\?")); FlexGridSizer2->Add(StaticText_Strands, 1, wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 5); SpinCtrl_parm3 = new wxSpinCtrl(this, ID_SPINCTRL3, _T("1"), wxDefaultPosition, wxSize(60,21), 0, 1, 100, 1, _T("ID_SPINCTRL3")); SpinCtrl_parm3->SetValue(_T("1")); FlexGridSizer2->Add(SpinCtrl_parm3, 1, wxALL|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5); StaticText6 = new wxStaticText(this, ID_STATICTEXT6, _("Start Channel"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT6")); FlexGridSizer2->Add(StaticText6, 1, wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 5); SpinCtrl_StartChannel = new wxSpinCtrl(this, ID_SPINCTRL4, _T("1"), wxDefaultPosition, wxSize(90,21), 0, 1, 99999, 1, _T("ID_SPINCTRL4")); SpinCtrl_StartChannel->SetValue(_T("1")); FlexGridSizer2->Add(SpinCtrl_StartChannel, 1, wxALL|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5); StaticText3 = new wxStaticText(this, ID_STATICTEXT8, _("Starting Corner"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT8")); StaticText3->SetHelpText(_("The point at which pixels in your model start.")); FlexGridSizer2->Add(StaticText3, 1, wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 5); BoxSizer1 = new wxBoxSizer(wxHORIZONTAL); RadioButton_TopLeft = new wxRadioButton(this, ID_RADIOBUTTON1, _("Top Left"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP, wxDefaultValidator, _T("ID_RADIOBUTTON1")); RadioButton_TopLeft->SetValue(true); BoxSizer1->Add(RadioButton_TopLeft, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); RadioButton_TopRight = new wxRadioButton(this, ID_RADIOBUTTON2, _("Top Right"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_RADIOBUTTON2")); BoxSizer1->Add(RadioButton_TopRight, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); FlexGridSizer2->Add(BoxSizer1, 1, wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5); StaticText8 = new wxStaticText(this, ID_STATICTEXT11, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT11")); FlexGridSizer2->Add(StaticText8, 1, wxALL|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5); BoxSizer2 = new wxBoxSizer(wxHORIZONTAL); RadioButton_BotLeft = new wxRadioButton(this, ID_RADIOBUTTON4, _("Bottom Left"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_RADIOBUTTON4")); BoxSizer2->Add(RadioButton_BotLeft, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); RadioButton_BotRight = new wxRadioButton(this, ID_RADIOBUTTON3, _("Bottom Right"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_RADIOBUTTON3")); BoxSizer2->Add(RadioButton_BotRight, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); FlexGridSizer2->Add(BoxSizer2, 1, wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5); StaticText4 = new wxStaticText(this, ID_STATICTEXT9, _("Smooth Edges - antialias\n(future capability)"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT9")); FlexGridSizer2->Add(StaticText4, 1, wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 5); Choice_Antialias = new wxChoice(this, ID_CHOICE3, wxDefaultPosition, wxDefaultSize, 0, 0, 0, wxDefaultValidator, _T("ID_CHOICE3")); Choice_Antialias->SetSelection( Choice_Antialias->Append(_("None")) ); Choice_Antialias->Append(_("2x")); Choice_Antialias->Disable(); FlexGridSizer2->Add(Choice_Antialias, 1, wxALL|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5); StaticText7 = new wxStaticText(this, ID_STATICTEXT10, _("Part of my display"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT10")); FlexGridSizer2->Add(StaticText7, 1, wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 5); CheckBox_MyDisplay = new wxCheckBox(this, ID_CHECKBOX1, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_CHECKBOX1")); CheckBox_MyDisplay->SetValue(true); FlexGridSizer2->Add(CheckBox_MyDisplay, 1, wxALL|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5); StaticText2 = new wxStaticText(this, ID_STATICTEXT7, _("Model Brightness\nAdjustment"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT7")); FlexGridSizer2->Add(StaticText2, 1, wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 5); FlexGridSizer6 = new wxFlexGridSizer(0, 2, 0, 0); Slider_Model_Brightness = new wxSlider(this, ID_Slider_Model_Brightness, 0, -100, 100, wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_Slider_Model_Brightness")); FlexGridSizer6->Add(Slider_Model_Brightness, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); SpinCtrl1 = new wxSpinCtrl(this, ID_SPINCTRL5, _T("0"), wxDefaultPosition, wxSize(52,21), 0, -100, 100, 0, _T("ID_SPINCTRL5")); SpinCtrl1->SetValue(_T("0")); FlexGridSizer6->Add(SpinCtrl1, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); FlexGridSizer2->Add(FlexGridSizer6, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); StarSizesLabel = new wxStaticText(this, ID_STATICTEXT15, _("Star Sizes"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT15")); FlexGridSizer2->Add(StarSizesLabel, 1, wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 5); StarSizes = new wxTextCtrl(this, ID_TEXTCTRL2, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_TEXTCTRL2")); FlexGridSizer2->Add(StarSizes, 1, wxALL|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5); FlexGridSizer1->Add(FlexGridSizer2, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); FlexGridSizer3 = new wxFlexGridSizer(2, 1, 0, 0); FlexGridSizer3->AddGrowableRow(1); cbIndividualStartNumbers = new wxCheckBox(this, ID_CHECKBOX2, _("Individual Start Chans"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_CHECKBOX2")); cbIndividualStartNumbers->SetValue(false); FlexGridSizer3->Add(cbIndividualStartNumbers, 1, wxTOP|wxBOTTOM|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 10); ScrolledWindow1 = new wxScrolledWindow(this, ID_SCROLLEDWINDOW1, wxDefaultPosition, wxDefaultSize, wxVSCROLL, _T("ID_SCROLLEDWINDOW1")); gridStartChannels = new wxGrid(ScrolledWindow1, ID_GRID_START_CHANNELS, wxPoint(-1,-3), wxSize(232,323), wxVSCROLL|wxHSCROLL|wxFULL_REPAINT_ON_RESIZE, _T("ID_GRID_START_CHANNELS")); gridStartChannels->CreateGrid(0,2); gridStartChannels->EnableEditing(true); gridStartChannels->EnableGridLines(true); gridStartChannels->SetColLabelSize(20); gridStartChannels->SetRowLabelSize(25); gridStartChannels->SetDefaultColSize(90, true); gridStartChannels->SetColLabelValue(0, _("Start Ch.")); gridStartChannels->SetColLabelValue(1, _("End Ch.")); gridStartChannels->SetDefaultCellFont( gridStartChannels->GetFont() ); gridStartChannels->SetDefaultCellTextColour( gridStartChannels->GetForegroundColour() ); FlexGridSizer3->Add(ScrolledWindow1, 1, wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); FlexGridSizer1->Add(FlexGridSizer3, 1, wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); FlexGridSizer4 = new wxFlexGridSizer(2, 1, 0, 0); FlexGridSizer4->AddGrowableRow(1); FlexGridSizer5 = new wxFlexGridSizer(0, 7, 0, 0); StaticTextCustomModel = new wxStaticText(this, ID_STATICTEXT14, _("Custom Model"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT14")); FlexGridSizer5->Add(StaticTextCustomModel, 1, wxTOP|wxBOTTOM|wxRIGHT|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); BitmapButtonCustomCut = new wxBitmapButton(this, ID_BITMAPBUTTON_CUSTOM_CUT, wxArtProvider::GetBitmap(wxART_MAKE_ART_ID_FROM_STR(_T("wxART_CUT")),wxART_BUTTON), wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW, wxDefaultValidator, _T("ID_BITMAPBUTTON_CUSTOM_CUT")); FlexGridSizer5->Add(BitmapButtonCustomCut, 1, wxLEFT|wxRIGHT|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); BitmapButtonCustomCopy = new wxBitmapButton(this, ID_BITMAPBUTTON_CUSTOM_COPY, wxArtProvider::GetBitmap(wxART_MAKE_ART_ID_FROM_STR(_T("wxART_COPY")),wxART_BUTTON), wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW, wxDefaultValidator, _T("ID_BITMAPBUTTON_CUSTOM_COPY")); BitmapButtonCustomCopy->SetDefault(); FlexGridSizer5->Add(BitmapButtonCustomCopy, 1, wxLEFT|wxRIGHT|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); BitmapButtonCustomPaste = new wxBitmapButton(this, ID_BITMAPBUTTON_CUSTOM_PASTE, wxArtProvider::GetBitmap(wxART_MAKE_ART_ID_FROM_STR(_T("wxART_PASTE")),wxART_BUTTON), wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW, wxDefaultValidator, _T("ID_BITMAPBUTTON_CUSTOM_PASTE")); BitmapButtonCustomPaste->SetDefault(); FlexGridSizer5->Add(BitmapButtonCustomPaste, 1, wxLEFT|wxRIGHT|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); ButtonCustomModelHelp = new wxButton(this, ID_BUTTON_CUSTOM_MODEL_HELP, _("Help"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_BUTTON_CUSTOM_MODEL_HELP")); FlexGridSizer5->Add(ButtonCustomModelHelp, 1, wxLEFT|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); Button_CustomModelZoomIn = new wxButton(this, ID_BUTTON_CustomModelZoomIn, _("+"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_BUTTON_CustomModelZoomIn")); Button_CustomModelZoomIn->SetMinSize(wxSize(24,-1)); Button_CustomModelZoomIn->SetToolTip(_("Zoom In")); FlexGridSizer5->Add(Button_CustomModelZoomIn, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); Button_CustomModelZoomOut = new wxButton(this, ID_BUTTON_CustomModelZoomOut, _("-"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_BUTTON_CustomModelZoomOut")); Button_CustomModelZoomOut->SetMinSize(wxSize(24,-1)); Button_CustomModelZoomOut->SetToolTip(_("Zoom Out")); FlexGridSizer5->Add(Button_CustomModelZoomOut, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); FlexGridSizer4->Add(FlexGridSizer5, 1, wxTOP|wxLEFT|wxRIGHT|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5); ScrolledWindow2 = new wxScrolledWindow(this, ID_SCROLLEDWINDOW2, wxDefaultPosition, wxSize(430,323), wxVSCROLL|wxHSCROLL, _T("ID_SCROLLEDWINDOW2")); ScrolledWindow2->SetMinSize(wxSize(504,-1)); GridCustom = new wxGrid(ScrolledWindow2, ID_GRID_Custom, wxPoint(6,5), wxSize(484,318), 0, _T("ID_GRID_Custom")); GridCustom->CreateGrid(1,1); GridCustom->EnableEditing(true); GridCustom->EnableGridLines(true); GridCustom->SetColLabelSize(20); GridCustom->SetRowLabelSize(30); GridCustom->SetDefaultColSize(30, true); GridCustom->SetDefaultCellFont( GridCustom->GetFont() ); GridCustom->SetDefaultCellTextColour( GridCustom->GetForegroundColour() ); FlexGridSizer4->Add(ScrolledWindow2, 1, wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5); FlexGridSizer1->Add(FlexGridSizer4, 1, wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); StdDialogButtonSizer1 = new wxStdDialogButtonSizer(); StdDialogButtonSizer1->AddButton(new wxButton(this, wxID_OK, wxEmptyString)); StdDialogButtonSizer1->AddButton(new wxButton(this, wxID_CANCEL, wxEmptyString)); StdDialogButtonSizer1->Realize(); FlexGridSizer1->Add(StdDialogButtonSizer1, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); SetSizer(FlexGridSizer1); FlexGridSizer1->Fit(this); FlexGridSizer1->SetSizeHints(this); Center(); Connect(ID_CHOICE_DisplayAs,wxEVT_COMMAND_CHOICE_SELECTED,(wxObjectEventFunction)&ModelDialog::OnChoice_DisplayAsSelect); Connect(ID_CHOICE_STRING_TYPE,wxEVT_COMMAND_CHOICE_SELECTED,(wxObjectEventFunction)&ModelDialog::OnChoice_StringTypeSelect); Connect(ID_SPINCTRL1,wxEVT_COMMAND_SPINCTRL_UPDATED,(wxObjectEventFunction)&ModelDialog::OnSpinCtrl_parm1Change); Connect(ID_SPINCTRL2,wxEVT_COMMAND_SPINCTRL_UPDATED,(wxObjectEventFunction)&ModelDialog::OnSpinCtrl_parm2Change); Connect(ID_SPINCTRL3,wxEVT_COMMAND_SPINCTRL_UPDATED,(wxObjectEventFunction)&ModelDialog::OnSpinCtrl_parm3Change); Connect(ID_SPINCTRL4,wxEVT_COMMAND_SPINCTRL_UPDATED,(wxObjectEventFunction)&ModelDialog::OnSpinCtrl_StartChannelChange); Connect(ID_Slider_Model_Brightness,wxEVT_SCROLL_TOP|wxEVT_SCROLL_BOTTOM|wxEVT_SCROLL_LINEUP|wxEVT_SCROLL_LINEDOWN|wxEVT_SCROLL_PAGEUP|wxEVT_SCROLL_PAGEDOWN|wxEVT_SCROLL_THUMBTRACK|wxEVT_SCROLL_THUMBRELEASE|wxEVT_SCROLL_CHANGED,(wxObjectEventFunction)&ModelDialog::OnSlider_Model_BrightnessCmdScroll); Connect(ID_Slider_Model_Brightness,wxEVT_COMMAND_SLIDER_UPDATED,(wxObjectEventFunction)&ModelDialog::OnSlider_Model_BrightnessCmdScroll); Connect(ID_CHECKBOX2,wxEVT_COMMAND_CHECKBOX_CLICKED,(wxObjectEventFunction)&ModelDialog::OncbIndividualStartNumbersClick); Connect(ID_GRID_START_CHANNELS,wxEVT_GRID_CELL_CHANGE,(wxObjectEventFunction)&ModelDialog::OngridStartChannelsCellChange); Connect(ID_BITMAPBUTTON_CUSTOM_CUT,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&ModelDialog::OnBitmapButtonCustomCutClick); Connect(ID_BITMAPBUTTON_CUSTOM_COPY,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&ModelDialog::OnBitmapButtonCustomCopyClick); Connect(ID_BITMAPBUTTON_CUSTOM_PASTE,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&ModelDialog::OnBitmapButtonCustomPasteClick); Connect(ID_BUTTON_CUSTOM_MODEL_HELP,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&ModelDialog::OnButtonCustomModelHelpClick); Connect(ID_BUTTON_CustomModelZoomIn,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&ModelDialog::OnButton_CustomModelZoomInClick); Connect(ID_BUTTON_CustomModelZoomOut,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&ModelDialog::OnButton_CustomModelZoomOutClick); Connect(ID_GRID_Custom,wxEVT_GRID_CELL_CHANGE,(wxObjectEventFunction)&ModelDialog::OnGridCustomCellChange); //*) gridStartChannels->SetDefaultEditor(new wxGridCellNumberEditor()); GridCustom->SetDefaultEditor(new wxGridCellNumberEditor()); HasCustomData = false; }
void AGE_Frame::CreateSoundControls() { Sounds_Main = new wxBoxSizer(wxHORIZONTAL); Sounds_ListArea = new wxBoxSizer(wxVERTICAL); Sounds_Sounds_Buttons = new wxGridSizer(3, 0, 0); SoundItems_ListArea = new wxBoxSizer(wxVERTICAL); Sounds_Items_Buttons = new wxGridSizer(3, 0, 0); Sounds_DataArea = new wxBoxSizer(wxVERTICAL); Tab_Sounds = new wxPanel(TabBar_Main, wxID_ANY, wxDefaultPosition, wxSize(0, 20)); Sounds_Sounds = new wxStaticBoxSizer(wxVERTICAL, Tab_Sounds, "Sounds"); Sounds_Sounds_Search = new wxTextCtrl(Tab_Sounds, wxID_ANY); Sounds_Sounds_Search_R = new wxTextCtrl(Tab_Sounds, wxID_ANY); Sounds_Sounds_List = new wxListBox(Tab_Sounds, wxID_ANY, wxDefaultPosition, wxSize(10, 100), 0, NULL, wxLB_EXTENDED); Sounds_Add = new wxButton(Tab_Sounds, wxID_ANY, "Add", wxDefaultPosition, wxSize(5, 20)); Sounds_Insert = new wxButton(Tab_Sounds, wxID_ANY, "Insert", wxDefaultPosition, wxSize(5, 20)); Sounds_Delete = new wxButton(Tab_Sounds, wxID_ANY, "Delete", wxDefaultPosition, wxSize(5, 20)); Sounds_Copy = new wxButton(Tab_Sounds, wxID_ANY, "Copy", wxDefaultPosition, wxSize(5, 20)); Sounds_Paste = new wxButton(Tab_Sounds, wxID_ANY, "Paste", wxDefaultPosition, wxSize(5, 20)); Sounds_PasteInsert = new wxButton(Tab_Sounds, wxID_ANY, "PasteInsert", wxDefaultPosition, wxSize(5, 20)); Sounds_Items = new wxStaticBoxSizer(wxVERTICAL, Tab_Sounds, "Sound Files"); for(short loop = 0; loop < 2; ++loop) { Sounds_Items_Searches[loop] = new wxBoxSizer(wxHORIZONTAL); Sounds_Items_SearchFilters[loop] = new wxOwnerDrawnComboBox(Tab_Sounds, wxID_ANY, "", wxDefaultPosition, wxSize(0, 20), 0, NULL, wxCB_READONLY); } Sounds_Items_Search = new wxTextCtrl(Tab_Sounds, wxID_ANY); Sounds_Items_UseAnd[0] = new wxCheckBox(Tab_Sounds, wxID_ANY, "And", wxDefaultPosition, wxSize(40, 20)); Sounds_Items_Search_R = new wxTextCtrl(Tab_Sounds, wxID_ANY); Sounds_Items_UseAnd[1] = new wxCheckBox(Tab_Sounds, wxID_ANY, "And", wxDefaultPosition, wxSize(40, 20)); Sounds_Items_List = new wxListBox(Tab_Sounds, wxID_ANY, wxDefaultPosition, wxSize(10, 100), 0, NULL, wxLB_EXTENDED); SoundItems_Add = new wxButton(Tab_Sounds, wxID_ANY, "Add", wxDefaultPosition, wxSize(5, 20)); SoundItems_Insert = new wxButton(Tab_Sounds, wxID_ANY, "Insert", wxDefaultPosition, wxSize(5, 20)); SoundItems_Delete = new wxButton(Tab_Sounds, wxID_ANY, "Delete", wxDefaultPosition, wxSize(5, 20)); SoundItems_Copy = new wxButton(Tab_Sounds, wxID_ANY, "Copy", wxDefaultPosition, wxSize(5, 20)); SoundItems_Paste = new wxButton(Tab_Sounds, wxID_ANY, "Paste", wxDefaultPosition, wxSize(5, 20)); SoundItems_PasteInsert = new wxButton(Tab_Sounds, wxID_ANY, "PasteInsert", wxDefaultPosition, wxSize(5, 20)); SoundItems_CopyToSounds = new wxButton(Tab_Sounds, wxID_ANY, "Copy all to selected sounds", wxDefaultPosition, wxSize(5, 20)); Sounds_Holder_ID = new wxBoxSizer(wxVERTICAL); Sounds_Text_ID = new wxStaticText(Tab_Sounds, wxID_ANY, " Sound ID", wxDefaultPosition, wxSize(-1, 15), wxALIGN_LEFT | wxST_NO_AUTORESIZE); Sounds_ID = new TextCtrl_Long(Tab_Sounds); Sounds_Holder_Unknown = new wxBoxSizer(wxVERTICAL); Sounds_Text_Unknown = new wxStaticText(Tab_Sounds, wxID_ANY, " Sound Unknown", wxDefaultPosition, wxSize(-1, 15), wxALIGN_LEFT | wxST_NO_AUTORESIZE); Sounds_Unknown = new TextCtrl_Long(Tab_Sounds); SoundItems_Holder_Name = new wxBoxSizer(wxVERTICAL); SoundItems_Text_Name = new wxStaticText(Tab_Sounds, wxID_ANY, " Filename", wxDefaultPosition, wxSize(-1, 15), wxALIGN_LEFT | wxST_NO_AUTORESIZE); SoundItems_Name = new TextCtrl_String(Tab_Sounds); SoundItems_Holder_Resource = new wxBoxSizer(wxVERTICAL); SoundItems_Text_Resource = new wxStaticText(Tab_Sounds, wxID_ANY, " File DRS Resource", wxDefaultPosition, wxSize(-1, 15), wxALIGN_LEFT | wxST_NO_AUTORESIZE); SoundItems_Resource = new TextCtrl_Long(Tab_Sounds); SoundItems_Holder_Probability = new wxBoxSizer(wxVERTICAL); SoundItems_Text_Probability = new wxStaticText(Tab_Sounds, wxID_ANY, " File Probability", wxDefaultPosition, wxSize(-1, 15), wxALIGN_LEFT | wxST_NO_AUTORESIZE); SoundItems_Probability = new TextCtrl_Short(Tab_Sounds); SoundItems_Holder_Civ = new wxBoxSizer(wxVERTICAL); SoundItems_Text_Civ = new wxStaticText(Tab_Sounds, wxID_ANY, " File Civilization", wxDefaultPosition, wxSize(-1, 15), wxALIGN_LEFT | wxST_NO_AUTORESIZE); SoundItems_Civ = new TextCtrl_Short(Tab_Sounds); SoundItems_ComboBox_Civ = new ComboBox_Plus1(Tab_Sounds, SoundItems_Civ); CivComboBoxList.push_back(SoundItems_ComboBox_Civ); SoundItems_Holder_Unknown = new wxBoxSizer(wxVERTICAL); SoundItems_Text_Unknown = new wxStaticText(Tab_Sounds, wxID_ANY, " File Unknown", wxDefaultPosition, wxSize(-1, 15), wxALIGN_LEFT | wxST_NO_AUTORESIZE); SoundItems_Unknown = new TextCtrl_Short(Tab_Sounds); Sounds_AllItems = new wxStaticBoxSizer(wxVERTICAL, Tab_Sounds, "Files of all Sounds"); Sounds_AllItems_Searches[0] = new wxBoxSizer(wxHORIZONTAL); Sounds_AllItems_Searches[1] = new wxBoxSizer(wxHORIZONTAL); Sounds_AllItems_Search = new wxTextCtrl(Tab_Sounds, wxID_ANY); Sounds_AllItems_UseAnd[0] = new wxCheckBox(Tab_Sounds, wxID_ANY, "And", wxDefaultPosition, wxSize(40, 20)); Sounds_AllItems_Search_R = new wxTextCtrl(Tab_Sounds, wxID_ANY); Sounds_AllItems_UseAnd[1] = new wxCheckBox(Tab_Sounds, wxID_ANY, "And", wxDefaultPosition, wxSize(40, 20)); Sounds_AllItems_List = new wxListBox(Tab_Sounds, wxID_ANY, wxDefaultPosition, wxSize(10, 100), 0, NULL, wxLB_EXTENDED); Sounds_AllItems_Buttons = new wxBoxSizer(wxHORIZONTAL); Sounds_AllItems_Load = new wxButton(Tab_Sounds, wxID_ANY, "Reload", wxDefaultPosition, wxSize(5, 20)); Sounds_AllItems_Clear = new wxButton(Tab_Sounds, wxID_ANY, "Clear *", wxDefaultPosition, wxSize(5, 20)); Sounds_AllItems_Clear->SetToolTip("Clear the modified search texts"); Sounds_Sounds_Buttons->Add(Sounds_Add, 1, wxEXPAND); Sounds_Sounds_Buttons->Add(Sounds_Insert, 1, wxEXPAND); Sounds_Sounds_Buttons->Add(Sounds_Delete, 1, wxEXPAND); Sounds_Sounds_Buttons->Add(Sounds_Copy, 1, wxEXPAND); Sounds_Sounds_Buttons->Add(Sounds_Paste, 1, wxEXPAND); Sounds_Sounds_Buttons->Add(Sounds_PasteInsert, 1, wxEXPAND); Sounds_Sounds->Add(Sounds_Sounds_Search, 0, wxEXPAND); Sounds_Sounds->Add(Sounds_Sounds_Search_R, 0, wxEXPAND); Sounds_Sounds->Add(-1, 2); Sounds_Sounds->Add(Sounds_Sounds_List, 1, wxEXPAND); Sounds_Sounds->Add(-1, 2); Sounds_Sounds->Add(Sounds_Sounds_Buttons, 0, wxEXPAND); Sounds_ListArea->Add(-1, 10); Sounds_ListArea->Add(Sounds_Sounds, 1, wxEXPAND); Sounds_ListArea->Add(-1, 10); Sounds_Items_Buttons->Add(SoundItems_Add, 1, wxEXPAND); Sounds_Items_Buttons->Add(SoundItems_Insert, 1, wxEXPAND); Sounds_Items_Buttons->Add(SoundItems_Delete, 1, wxEXPAND); Sounds_Items_Buttons->Add(SoundItems_Copy, 1, wxEXPAND); Sounds_Items_Buttons->Add(SoundItems_Paste, 1, wxEXPAND); Sounds_Items_Buttons->Add(SoundItems_PasteInsert, 1, wxEXPAND); Sounds_Items_Searches[0]->Add(Sounds_Items_Search, 1, wxEXPAND); Sounds_Items_Searches[0]->Add(2, -1); Sounds_Items_Searches[0]->Add(Sounds_Items_UseAnd[0], 0, wxEXPAND); Sounds_Items_Searches[1]->Add(Sounds_Items_Search_R, 1, wxEXPAND); Sounds_Items_Searches[1]->Add(2, -1); Sounds_Items_Searches[1]->Add(Sounds_Items_UseAnd[1], 0, wxEXPAND); Sounds_Items->Add(Sounds_Items_Searches[0], 0, wxEXPAND); Sounds_Items->Add(Sounds_Items_Searches[1], 0, wxEXPAND); Sounds_Items->Add(Sounds_Items_SearchFilters[0], 0, wxEXPAND); Sounds_Items->Add(Sounds_Items_SearchFilters[1], 0, wxEXPAND); Sounds_Items->Add(-1, 2); Sounds_Items->Add(Sounds_Items_List, 1, wxEXPAND); Sounds_Items->Add(-1, 2); Sounds_Items->Add(Sounds_Items_Buttons, 0, wxEXPAND); Sounds_Items->Add(-1, 2); Sounds_Items->Add(SoundItems_CopyToSounds, 0, wxEXPAND); SoundItems_ListArea->Add(-1, 10); SoundItems_ListArea->Add(Sounds_Items, 1, wxEXPAND); SoundItems_ListArea->Add(-1, 10); Sounds_Holder_ID->Add(Sounds_Text_ID, 0, wxEXPAND); Sounds_Holder_ID->Add(Sounds_ID, 1, wxEXPAND); Sounds_Holder_Unknown->Add(Sounds_Text_Unknown, 0, wxEXPAND); Sounds_Holder_Unknown->Add(Sounds_Unknown, 1, wxEXPAND); SoundItems_Holder_Name->Add(SoundItems_Text_Name, 0, wxEXPAND); SoundItems_Holder_Name->Add(SoundItems_Name, 1, wxEXPAND); SoundItems_Holder_Resource->Add(SoundItems_Text_Resource, 0, wxEXPAND); SoundItems_Holder_Resource->Add(SoundItems_Resource, 1, wxEXPAND); SoundItems_Holder_Probability->Add(SoundItems_Text_Probability, 0, wxEXPAND); SoundItems_Holder_Probability->Add(SoundItems_Probability, 1, wxEXPAND); SoundItems_Holder_Civ->Add(SoundItems_Text_Civ, 0, wxEXPAND); SoundItems_Holder_Civ->Add(SoundItems_Civ, 1, wxEXPAND); SoundItems_Holder_Civ->Add(SoundItems_ComboBox_Civ, 1, wxEXPAND); SoundItems_Holder_Unknown->Add(SoundItems_Text_Unknown, 0, wxEXPAND); SoundItems_Holder_Unknown->Add(SoundItems_Unknown, 1, wxEXPAND); Sounds_AllItems_Searches[0]->Add(Sounds_AllItems_Search, 1, wxEXPAND); Sounds_AllItems_Searches[0]->Add(2, -1); Sounds_AllItems_Searches[0]->Add(Sounds_AllItems_UseAnd[0], 0, wxEXPAND); Sounds_AllItems_Searches[1]->Add(Sounds_AllItems_Search_R, 1, wxEXPAND); Sounds_AllItems_Searches[1]->Add(2, -1); Sounds_AllItems_Searches[1]->Add(Sounds_AllItems_UseAnd[1], 0, wxEXPAND); Sounds_AllItems->Add(Sounds_AllItems_Searches[0], 0, wxEXPAND); Sounds_AllItems->Add(Sounds_AllItems_Searches[1], 0, wxEXPAND); Sounds_AllItems->Add(-1, 2); Sounds_AllItems->Add(Sounds_AllItems_List, 1, wxEXPAND); Sounds_AllItems->Add(-1, 2); Sounds_AllItems_Buttons->Add(Sounds_AllItems_Load, 2, wxEXPAND); Sounds_AllItems_Buttons->Add(2, -1); Sounds_AllItems_Buttons->Add(Sounds_AllItems_Clear, 1, wxEXPAND); Sounds_AllItems->Add(Sounds_AllItems_Buttons, 0, wxEXPAND); Sounds_DataArea->Add(-1, 10); Sounds_DataArea->Add(Sounds_Holder_ID, 0, wxEXPAND); Sounds_DataArea->Add(-1, 5); Sounds_DataArea->Add(Sounds_Holder_Unknown, 0, wxEXPAND); Sounds_DataArea->Add(-1, 5); Sounds_DataArea->Add(SoundItems_Holder_Name, 0, wxEXPAND); Sounds_DataArea->Add(-1, 5); Sounds_DataArea->Add(SoundItems_Holder_Resource, 0, wxEXPAND); Sounds_DataArea->Add(-1, 5); Sounds_DataArea->Add(SoundItems_Holder_Probability, 0, wxEXPAND); Sounds_DataArea->Add(-1, 5); Sounds_DataArea->Add(SoundItems_Holder_Civ, 0, wxEXPAND); Sounds_DataArea->Add(-1, 5); Sounds_DataArea->Add(SoundItems_Holder_Unknown, 0, wxEXPAND); Sounds_DataArea->Add(-1, 5); Sounds_DataArea->Add(Sounds_AllItems, 1, wxEXPAND); Sounds_DataArea->Add(-1, 10); Sounds_Main->Add(10, -1); Sounds_Main->Add(Sounds_ListArea, 1, wxEXPAND); Sounds_Main->Add(10, -1); Sounds_Main->Add(SoundItems_ListArea, 1, wxEXPAND); Sounds_Main->Add(10, -1); Sounds_Main->Add(Sounds_DataArea, 1, wxEXPAND); Sounds_Main->AddStretchSpacer(1); if(EnableIDFix) Sounds_ID->Enable(false); Tab_Sounds->SetSizer(Sounds_Main); for(short loop = 0; loop < 2; ++loop) { Connect(Sounds_Items_UseAnd[loop]->GetId(), wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler(AGE_Frame::OnSoundItemsSearch)); Connect(Sounds_Items_SearchFilters[loop]->GetId(), wxEVT_COMMAND_COMBOBOX_SELECTED, wxCommandEventHandler(AGE_Frame::OnSelection_SearchFilters)); Connect(Sounds_AllItems_UseAnd[loop]->GetId(), wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler(AGE_Frame::LoadAllSoundFiles)); } Connect(Sounds_Sounds_List->GetId(), wxEVT_COMMAND_LISTBOX_SELECTED, wxCommandEventHandler(AGE_Frame::OnSoundsSelect)); Connect(Sounds_Sounds_Search->GetId(), wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler(AGE_Frame::OnSoundsSearch)); Connect(Sounds_Sounds_Search_R->GetId(), wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler(AGE_Frame::OnSoundsSearch)); Connect(Sounds_Add->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(AGE_Frame::OnSoundsAdd)); Connect(Sounds_Insert->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(AGE_Frame::OnSoundsInsert)); Connect(Sounds_Delete->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(AGE_Frame::OnSoundsDelete)); Connect(Sounds_Copy->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(AGE_Frame::OnSoundsCopy)); Connect(Sounds_Paste->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(AGE_Frame::OnSoundsPaste)); Connect(Sounds_PasteInsert->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(AGE_Frame::OnSoundsPasteInsert)); Connect(Sounds_Items_List->GetId(), wxEVT_COMMAND_LISTBOX_SELECTED, wxCommandEventHandler(AGE_Frame::OnSoundItemsSelect)); Connect(Sounds_Items_Search->GetId(), wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler(AGE_Frame::OnSoundItemsSearch)); Connect(Sounds_Items_Search_R->GetId(), wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler(AGE_Frame::OnSoundItemsSearch)); Connect(SoundItems_Add->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(AGE_Frame::OnSoundItemsAdd)); Connect(SoundItems_Insert->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(AGE_Frame::OnSoundItemsInsert)); Connect(SoundItems_Delete->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(AGE_Frame::OnSoundItemsDelete)); Connect(SoundItems_Copy->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(AGE_Frame::OnSoundItemsCopy)); Connect(SoundItems_Paste->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(AGE_Frame::OnSoundItemsPaste)); Connect(SoundItems_PasteInsert->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(AGE_Frame::OnSoundItemsPasteInsert)); Connect(SoundItems_CopyToSounds->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(AGE_Frame::OnSoundItemsCopyToSounds)); Connect(Sounds_AllItems_Search->GetId(), wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler(AGE_Frame::LoadAllSoundFiles)); Connect(Sounds_AllItems_Search_R->GetId(), wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler(AGE_Frame::LoadAllSoundFiles)); Connect(Sounds_AllItems_List->GetId(), wxEVT_COMMAND_LISTBOX_SELECTED, wxCommandEventHandler(AGE_Frame::OnAllSoundFileSelect)); Connect(Sounds_AllItems_Load->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(AGE_Frame::LoadAllSoundFiles)); Connect(Sounds_AllItems_Clear->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(AGE_Frame::ClearAllSoundFiles)); SoundItems_Name->Connect(SoundItems_Name->GetId(), wxEVT_KILL_FOCUS, wxFocusEventHandler(AGE_Frame::OnKillFocus_Sounds), NULL, this); }
Closure::Closure(QObject* sender, const char* signal, std::tr1::function<void()> callback) : callback_(callback) { Connect(sender, signal); }
PinwheelPanel::PinwheelPanel(wxWindow* parent) { //(*Initialize(PinwheelPanel) wxFlexGridSizer* FlexGridSizer4; wxFlexGridSizer* FlexGridSizer59; wxTextCtrl* TextCtrl69; wxFlexGridSizer* FlexGridSizer63; wxTextCtrl* TextCtrl70; wxTextCtrl* TextCtrl68; wxFlexGridSizer* FlexGridSizer3; wxFlexGridSizer* FlexGridSizer5; wxTextCtrl* TextCtrl64; wxFlexGridSizer* FlexGridSizer62; wxFlexGridSizer* FlexGridSizer2; wxFlexGridSizer* FlexGridSizer55; wxTextCtrl* TextCtrl66; wxFlexGridSizer* FlexGridSizer61; wxBoxSizer* BoxSizer1; wxFlexGridSizer* FlexGridSizer6; wxFlexGridSizer* FlexGridSizer1; wxTextCtrl* TextCtrl67; wxFlexGridSizer* FlexGridSizer64; wxStaticText* StaticText184; wxFlexGridSizer* FlexGridSizer68; wxFlexGridSizer* FlexGridSizer128; wxTextCtrl* TextCtrl65; Create(parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL, _T("wxID_ANY")); FlexGridSizer55 = new wxFlexGridSizer(0, 1, 0, 0); FlexGridSizer55->AddGrowableCol(0); FlexGridSizer55->AddGrowableRow(2); FlexGridSizer128 = new wxFlexGridSizer(0, 4, 0, 0); FlexGridSizer128->AddGrowableCol(1); StaticText63 = new wxStaticText(this, ID_STATICTEXT65, _("#Arms"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT65")); FlexGridSizer128->Add(StaticText63, 1, wxALL|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5); Slider_Pinwheel_Arms = new wxSlider(this, ID_SLIDER_Pinwheel_Arms, 3, 1, 20, wxDefaultPosition, wxSize(80,20), 0, wxDefaultValidator, _T("ID_SLIDER_Pinwheel_Arms")); FlexGridSizer128->Add(Slider_Pinwheel_Arms, 1, wxALL|wxEXPAND, 2); TextCtrl64 = new wxTextCtrl(this, IDD_TEXTCTRL_Pinwheel_Arms, _("3"), wxDefaultPosition, wxDLG_UNIT(this,wxSize(20,-1)), wxTE_CENTRE, wxDefaultValidator, _T("IDD_TEXTCTRL_Pinwheel_Arms")); TextCtrl64->SetMaxLength(3); FlexGridSizer128->Add(TextCtrl64, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 2); BitmapButton_PinwheelNumberArms = new wxBitmapButton(this, ID_BITMAPBUTTON11, padlock16x16_blue_xpm, wxDefaultPosition, wxSize(13,13), wxBU_AUTODRAW|wxNO_BORDER, wxDefaultValidator, _T("ID_BITMAPBUTTON11")); BitmapButton_PinwheelNumberArms->SetDefault(); BitmapButton_PinwheelNumberArms->SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_ACTIVECAPTION)); FlexGridSizer128->Add(BitmapButton_PinwheelNumberArms, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 1); StaticText84 = new wxStaticText(this, ID_STATICTEXT98, _("Size"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT98")); FlexGridSizer128->Add(StaticText84, 1, wxALL|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5); FlexGridSizer1 = new wxFlexGridSizer(0, 2, 0, 0); FlexGridSizer1->AddGrowableCol(0); Slider_Pinwheel_ArmSize = new wxSlider(this, ID_SLIDER_Pinwheel_ArmSize, 100, 0, 400, wxDefaultPosition, wxSize(80,20), 0, wxDefaultValidator, _T("ID_SLIDER_Pinwheel_ArmSize")); FlexGridSizer1->Add(Slider_Pinwheel_ArmSize, 1, wxALL|wxEXPAND, 2); BitmapButton_Pinwheel_ArmSizeVC = new ValueCurveButton(this, ID_VALUECURVE_Pinwheel_ArmSize, valuecurvenotselected_24, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|wxNO_BORDER, wxDefaultValidator, _T("ID_VALUECURVE_Pinwheel_ArmSize")); FlexGridSizer1->Add(BitmapButton_Pinwheel_ArmSizeVC, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 2); FlexGridSizer128->Add(FlexGridSizer1, 1, wxALL|wxEXPAND, 5); TextCtrl65 = new wxTextCtrl(this, IDD_TEXTCTRL_Pinwheel_ArmSize, _("100"), wxDefaultPosition, wxDLG_UNIT(this,wxSize(20,-1)), wxTE_CENTRE, wxDefaultValidator, _T("IDD_TEXTCTRL_Pinwheel_ArmSize")); TextCtrl65->SetMaxLength(3); FlexGridSizer128->Add(TextCtrl65, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 2); BitmapButton_Pinwheel_ArmSize = new wxBitmapButton(this, ID_BITMAPBUTTON16, padlock16x16_blue_xpm, wxDefaultPosition, wxSize(13,13), wxBU_AUTODRAW|wxNO_BORDER, wxDefaultValidator, _T("ID_BITMAPBUTTON16")); BitmapButton_Pinwheel_ArmSize->SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_ACTIVECAPTION)); FlexGridSizer128->Add(BitmapButton_Pinwheel_ArmSize, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 1); StaticText74 = new wxStaticText(this, ID_STATICTEXT76, _("Twist"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT76")); FlexGridSizer128->Add(StaticText74, 1, wxALL|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5); FlexGridSizer2 = new wxFlexGridSizer(0, 2, 0, 0); FlexGridSizer2->AddGrowableCol(0); Slider_Pinwheel_Twist = new wxSlider(this, ID_SLIDER_Pinwheel_Twist, 0, -360, 360, wxDefaultPosition, wxSize(80,20), 0, wxDefaultValidator, _T("ID_SLIDER_Pinwheel_Twist")); FlexGridSizer2->Add(Slider_Pinwheel_Twist, 1, wxALL|wxEXPAND, 2); BitmapButton_Pinwheel_TwistVC = new ValueCurveButton(this, ID_VALUECURVE_Pinwheel_Twist, valuecurvenotselected_24, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|wxNO_BORDER, wxDefaultValidator, _T("ID_VALUECURVE_Pinwheel_Twist")); FlexGridSizer2->Add(BitmapButton_Pinwheel_TwistVC, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 2); FlexGridSizer128->Add(FlexGridSizer2, 1, wxALL|wxEXPAND, 5); TextCtrl66 = new wxTextCtrl(this, IDD_TEXTCTRL_Pinwheel_Twist, _("0"), wxDefaultPosition, wxDLG_UNIT(this,wxSize(20,-1)), wxTE_CENTRE, wxDefaultValidator, _T("IDD_TEXTCTRL_Pinwheel_Twist")); TextCtrl66->SetMaxLength(4); FlexGridSizer128->Add(TextCtrl66, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 2); BitmapButton_PinwheelTwist = new wxBitmapButton(this, ID_BITMAPBUTTON12, padlock16x16_blue_xpm, wxDefaultPosition, wxSize(13,13), wxBU_AUTODRAW|wxNO_BORDER, wxDefaultValidator, _T("ID_BITMAPBUTTON12")); BitmapButton_PinwheelTwist->SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_ACTIVECAPTION)); FlexGridSizer128->Add(BitmapButton_PinwheelTwist, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 0); StaticText75 = new wxStaticText(this, ID_STATICTEXT77, _("Thick"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT77")); FlexGridSizer128->Add(StaticText75, 1, wxALL|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5); FlexGridSizer3 = new wxFlexGridSizer(0, 2, 0, 0); FlexGridSizer3->AddGrowableCol(0); Slider_Pinwheel_Thickness = new wxSlider(this, ID_SLIDER_Pinwheel_Thickness, 0, 0, 100, wxDefaultPosition, wxSize(80,20), 0, wxDefaultValidator, _T("ID_SLIDER_Pinwheel_Thickness")); FlexGridSizer3->Add(Slider_Pinwheel_Thickness, 1, wxALL|wxEXPAND, 2); BitmapButton_Pinwheel_ThicknessVC = new ValueCurveButton(this, ID_VALUECURVE_Pinwheel_Thickness, valuecurvenotselected_24, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|wxNO_BORDER, wxDefaultValidator, _T("ID_VALUECURVE_Pinwheel_Thickness")); FlexGridSizer3->Add(BitmapButton_Pinwheel_ThicknessVC, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 2); FlexGridSizer128->Add(FlexGridSizer3, 1, wxALL|wxEXPAND, 5); TextCtrl67 = new wxTextCtrl(this, IDD_TEXTCTRL_Pinwheel_Thickness, _("0"), wxDefaultPosition, wxDLG_UNIT(this,wxSize(20,-1)), wxTE_CENTRE, wxDefaultValidator, _T("IDD_TEXTCTRL_Pinwheel_Thickness")); TextCtrl67->SetMaxLength(3); FlexGridSizer128->Add(TextCtrl67, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 2); BitmapButton_PinwheelThickness = new wxBitmapButton(this, ID_BITMAPBUTTON18, padlock16x16_blue_xpm, wxDefaultPosition, wxSize(13,13), wxBU_AUTODRAW|wxNO_BORDER, wxDefaultValidator, _T("ID_BITMAPBUTTON18")); BitmapButton_PinwheelThickness->SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_ACTIVECAPTION)); FlexGridSizer128->Add(BitmapButton_PinwheelThickness, 1, wxALL|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5); StaticText184 = new wxStaticText(this, wxID_ANY, _("Speed"), wxDefaultPosition, wxDefaultSize, 0, _T("wxID_ANY")); FlexGridSizer128->Add(StaticText184, 1, wxALL|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5); FlexGridSizer4 = new wxFlexGridSizer(0, 2, 0, 0); FlexGridSizer4->AddGrowableCol(0); Slider_Pinwheel_Speed = new wxSlider(this, ID_SLIDER_Pinwheel_Speed, 10, 0, 50, wxDefaultPosition, wxSize(80,20), 0, wxDefaultValidator, _T("ID_SLIDER_Pinwheel_Speed")); FlexGridSizer4->Add(Slider_Pinwheel_Speed, 1, wxALL|wxEXPAND, 2); BitmapButton_Pinwheel_SpeedVC = new ValueCurveButton(this, ID_VALUECURVE_Pinwheel_Speed, valuecurvenotselected_24, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|wxNO_BORDER, wxDefaultValidator, _T("ID_VALUECURVE_Pinwheel_Speed")); FlexGridSizer4->Add(BitmapButton_Pinwheel_SpeedVC, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 2); FlexGridSizer128->Add(FlexGridSizer4, 1, wxALL|wxEXPAND, 5); TextCtrl70 = new wxTextCtrl(this, IDD_TEXTCTRL_Pinwheel_Speed, _("10"), wxDefaultPosition, wxDLG_UNIT(this,wxSize(20,-1)), wxTE_CENTRE, wxDefaultValidator, _T("IDD_TEXTCTRL_Pinwheel_Speed")); TextCtrl70->SetMaxLength(3); FlexGridSizer128->Add(TextCtrl70, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 2); BitmapButton7 = new wxBitmapButton(this, ID_BITMAPBUTTON26, padlock16x16_blue_xpm, wxDefaultPosition, wxSize(13,13), wxBU_AUTODRAW|wxNO_BORDER, wxDefaultValidator, _T("ID_BITMAPBUTTON26")); BitmapButton7->SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_ACTIVECAPTION)); FlexGridSizer128->Add(BitmapButton7, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); FlexGridSizer55->Add(FlexGridSizer128, 1, wxALL|wxEXPAND, 0); BoxSizer1 = new wxBoxSizer(wxHORIZONTAL); FlexGridSizer59 = new wxFlexGridSizer(0, 4, 0, 0); StaticText76 = new wxStaticText(this, ID_STATICTEXT78, _("Rotation"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT78")); FlexGridSizer59->Add(StaticText76, 1, wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 5); CheckBox_Pinwheel_Rotation = new wxCheckBox(this, ID_CHECKBOX_Pinwheel_Rotation, _("CCW"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_CHECKBOX_Pinwheel_Rotation")); CheckBox_Pinwheel_Rotation->SetValue(true); FlexGridSizer59->Add(CheckBox_Pinwheel_Rotation, 1, wxALL|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5); BitmapButton_PinwheelRotation = new wxBitmapButton(this, ID_BITMAPBUTTON19, padlock16x16_blue_xpm, wxDefaultPosition, wxSize(13,13), wxBU_AUTODRAW|wxNO_BORDER, wxDefaultValidator, _T("ID_BITMAPBUTTON19")); BitmapButton_PinwheelRotation->SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_ACTIVECAPTION)); FlexGridSizer59->Add(BitmapButton_PinwheelRotation, 1, wxALL|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5); BoxSizer1->Add(FlexGridSizer59, 1, wxALL|wxALIGN_CENTER_VERTICAL, 2); FlexGridSizer61 = new wxFlexGridSizer(0, 3, 0, 0); StaticText77 = new wxStaticText(this, ID_STATICTEXT82, _("3D"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT82")); FlexGridSizer61->Add(StaticText77, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); Choice_Pinwheel_3D = new wxChoice(this, ID_CHOICE_Pinwheel_3D, wxDefaultPosition, wxDefaultSize, 0, 0, 0, wxDefaultValidator, _T("ID_CHOICE_Pinwheel_3D")); Choice_Pinwheel_3D->SetSelection( Choice_Pinwheel_3D->Append(_("None")) ); Choice_Pinwheel_3D->Append(_("3D")); Choice_Pinwheel_3D->Append(_("3D Inverted")); FlexGridSizer61->Add(Choice_Pinwheel_3D, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); BitmapButton_Pinwheel3D = new wxBitmapButton(this, ID_BITMAPBUTTON_Pinwheel3D, padlock16x16_blue_xpm, wxDefaultPosition, wxSize(13,13), wxBU_AUTODRAW|wxNO_BORDER, wxDefaultValidator, _T("ID_BITMAPBUTTON_Pinwheel3D")); BitmapButton_Pinwheel3D->SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_ACTIVECAPTION)); FlexGridSizer61->Add(BitmapButton_Pinwheel3D, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); BoxSizer1->Add(FlexGridSizer61, 1, wxALL|wxALIGN_CENTER_VERTICAL, 2); FlexGridSizer55->Add(BoxSizer1, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 0); FlexGridSizer63 = new wxFlexGridSizer(0, 2, 0, 0); FlexGridSizer63->AddGrowableCol(0); FlexGridSizer63->AddGrowableRow(0); FlexGridSizer62 = new wxFlexGridSizer(0, 2, 0, 0); FlexGridSizer62->AddGrowableCol(1); StaticText82 = new wxStaticText(this, ID_STATICTEXT85, _("X-axis Center"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT85")); FlexGridSizer62->Add(StaticText82, 1, wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 5); Slider_PinwheelXC = new wxSlider(this, ID_SLIDER_PinwheelXC, 0, -100, 100, wxDefaultPosition, wxSize(80,20), 0, wxDefaultValidator, _T("ID_SLIDER_PinwheelXC")); FlexGridSizer62->Add(Slider_PinwheelXC, 1, wxALL|wxEXPAND, 5); FlexGridSizer62->Add(-1,-1,1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); FlexGridSizer5 = new wxFlexGridSizer(0, 2, 0, 0); BitmapButton_PinwheelXCVC = new ValueCurveButton(this, ID_VALUECURVE_PinwheelXC, valuecurvenotselected_24, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|wxNO_BORDER, wxDefaultValidator, _T("ID_VALUECURVE_PinwheelXC")); FlexGridSizer5->Add(BitmapButton_PinwheelXCVC, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 2); TextCtrl68 = new wxTextCtrl(this, IDD_TEXTCTRL_PinwheelXC, _("0"), wxDefaultPosition, wxDLG_UNIT(this,wxSize(20,-1)), wxTE_CENTRE, wxDefaultValidator, _T("IDD_TEXTCTRL_PinwheelXC")); TextCtrl68->SetMaxLength(4); FlexGridSizer5->Add(TextCtrl68, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); FlexGridSizer62->Add(FlexGridSizer5, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); FlexGridSizer63->Add(FlexGridSizer62, 1, wxALL|wxEXPAND, 0); FlexGridSizer68 = new wxFlexGridSizer(0, 3, 0, 0); FlexGridSizer68->AddGrowableRow(0); FlexGridSizer64 = new wxFlexGridSizer(0, 1, 0, 0); StaticText81 = new wxStaticText(this, ID_STATICTEXT83, _("Y-axis center"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT83")); FlexGridSizer64->Add(StaticText81, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); FlexGridSizer6 = new wxFlexGridSizer(0, 2, 0, 0); BitmapButton_PinwheelYCVC = new ValueCurveButton(this, ID_VALUECURVE_PinwheelYC, valuecurvenotselected_24, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|wxNO_BORDER, wxDefaultValidator, _T("ID_VALUECURVE_PinwheelYC")); FlexGridSizer6->Add(BitmapButton_PinwheelYCVC, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 2); TextCtrl69 = new wxTextCtrl(this, IDD_TEXTCTRL_PinwheelYC, _("0"), wxDefaultPosition, wxDLG_UNIT(this,wxSize(20,-1)), wxTE_CENTRE, wxDefaultValidator, _T("IDD_TEXTCTRL_PinwheelYC")); TextCtrl69->SetMaxLength(4); FlexGridSizer6->Add(TextCtrl69, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); FlexGridSizer64->Add(FlexGridSizer6, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); FlexGridSizer68->Add(FlexGridSizer64, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 1); Slider_PinwheelYC = new wxSlider(this, ID_SLIDER_PinwheelYC, 0, -100, 100, wxDefaultPosition, wxSize(20,80), wxSL_VERTICAL|wxSL_INVERSE, wxDefaultValidator, _T("ID_SLIDER_PinwheelYC")); FlexGridSizer68->Add(Slider_PinwheelYC, 1, wxALL|wxEXPAND, 5); FlexGridSizer63->Add(FlexGridSizer68, 1, wxALL|wxEXPAND, 0); FlexGridSizer55->Add(FlexGridSizer63, 1, wxALL|wxEXPAND, 0); SetSizer(FlexGridSizer55); FlexGridSizer55->Fit(this); FlexGridSizer55->SetSizeHints(this); Connect(ID_SLIDER_Pinwheel_Arms,wxEVT_COMMAND_SLIDER_UPDATED,(wxObjectEventFunction)&PinwheelPanel::UpdateLinkedTextCtrl); Connect(IDD_TEXTCTRL_Pinwheel_Arms,wxEVT_COMMAND_TEXT_UPDATED,(wxObjectEventFunction)&PinwheelPanel::UpdateLinkedSlider); Connect(ID_BITMAPBUTTON11,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&PinwheelPanel::OnLockButtonClick); Connect(ID_SLIDER_Pinwheel_ArmSize,wxEVT_COMMAND_SLIDER_UPDATED,(wxObjectEventFunction)&PinwheelPanel::UpdateLinkedTextCtrlVC); Connect(ID_VALUECURVE_Pinwheel_ArmSize,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&PinwheelPanel::OnVCButtonClick); Connect(IDD_TEXTCTRL_Pinwheel_ArmSize,wxEVT_COMMAND_TEXT_UPDATED,(wxObjectEventFunction)&PinwheelPanel::UpdateLinkedSlider); Connect(ID_BITMAPBUTTON16,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&PinwheelPanel::OnLockButtonClick); Connect(ID_SLIDER_Pinwheel_Twist,wxEVT_COMMAND_SLIDER_UPDATED,(wxObjectEventFunction)&PinwheelPanel::UpdateLinkedTextCtrlVC); Connect(ID_VALUECURVE_Pinwheel_Twist,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&PinwheelPanel::OnVCButtonClick); Connect(IDD_TEXTCTRL_Pinwheel_Twist,wxEVT_COMMAND_TEXT_UPDATED,(wxObjectEventFunction)&PinwheelPanel::UpdateLinkedSlider); Connect(ID_BITMAPBUTTON12,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&PinwheelPanel::OnLockButtonClick); Connect(ID_SLIDER_Pinwheel_Thickness,wxEVT_COMMAND_SLIDER_UPDATED,(wxObjectEventFunction)&PinwheelPanel::UpdateLinkedTextCtrlVC); Connect(ID_VALUECURVE_Pinwheel_Thickness,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&PinwheelPanel::OnVCButtonClick); Connect(IDD_TEXTCTRL_Pinwheel_Thickness,wxEVT_COMMAND_TEXT_UPDATED,(wxObjectEventFunction)&PinwheelPanel::UpdateLinkedSlider); Connect(ID_BITMAPBUTTON18,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&PinwheelPanel::OnLockButtonClick); Connect(ID_SLIDER_Pinwheel_Speed,wxEVT_COMMAND_SLIDER_UPDATED,(wxObjectEventFunction)&PinwheelPanel::UpdateLinkedTextCtrlVC); Connect(ID_VALUECURVE_Pinwheel_Speed,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&PinwheelPanel::OnVCButtonClick); Connect(IDD_TEXTCTRL_Pinwheel_Speed,wxEVT_COMMAND_TEXT_UPDATED,(wxObjectEventFunction)&PinwheelPanel::UpdateLinkedSlider); Connect(ID_BITMAPBUTTON26,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&PinwheelPanel::OnLockButtonClick); Connect(ID_BITMAPBUTTON19,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&PinwheelPanel::OnLockButtonClick); Connect(ID_BITMAPBUTTON_Pinwheel3D,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&PinwheelPanel::OnLockButtonClick); Connect(ID_SLIDER_PinwheelXC,wxEVT_COMMAND_SLIDER_UPDATED,(wxObjectEventFunction)&PinwheelPanel::UpdateLinkedTextCtrlVC); Connect(ID_VALUECURVE_PinwheelXC,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&PinwheelPanel::OnVCButtonClick); Connect(IDD_TEXTCTRL_PinwheelXC,wxEVT_COMMAND_TEXT_UPDATED,(wxObjectEventFunction)&PinwheelPanel::UpdateLinkedSlider); Connect(ID_VALUECURVE_PinwheelYC,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&PinwheelPanel::OnVCButtonClick); Connect(IDD_TEXTCTRL_PinwheelYC,wxEVT_COMMAND_TEXT_UPDATED,(wxObjectEventFunction)&PinwheelPanel::UpdateLinkedSlider); Connect(ID_SLIDER_PinwheelYC,wxEVT_COMMAND_SLIDER_UPDATED,(wxObjectEventFunction)&PinwheelPanel::UpdateLinkedTextCtrlVC); //*) SetName("ID_PANEL_PINWHEEL"); Connect(wxID_ANY, EVT_VC_CHANGED, (wxObjectEventFunction)&PinwheelPanel::OnVCChanged, 0, this); BitmapButton_PinwheelXCVC->GetValue()->SetLimits(-100, 100); BitmapButton_PinwheelYCVC->GetValue()->SetLimits(-100, 100); BitmapButton_Pinwheel_ArmSizeVC->GetValue()->SetLimits(0, 400); BitmapButton_Pinwheel_SpeedVC->GetValue()->SetLimits(0, 50); BitmapButton_Pinwheel_ThicknessVC->GetValue()->SetLimits(0, 100); BitmapButton_Pinwheel_TwistVC->GetValue()->SetLimits(-360, 360); }
bool wxGenericAboutDialog::Create(const wxAboutDialogInfo& info, wxWindow* parent) { if ( !wxDialog::Create(parent, wxID_ANY, wxString::Format(_("About %s"), info.GetName()), wxDefaultPosition, wxDefaultSize, wxRESIZE_BORDER|wxDEFAULT_DIALOG_STYLE) ) return false; m_sizerText = new wxBoxSizer(wxVERTICAL); wxString nameAndVersion = info.GetName(); if ( info.HasVersion() ) nameAndVersion << wxT(' ') << info.GetVersion(); wxStaticText *label = new wxStaticText(this, wxID_ANY, nameAndVersion); wxFont fontBig(*wxNORMAL_FONT); fontBig.SetPointSize(fontBig.GetPointSize() + 2); fontBig.SetWeight(wxFONTWEIGHT_BOLD); label->SetFont(fontBig); m_sizerText->Add(label, wxSizerFlags().Centre().Border()); m_sizerText->AddSpacer(5); AddText(info.GetCopyrightToDisplay()); AddText(info.GetDescription()); if ( info.HasWebSite() ) { #if wxUSE_HYPERLINKCTRL AddControl(new wxHyperlinkCtrl(this, wxID_ANY, info.GetWebSiteDescription(), info.GetWebSiteURL())); #else AddText(info.GetWebSiteURL()); #endif // wxUSE_HYPERLINKCTRL/!wxUSE_HYPERLINKCTRL } #if wxUSE_COLLPANE if ( info.HasLicence() ) AddCollapsiblePane(_("License"), info.GetLicence()); if ( info.HasDevelopers() ) AddCollapsiblePane(_("Developers"), AllAsString(info.GetDevelopers())); if ( info.HasDocWriters() ) AddCollapsiblePane(_("Documentation writers"), AllAsString(info.GetDocWriters())); if ( info.HasArtists() ) AddCollapsiblePane(_("Artists"), AllAsString(info.GetArtists())); if ( info.HasTranslators() ) AddCollapsiblePane(_("Translators"), AllAsString(info.GetTranslators())); #endif // wxUSE_COLLPANE DoAddCustomControls(); wxSizer *sizerIconAndText = new wxBoxSizer(wxHORIZONTAL); #if wxUSE_STATBMP wxIcon icon = info.GetIcon(); if ( icon.IsOk() ) { sizerIconAndText->Add(new wxStaticBitmap(this, wxID_ANY, icon), wxSizerFlags().Border(wxRIGHT)); } #endif // wxUSE_STATBMP sizerIconAndText->Add(m_sizerText, wxSizerFlags(1).Expand()); wxSizer *sizerTop = new wxBoxSizer(wxVERTICAL); sizerTop->Add(sizerIconAndText, wxSizerFlags(1).Expand().Border()); // Mac typically doesn't use OK buttons just for dismissing dialogs. #if !defined(__WXMAC__) wxSizer *sizerBtns = CreateButtonSizer(wxOK); if ( sizerBtns ) { sizerTop->Add(sizerBtns, wxSizerFlags().Expand().Border()); } #endif SetSizerAndFit(sizerTop); CentreOnParent(); #if !wxUSE_MODAL_ABOUT_DIALOG Connect(wxEVT_CLOSE_WINDOW, wxCloseEventHandler(wxGenericAboutDialog::OnCloseWindow)); Connect(wxID_OK, wxEVT_BUTTON, wxCommandEventHandler(wxGenericAboutDialog::OnOK)); #endif // !wxUSE_MODAL_ABOUT_DIALOG return true; }
int CExchangeServer::Reconnect() { Disconnect(); Connect(); return 0; }
// frame constructor MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size) : wxFrame(NULL, wxID_ANY, title, pos, size) { SetIcon(wxICON(sample)); // init members m_nPush = 0; m_btnDynamic = NULL; // create a menu bar wxMenu *menuFile = new wxMenu; menuFile->Append(Event_About, wxT("&About\tCtrl-A"), wxT("Show about dialog")); menuFile->AppendSeparator(); menuFile->Append(Event_Quit, wxT("E&xit\tAlt-X"), wxT("Quit this program")); wxMenu *menuEvent = new wxMenu; #ifdef wxHAS_EVENT_BIND menuEvent->AppendCheckItem(Event_Bind, "&Bind\tCtrl-B", "Bind or unbind a dynamic event handler"); #endif // wxHAS_EVENT_BIND menuEvent->AppendCheckItem(Event_Connect, wxT("&Connect\tCtrl-C"), wxT("Connect or disconnect the dynamic event handler")); menuEvent->Append(Event_Dynamic, wxT("&Dynamic event\tCtrl-D"), wxT("Dynamic event sample - only works after Connect")); menuEvent->AppendSeparator(); menuEvent->Append(Event_Push, wxT("&Push event handler\tCtrl-P"), wxT("Push event handler for test event")); menuEvent->Append(Event_Pop, wxT("P&op event handler\tCtrl-O"), wxT("Pop event handler for test event")); menuEvent->Append(Event_Test, wxT("Test event\tCtrl-T"), wxT("Test event processed by pushed event handler")); menuEvent->AppendSeparator(); menuEvent->Append(Event_Custom, wxT("Fire c&ustom event\tCtrl-U"), wxT("Generate a custom event")); // now append the freshly created menu to the menu bar... wxMenuBar *menuBar = new wxMenuBar(); menuBar->Append(menuFile, wxT("&File")); menuBar->Append(menuEvent, wxT("&Event")); // ... and attach this menu bar to the frame SetMenuBar(menuBar); #if wxUSE_STATUSBAR CreateStatusBar(3); SetStatusText(wxT("Welcome to wxWidgets event sample")); SetStatusText(wxT("Dynamic: off"), Status_Dynamic); SetStatusText(wxT("Push count: 0"), Status_Push); #endif // wxUSE_STATUSBAR wxPanel * const panel = new wxPanel(this); wxSizer * const mainSizer = new wxBoxSizer(wxVERTICAL); wxSizer * const sizer = new wxBoxSizer(wxHORIZONTAL); const wxSizerFlags centreY(wxSizerFlags().Centre().Border()); sizer->Add(new wxStaticText(panel, wxID_ANY, "This button will only work if its handler is dynamically connected"), centreY); m_btnDynamic = new wxButton(panel, Event_Dynamic, "&Dynamic button"); sizer->Add(m_btnDynamic, centreY); mainSizer->Add(sizer, 1, wxEXPAND); mainSizer->Add(new wxStaticLine(panel), 0, wxEXPAND); mainSizer->Add(new wxStaticLine(panel), 0, wxEXPAND); m_testBtn = new MyEvtTestButton(panel, "Test Event Handlers Execution Order"); // After being created, an instance of MyEvtTestButton already has its own // event handlers (see class definition); // Add a dynamic handler for this button event in the parent frame Connect(m_testBtn->GetId(), wxEVT_BUTTON, wxCommandEventHandler(MyFrame::OnClickDynamicHandlerFrame)); // Bind a method of this frame (notice "this" argument!) to the button // itself m_testBtn->Connect(wxEVT_BUTTON, wxCommandEventHandler(MyFrame::OnClickDynamicHandlerButton), NULL, this); mainSizer->Add(m_testBtn); panel->SetSizer(mainSizer); }
ApplicationIcons::ApplicationIcons(wxWizard* parent, wxWizardPageSimple* prev) { //(*Initialize(ApplicationIcons) wxBoxSizer* BoxSizer4; wxBoxSizer* BoxSizer6; wxBoxSizer* BoxSizer19; wxBoxSizer* BoxSizer5; wxBoxSizer* BoxSizer10; wxBoxSizer* BoxSizer7; wxBoxSizer* BoxSizer8; wxStaticText* StaticText2; wxBoxSizer* BoxSizer13; wxStaticBitmap* StaticBitmap1; wxStaticText* StaticText8; wxStaticText* StaticText1; wxBoxSizer* BoxSizer2; wxStaticText* StaticText3; wxBoxSizer* BoxSizer11; wxBoxSizer* BoxSizer12; wxBoxSizer* BoxSizer14; wxStaticText* StaticText7; wxBoxSizer* BoxSizer1; wxBoxSizer* BoxSizer9; wxBoxSizer* BoxSizer3; Create(parent, prev); BoxSizer1 = new wxBoxSizer(wxVERTICAL); Panel1 = new wxPanel(this, ID_PANEL1, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL, _T("ID_PANEL1")); Panel1->SetBackgroundColour( wxColour( 255, 255, 255)); BoxSizer4 = new wxBoxSizer(wxHORIZONTAL); BoxSizer5 = new wxBoxSizer(wxVERTICAL); BoxSizer6 = new wxBoxSizer(wxHORIZONTAL); BoxSizer6->Add(35,20,0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); StaticText2 = new wxStaticText(Panel1, ID_STATICTEXT2, _("Application Icons"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT2")); wxFont StaticText2Font(10,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,wxEmptyString,wxFONTENCODING_DEFAULT); StaticText2->SetFont(StaticText2Font); BoxSizer6->Add(StaticText2, 1, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); BoxSizer5->Add(BoxSizer6, 0, wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); BoxSizer7 = new wxBoxSizer(wxHORIZONTAL); BoxSizer7->Add(35,20,0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); StaticText1 = new wxStaticText(Panel1, ID_STATICTEXT1, _(" Please specify which icons should be created for your application."), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT1")); BoxSizer7->Add(StaticText1, 1, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); BoxSizer5->Add(BoxSizer7, 0, wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); BoxSizer4->Add(BoxSizer5, 0, wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); BoxSizer4->Add(-1,-1,1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); StaticBitmap1 = new wxStaticBitmap(Panel1, wxID_ANY, wxBitmap(LinksOben_xpm), wxDefaultPosition, wxDefaultSize, 0, _T("wxID_ANY")); BoxSizer4->Add(StaticBitmap1, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); Panel1->SetSizer(BoxSizer4); BoxSizer4->Fit(Panel1); BoxSizer4->SetSizeHints(Panel1); BoxSizer1->Add(Panel1, 0, wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); StaticLine1 = new wxStaticLine(this, ID_STATICLINE1, wxDefaultPosition, wxSize(10,-1), wxLI_HORIZONTAL, _T("ID_STATICLINE1")); BoxSizer1->Add(StaticLine1, 0, wxBOTTOM|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); BoxSizer2 = new wxBoxSizer(wxHORIZONTAL); BoxSizer2->Add(75,20,0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); StaticText3 = new wxStaticText(this, ID_STATICTEXT3, _("Application Start Menu folder name:"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT3")); wxFont StaticText3Font(8,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,wxEmptyString,wxFONTENCODING_DEFAULT); StaticText3->SetFont(StaticText3Font); BoxSizer2->Add(StaticText3, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); BoxSizer2->Add(-1,-1,1, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); BoxSizer1->Add(BoxSizer2, 0, wxLEFT|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); BoxSizer11 = new wxBoxSizer(wxHORIZONTAL); BoxSizer11->Add(75,20,0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); txtMenuFolder = new wxTextCtrl(this, ID_TEXTCTRL2, wxEmptyString, wxDefaultPosition, wxSize(221,21), 0, wxDefaultValidator, _T("ID_TEXTCTRL2")); BoxSizer11->Add(txtMenuFolder, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); BoxSizer11->Add(-1,-1,1, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); BoxSizer1->Add(BoxSizer11, 0, wxTOP|wxLEFT|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); BoxSizer10 = new wxBoxSizer(wxHORIZONTAL); BoxSizer10->Add(75,20,0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); cbChangeStartMenu = new wxCheckBox(this, ID_CHECKBOX4, _("Allow user to change the Start Menu folder name"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_CHECKBOX4")); cbChangeStartMenu->SetValue(true); BoxSizer10->Add(cbChangeStartMenu, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); BoxSizer10->Add(-1,-1,1, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); BoxSizer1->Add(BoxSizer10, 0, wxTOP|wxLEFT|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); BoxSizer8 = new wxBoxSizer(wxHORIZONTAL); BoxSizer8->Add(75,20,0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); cbDisableStartMenu = new wxCheckBox(this, ID_CHECKBOX3, _("Allow user to disable Start Menu folder creation"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_CHECKBOX3")); cbDisableStartMenu->SetValue(false); BoxSizer8->Add(cbDisableStartMenu, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); BoxSizer8->Add(-1,-1,1, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); BoxSizer1->Add(BoxSizer8, 0, wxTOP|wxLEFT|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); BoxSizer3 = new wxBoxSizer(wxHORIZONTAL); BoxSizer3->Add(75,20,0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); cbInternetShort = new wxCheckBox(this, ID_CHECKBOX1, _("Create an Internet shortcut in the Start Menu folder"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_CHECKBOX1")); cbInternetShort->SetValue(false); BoxSizer3->Add(cbInternetShort, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); BoxSizer3->Add(-1,-1,1, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); BoxSizer1->Add(BoxSizer3, 0, wxTOP|wxLEFT|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); BoxSizer9 = new wxBoxSizer(wxHORIZONTAL); BoxSizer9->Add(75,20,0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); cbUninstallShortCut = new wxCheckBox(this, ID_CHECKBOX2, _("Create an Uninstall icon in the Start Menu folder"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_CHECKBOX2")); cbUninstallShortCut->SetValue(false); BoxSizer9->Add(cbUninstallShortCut, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); BoxSizer9->Add(-1,-1,1, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); BoxSizer1->Add(BoxSizer9, 0, wxTOP|wxLEFT|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); BoxSizer12 = new wxBoxSizer(wxHORIZONTAL); BoxSizer12->Add(75,20,0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); text2 = new wxStaticText(this, ID_STATICTEXT4, _("Other main executable icons:"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT4")); BoxSizer12->Add(text2, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); BoxSizer12->Add(-1,-1,1, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); BoxSizer1->Add(BoxSizer12, 0, wxTOP|wxLEFT|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); BoxSizer14 = new wxBoxSizer(wxHORIZONTAL); BoxSizer14->Add(75,20,0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); cbDesktopIcon = new wxCheckBox(this, ID_CHECKBOX6, _("Allow user to create a desktop icon"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_CHECKBOX6")); cbDesktopIcon->SetValue(true); BoxSizer14->Add(cbDesktopIcon, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); BoxSizer14->Add(-1,-1,1, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); BoxSizer1->Add(BoxSizer14, 0, wxTOP|wxLEFT|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); BoxSizer13 = new wxBoxSizer(wxHORIZONTAL); BoxSizer13->Add(75,20,0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); cbQuickLunchShortCut = new wxCheckBox(this, ID_CHECKBOX5, _("Allow user to create a Quick Launch icon"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_CHECKBOX5")); cbQuickLunchShortCut->SetValue(false); BoxSizer13->Add(cbQuickLunchShortCut, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); BoxSizer13->Add(-1,-1,1, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); BoxSizer1->Add(BoxSizer13, 0, wxTOP|wxLEFT|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); BoxSizer19 = new wxBoxSizer(wxHORIZONTAL); BoxSizer19->Add(75,20,0, wxTOP|wxBOTTOM|wxRIGHT|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); StaticText7 = new wxStaticText(this, ID_STATICTEXT7, _("bold"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT7")); StaticText7->Disable(); wxFont StaticText7Font(8,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,_T("Arial"),wxFONTENCODING_DEFAULT); StaticText7->SetFont(StaticText7Font); BoxSizer19->Add(StaticText7, 0, wxLEFT|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); StaticText8 = new wxStaticText(this, ID_STATICTEXT8, _("= required"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT8")); StaticText8->Disable(); BoxSizer19->Add(StaticText8, 1, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); BoxSizer1->Add(BoxSizer19, 0, wxLEFT|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); SetSizer(BoxSizer1); SetSizer(BoxSizer1); Layout(); Connect(ID_CHECKBOX4,wxEVT_COMMAND_CHECKBOX_CLICKED,(wxObjectEventFunction)&ApplicationIcons::OncbChangeStartMenuClick); //*) SetSize( wxSize(480,320)); }
CpicFrame::CpicFrame(wxFrame * parent, const char * buffer, int buffersize, int w, int h, char * title) :wxFrame(parent, - 1, "") { ptype=1; wxMemoryInputStream * mis = new wxMemoryInputStream(buffer, buffersize); image_jpg = new wxImage; image_jpg -> LoadFile( * mis, wxBITMAP_TYPE_ANY, - 1); imageXsize = image_jpg -> GetWidth(); imageYsize = image_jpg -> GetHeight(); imageXfsize = w; imageYfsize = h; imageXfpos = 0; imageYfpos = 0; mouseXpos = - 1; mouseYpos = - 1; if (imageXfsize == - 1) { imageXfsize = imageXsize; } else if(imageXfsize > (imageXsize)) { imageXfsize = imageXsize; } if (imageYfsize == - 1) { imageYfsize = imageYsize; } else if(imageYfsize > (imageYsize)) { imageYfsize = imageYsize; } sizer_root = new wxBoxSizer(wxVERTICAL); Xf = 0; Yf = 0; sb1x = NULL; sb1y = NULL; bitmap_jpg = new wxBitmap(image_jpg -> Scale(imageXsize, imageYsize)); if (bitmap_jpg) { if (imageXfsize != imageXsize) { Yf = 16; } if (imageYfsize != imageYsize) { Xf = 16; } if (imageXfsize != imageXsize) { sb1x = new wxScrollBar(this, - 1, wxDefaultPosition, wxSize( - 1, Yf), wxSB_HORIZONTAL); sb1x -> SetScrollbar(0, imageXfsize + Xf, imageXsize, imageXfsize + Xf); } if (imageYfsize != imageYsize) { sb1y = new wxScrollBar(this, - 1, wxDefaultPosition, wxSize(Xf, - 1), wxSB_VERTICAL); sb1y -> SetScrollbar(0, imageYfsize + Yf, imageYsize, imageYfsize + Yf); } //printf("Xf,Yf=%d,%d %d,%d != %d,%d\n", Xf, Yf, imageXsize, imageYsize, imageXfsize, imageYfsize); } SetClientSize(imageXfsize + Xf, imageYfsize + Yf); SetSizeHints(imageXfsize + Xf, imageYfsize + Yf, imageXsize + Xf, imageYsize + Yf); if (sb1x) { sizer_root -> Add(sb1x, 0, wxGROW | wxALIGN_BOTTOM, 0); } if (sb1y) { sizer_root -> Add(sb1y, 1, wxALIGN_RIGHT, 0); } SetSizer(sizer_root); if (strlen(title)) { SetTitle(title); } Connect( - 1, wxEVT_PAINT, WXOEF(wxPaintEventFunction) & CpicFrame::OnPaint); Connect( - 1, wxEVT_SCROLL_THUMBTRACK, WXOEF(wxScrollEventFunction) & CpicFrame::OnPaint); Connect( - 1, wxEVT_SCROLL_LINEUP, WXOEF(wxScrollEventFunction) & CpicFrame::OnPaint); Connect( - 1, wxEVT_SCROLL_LINEDOWN, WXOEF(wxScrollEventFunction) & CpicFrame::OnPaint); Connect( - 1, wxEVT_SCROLL_PAGEUP, WXOEF(wxScrollEventFunction) & CpicFrame::OnPaint); Connect( - 1, wxEVT_SCROLL_PAGEDOWN, WXOEF(wxScrollEventFunction) & CpicFrame::OnPaint); //Connect( - 1, wxEVT_MOTION, WXOEF(wxMouseEventFunction) & CpicFrame::OnMouseMotion); delete mis; }