Beispiel #1
2
SearchResultWindow::SearchResultWindow(wxWindow* parent) :
	wxPanel(parent, wxID_ANY)
{
	wxSizer* sizer = newd wxBoxSizer(wxVERTICAL);
	result_list = newd wxListBox(this, wxID_ANY, wxDefaultPosition, wxSize(200, 330), 0, nullptr, wxLB_SINGLE | wxLB_ALWAYS_SB | wxLB_SORT);
	sizer->Add(result_list, wxSizerFlags(1).Expand());
	SetSizerAndFit(sizer);
}
Beispiel #2
1
HousePalettePanel::HousePalettePanel(wxWindow* parent, wxWindowID id) :
	PalettePanel(parent, id),
	map(nullptr),
	do_resize_on_display(true),
	fix_size_timer(this, PALETTE_LAYOUT_FIX_TIMER)
{
	wxSizer* topsizer = newd wxBoxSizer(wxVERTICAL);
	wxSizer* tmpsizer;

	wxSizer* sidesizer = newd wxStaticBoxSizer(wxVERTICAL, this, wxT("Houses"));
	town_choice = newd wxChoice(this, PALETTE_HOUSE_TOWN_CHOICE, wxDefaultPosition, wxDefaultSize, (int)0, (const wxString*)nullptr);
	sidesizer->Add(town_choice, 0, wxEXPAND);

	house_list = newd wxListBox(this, PALETTE_HOUSE_LISTBOX, wxDefaultPosition, wxDefaultSize, 0, nullptr, wxLB_SINGLE | wxLB_NEEDED_SB | wxLB_SORT);
	sidesizer->Add(house_list, 1, wxEXPAND);

	tmpsizer = newd wxBoxSizer(wxHORIZONTAL);
	tmpsizer->Add(add_house_button = newd wxButton(this, PALETTE_HOUSE_ADD_HOUSE, wxT("Add"), wxDefaultPosition, wxSize(50, -1)), wxSizerFlags(1).Right());
	tmpsizer->Add(edit_house_button = newd wxButton(this, PALETTE_HOUSE_EDIT_HOUSE, wxT("Edit"), wxDefaultPosition, wxSize(50, -1)), wxSizerFlags(1).Right());
	tmpsizer->Add(remove_house_button = newd wxButton(this, PALETTE_HOUSE_REMOVE_HOUSE, wxT("Remove"), wxDefaultPosition, wxSize(70, -1)), wxSizerFlags(1).Right());
	sidesizer->Add(tmpsizer, wxSizerFlags(0).Right());

	topsizer->Add(sidesizer, 1, wxEXPAND);

	// Temple position
	sidesizer = newd wxStaticBoxSizer(newd wxStaticBox(this, wxID_ANY, wxT("Brushes"), wxDefaultPosition, wxSize(150, 200)), wxVERTICAL);

	//sidesizer->Add(180, 1, wxEXPAND);

	tmpsizer = newd wxBoxSizer(wxHORIZONTAL);
	house_brush_button = newd wxToggleButton(this, PALETTE_HOUSE_BRUSH_BUTTON, wxT("House tiles"));
	tmpsizer->Add(house_brush_button);
	sidesizer->Add(tmpsizer, wxSizerFlags(1).Center());

	tmpsizer = newd wxBoxSizer(wxHORIZONTAL);
	select_position_button = newd wxToggleButton(this, PALETTE_HOUSE_SELECT_EXIT_BUTTON, wxT("Select Exit"));
	tmpsizer->Add(select_position_button);
	sidesizer->Add(tmpsizer, wxSizerFlags(1).Center());

	topsizer->Add(sidesizer, 0, wxEXPAND);

	SetSizerAndFit(topsizer);
}
Beispiel #3
0
void BrushSizePanel::LoadAllContents() {
	if(loaded) return;

	wxSizer* size_sizer = newd wxBoxSizer(wxVERTICAL);;
	wxSizer* sub_sizer = newd wxBoxSizer(wxHORIZONTAL);
	RenderSize render_size;

	if(large_icons) {
		// 32x32
		render_size = RENDER_SIZE_32x32;
	} else {
		// 16x16
		render_size = RENDER_SIZE_16x16;
	}

	sub_sizer->Add(brushshapeSquareButton = newd DCButton(this, PALETTE_BRUSHSHAPE_SQUARE, wxDefaultPosition, DC_BTN_TOGGLE, render_size, EDITOR_SPRITE_BRUSH_SD_9x9));
		brushshapeSquareButton->SetToolTip(wxT("Square brush"));
	
	sub_sizer->Add(brushshapeCircleButton = newd DCButton(this, PALETTE_BRUSHSHAPE_CIRCLE, wxDefaultPosition, DC_BTN_TOGGLE, render_size, EDITOR_SPRITE_BRUSH_CD_9x9));
		brushshapeCircleButton->SetToolTip(wxT("Circle brush"));
	brushshapeSquareButton->SetValue(true);

	if(large_icons) {
		sub_sizer->AddSpacer(36);
	} else {
		sub_sizer->AddSpacer(18);
	}

	sub_sizer->Add(brushsize0Button = newd DCButton(this, PALETTE_TERRAIN_BRUSHSIZE_0, wxDefaultPosition, DC_BTN_TOGGLE, render_size, EDITOR_SPRITE_BRUSH_CD_1x1));
		brushsize0Button->SetToolTip(wxT("Brush size 1"));
		brushsize0Button->SetValue(true);

	sub_sizer->Add(brushsize1Button = newd DCButton(this, PALETTE_TERRAIN_BRUSHSIZE_1, wxDefaultPosition, DC_BTN_TOGGLE, render_size, EDITOR_SPRITE_BRUSH_SD_3x3));
		brushsize1Button->SetToolTip(wxT("Brush size 2"));

	if(large_icons) {
		size_sizer->Add(sub_sizer);
		sub_sizer = newd wxBoxSizer(wxHORIZONTAL);
	}

	sub_sizer->Add(brushsize2Button = newd DCButton(this, PALETTE_TERRAIN_BRUSHSIZE_2, wxDefaultPosition, DC_BTN_TOGGLE, render_size, EDITOR_SPRITE_BRUSH_SD_5x5));
		brushsize2Button->SetToolTip(wxT("Brush size 3"));

	sub_sizer->Add(brushsize4Button = newd DCButton(this, PALETTE_TERRAIN_BRUSHSIZE_4, wxDefaultPosition, DC_BTN_TOGGLE, render_size, EDITOR_SPRITE_BRUSH_SD_7x7));
		brushsize4Button->SetToolTip(wxT("Brush size 5"));

	sub_sizer->Add(brushsize6Button = newd DCButton(this, PALETTE_TERRAIN_BRUSHSIZE_6, wxDefaultPosition, DC_BTN_TOGGLE, render_size, EDITOR_SPRITE_BRUSH_SD_9x9));
		brushsize6Button->SetToolTip(wxT("Brush size 7"));

	sub_sizer->Add(brushsize8Button = newd DCButton(this, PALETTE_TERRAIN_BRUSHSIZE_8, wxDefaultPosition, DC_BTN_TOGGLE, render_size, EDITOR_SPRITE_BRUSH_SD_15x15));
	brushsize8Button->SetToolTip(wxT("Brush size 9"));
	
	sub_sizer->Add(brushsize11Button = newd DCButton(this, PALETTE_TERRAIN_BRUSHSIZE_11, wxDefaultPosition, DC_BTN_TOGGLE, render_size, EDITOR_SPRITE_BRUSH_SD_19x19));
		brushsize11Button->SetToolTip(wxT("Brush size 12"));

	size_sizer->Add(sub_sizer);
	SetSizerAndFit(size_sizer);

	loaded = true;
}
Beispiel #4
0
ServerParamDlg::ServerParamDlg(wxWindow* pParent) : wxDialog(pParent, wxID_ANY, wxString(wxT("Server param Config")), wxDefaultPosition, wxSize(800, 600), wxDEFAULT_DIALOG_STYLE|wxMINIMIZE_BOX|wxMAXIMIZE_BOX|wxRESIZE_BORDER)
{
	wxBoxSizer* pSizer2 = ZION_NEW wxBoxSizer(wxHORIZONTAL);
	pSizer2->AddStretchSpacer();
	pSizer2->Add(ZION_NEW wxButton(this, ID_NEW_LINE, wxT("New")), 0, wxALIGN_RIGHT | wxALL, 5);
	pSizer2->Add(ZION_NEW wxButton(this, ID_DELETE_LINE, wxT("Delete")), 0, wxALIGN_RIGHT | wxALL, 5);

	pSizer2->Add(ZION_NEW wxButton(this, wxID_OK, wxT("Save")), 0, wxALIGN_RIGHT | wxALL, 5);
	pSizer2->Add(ZION_NEW wxButton(this, wxID_CANCEL, wxT("Cancel")), 0, wxALIGN_RIGHT | wxALL, 5);

	wxBoxSizer* pSizer1 = ZION_NEW wxBoxSizer(wxVERTICAL);
	m_pPropGrid = ZION_NEW wxPropertyGrid(this, ID_PROPERTY_GRID, wxDefaultPosition, wxDefaultSize, 
            wxPG_AUTO_SORT | wxPG_SPLITTER_AUTO_CENTER | wxPG_DEFAULT_STYLE );
	
	Zion::Map<Zion::String, Zion::String> params = Zion::CClientApp::GetDefault()->GetParams();
	Zion::Map<Zion::String, Zion::String>::iterator it = params.begin();

	for(int i = 0; it != params.end(); ++it, ++i)
	{
		wxPGProperty* propGrid = ZION_NEW wxStringProperty(wxString::FromUTF8(it->first.c_str()), wxPG_LABEL, wxString::FromUTF8(it->second.c_str()));
		m_pPropGrid->Append(propGrid);
	}	
	
	pSizer1->Add(m_pPropGrid, 1, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5);
	pSizer1->Add(pSizer2, 0, wxGROW|wxALIGN_BOTTOM);
	SetSizer(pSizer1);
}
Beispiel #5
0
void ModelPanel::createWxCtrls()
{
	wxBoxSizer* boxSizer1 = New wxBoxSizer(wxVERTICAL);

	// listCtrl
	mTreePanel = New wxPanel(this, -1);
	mTreePanel->SetMinSize(wxSize(200, 300));

	wxBoxSizer* boxSizer2 = New wxBoxSizer(wxVERTICAL);

	mTreeCtrl = New ModelListTree(mTreePanel, ID_MODELLIST_TREE, wxDefaultPosition, wxDefaultSize, 
		wxTR_HAS_BUTTONS | wxTR_SINGLE | wxTR_NO_LINES | wxTR_HIDE_ROOT);

	mTreeCtrl->SetMinSize(wxSize(180, 260));
	mTreeCtrl->AssignImageList(mIconList);

	boxSizer2->Add(mTreeCtrl, 0, wxALL, 5);

	mTreePanel->SetSizer(boxSizer2);
	mTreePanel->Layout();
	mTreePanel->Fit();

	boxSizer1->Add(mTreePanel, 0, wxALL, 5);

	// inspector
	mInspectorPanel = New ModelInspectorPanel(this, -1);
	mInspectorPanel->SetMinSize(wxSize(200, 300));
	mTreeCtrl->AttachInspectorPanel(mInspectorPanel);

	boxSizer1->Add(mInspectorPanel, 0, wxALL, 5);

	this->SetSizer(boxSizer1);
	this->Layout();
	this->Fit();
}
//==============================================================================
browsers::GDSbrowser::GDSbrowser(wxWindow *parent, wxWindowID id, 
                        const wxPoint& pos , 
                        const wxSize& size ,
                        long style ):wxPanel(parent, id, pos, size, style)
{
   wxBoxSizer *thesizer = DEBUG_NEW wxBoxSizer( wxVERTICAL );
      
   wxBoxSizer *sizer1 = DEBUG_NEW wxBoxSizer( wxHORIZONTAL );
   _hierButton = DEBUG_NEW wxButton( this, BT_CELLS_HIER2, wxT("Hier") );
   //Set bold font for _hierButton
   wxFont font = _hierButton->GetFont();
   font.SetWeight(wxFONTWEIGHT_BOLD);
   _hierButton->SetFont(font);

   _flatButton = DEBUG_NEW wxButton( this, BT_CELLS_FLAT2, wxT("Flat") );

   sizer1->Add(_hierButton, 1, wxEXPAND|wxBOTTOM, 3);
   sizer1->Add(_flatButton, 1, wxEXPAND|wxBOTTOM, 3);
   
   fCellBrowser = DEBUG_NEW GDSCellBrowser(this, tui::ID_GDS_CELLTREE_F, pos, size, style);
   
   hCellBrowser = DEBUG_NEW GDSCellBrowser(this, tui::ID_GDS_CELLTREE_H, pos, size, style);
   
   thesizer->Add(hCellBrowser, 1, wxEXPAND | wxBOTTOM);
   thesizer->Add(fCellBrowser, 1, wxEXPAND | wxBOTTOM);
   fCellBrowser->Hide();
   thesizer->Add(sizer1, 0, wxEXPAND | wxALL);

   SetSizerAndFit(thesizer);
   thesizer->SetSizeHints( this );
}
Beispiel #7
0
PreferencesWindow::PreferencesWindow(wxWindow* parent) : wxDialog(parent, wxID_ANY, "Preferences", wxDefaultPosition, wxSize(400, 400), wxCAPTION | wxCLOSE_BOX)
{
	wxSizer* sizer = newd wxBoxSizer(wxVERTICAL);

	book = newd wxNotebook(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxBK_TOP);
	//book->SetPadding(4);

	book->AddPage(CreateGeneralPage(), "General", true);
	book->AddPage(CreateEditorPage(), "Editor");
	book->AddPage(CreateGraphicsPage(), "Graphics");
	book->AddPage(CreateUIPage(), "Interface");
	book->AddPage(CreateClientPage(), "Client Version");

	sizer->Add(book, 1, wxEXPAND | wxALL, 10);

	wxSizer* subsizer = newd wxBoxSizer(wxHORIZONTAL);
	subsizer->Add(newd wxButton(this, wxID_OK, "OK"), wxSizerFlags(1).Center());
	subsizer->Add(newd wxButton(this, wxID_CANCEL, "Cancel"), wxSizerFlags(1).Center());
	subsizer->Add(newd wxButton(this, wxID_APPLY, "Apply"), wxSizerFlags(1).Center());
	sizer->Add(subsizer, 0, wxCENTER | wxLEFT | wxBOTTOM | wxRIGHT, 10);

	SetSizerAndFit(sizer);
	Centre(wxBOTH);
	// FindWindowById(PANE_ADVANCED_GRAPHICS, this)->GetParent()->Fit();
}
Beispiel #8
0
BrowseTileWindow::BrowseTileWindow(wxWindow* parent, const Map* map, Tile* tile, wxPoint position /* = wxDefaultPosition */) :
    wxDialog(parent, wxID_ANY, "Browse Field", position, wxSize(600, 400), wxCAPTION | wxCLOSE_BOX | wxRESIZE_BORDER)
{
    wxSizer* sizer = newd wxBoxSizer(wxVERTICAL);
    item_list = newd BrowseTileListBox(this, wxID_ANY, tile);
    sizer->Add(item_list, wxSizerFlags(1).Expand());

    wxString pos;
    pos << wxT("x=") << tile->getX() << wxT(",  y=") << tile->getY() << wxT(",  z=") << tile->getZ();

    wxSizer* infoSizer = newd wxBoxSizer(wxVERTICAL);
    infoSizer->Add(newd wxButton(this, wxID_REMOVE, wxT("Delete")), wxSizerFlags(0).Left());
    infoSizer->AddSpacer(5);
    infoSizer->Add(newd wxStaticText(this, wxID_ANY, wxT("Position:  ") + pos), wxSizerFlags(0).Left());
    infoSizer->Add(item_count_txt = newd wxStaticText(this, wxID_ANY, wxT("Item count:  ") + i2ws(item_list->GetItemCount())), wxSizerFlags(0).Left());
    infoSizer->Add(newd wxStaticText(this, wxID_ANY, wxT("Protection zone:  ") + b2yn(tile->isPZ())), wxSizerFlags(0).Left());
    infoSizer->Add(newd wxStaticText(this, wxID_ANY, wxT("No PvP:  ") + b2yn(tile->getMapFlags() & TILESTATE_NOPVP)), wxSizerFlags(0).Left());
    infoSizer->Add(newd wxStaticText(this, wxID_ANY, wxT("No logout:  ") + b2yn(tile->getMapFlags() & TILESTATE_NOLOGOUT)), wxSizerFlags(0).Left());
    infoSizer->Add(newd wxStaticText(this, wxID_ANY, wxT("PvP zone:  ") + b2yn(tile->getMapFlags() & TILESTATE_PVPZONE)), wxSizerFlags(0).Left());
    infoSizer->Add(newd wxStaticText(this, wxID_ANY, wxT("House:  ") + b2yn(tile->isHouseTile())), wxSizerFlags(0).Left());

    sizer->Add(infoSizer, wxSizerFlags(0).Left().DoubleBorder());

    // OK/Cancel buttons
    wxSizer* btnSizer = newd wxBoxSizer(wxHORIZONTAL);
    btnSizer->Add(newd wxButton(this, wxID_OK, wxT("OK")), wxSizerFlags(0).Center());
    btnSizer->Add(newd wxButton(this, wxID_CANCEL, wxT("Cancel")), wxSizerFlags(0).Center());
    sizer->Add(btnSizer, wxSizerFlags(0).Center().DoubleBorder());

    SetSizerAndFit(sizer);
}
//====================================================================
browsers::layerbrowser::layerbrowser(wxWindow* parent, wxWindowID id) :
                                                               wxPanel(parent, id) {
   wxBoxSizer *thesizer = DEBUG_NEW wxBoxSizer( wxVERTICAL );
   //   
   wxString action[] = { _T("Hide"), _T("View"),  _T("Lock"),  _T("Unlock") };
   wxBoxSizer *sizer1 = DEBUG_NEW wxBoxSizer( wxHORIZONTAL );
   action_select = DEBUG_NEW wxChoice(this, BT_LAYER_ACTION, wxDefaultPosition,
                                                       wxDefaultSize, 4, action);
   action_select->SetSelection(0);
   sizer1->Add(action_select, 1, wxEXPAND, 3);
   sizer1->Add(DEBUG_NEW wxButton( this, BT_LAYER_DO, wxT("Selected") ), 1, wxEXPAND, 3);
   thesizer->Add(sizer1, 0, wxEXPAND | wxALL);
   //
   _layerlist = DEBUG_NEW topedlay_list(this, tui::ID_TPD_LAYERS);
   thesizer->Add(_layerlist,1, wxEXPAND | wxALL | wxALIGN_TOP ,3);
   //
   wxString actionwild[] = { _T("All"), _T("None")};
   wxBoxSizer *sizer3 = DEBUG_NEW wxBoxSizer( wxHORIZONTAL );
   action_wild = DEBUG_NEW wxChoice(this, BT_LAYER_ACTIONWILD, wxDefaultPosition,
                                                         wxDefaultSize, 2, actionwild);
   action_wild->SetSelection(0);
   sizer3->Add(DEBUG_NEW wxButton( this, BT_LAYER_SELECTWILD, wxT("Select") ), 1, wxEXPAND, 3);
   sizer3->Add(action_wild, 1, wxEXPAND, 3);
   thesizer->Add(sizer3, 0, wxEXPAND | wxALL);
   //
   SetSizerAndFit(thesizer);
   thesizer->SetSizeHints( this );
   //
}
//---------------------------------------------------------------------------------------
ColorsOptPanel::ColorsOptPanel(wxWindow* parent, ApplicationScope& appScope)
    : OptionsPanel(parent, appScope)
{
    //TODO  GetLanguages(m_cLangCodes, m_cLangNames);
    wxString* m_cLangCodes = LENMUS_NEW wxString[2];
    wxString* m_cLangNames = LENMUS_NEW wxString[2];
    m_cLangCodes[0] = "en";        m_cLangNames[0] = "Green";
    m_cLangCodes[1] = "sp";        m_cLangNames[1] =  "Blue";
    int nNumLangs = 2;    //TODO  m_cLangNames.GetCount();

    wxString sysLang = "en";    //TODO GetSystemLanguageCode();

    wxBoxSizer *mainSizer = LENMUS_NEW wxBoxSizer(wxVERTICAL);
    wxBoxSizer *hSizer;

    hSizer = LENMUS_NEW wxBoxSizer(wxHORIZONTAL);
    hSizer->Add(LENMUS_NEW wxStaticText(this, -1,
                                    _("Choose colors to use:")),
                0, wxALIGN_CENTRE | wxALIGN_CENTER_VERTICAL | wxALL, 8);

    wxString *langArray = LENMUS_NEW wxString[nNumLangs];
    int i;
    for(i=0; i < nNumLangs; i++)
        langArray[i] = m_cLangNames[i];
    m_pChoice = LENMUS_NEW wxChoice(this, -1, wxDefaultPosition, wxDefaultSize,
                            nNumLangs, langArray);
    m_pChoice->SetSelection(0); // in case nothing else matches
    delete[] langArray;

    for(i=0; i < nNumLangs; i++) {
        if (m_cLangCodes[i] == sysLang)
            m_pChoice->SetSelection(i);
    }
    hSizer->Add(m_pChoice,
                0, wxALIGN_CENTRE | wxALIGN_CENTER_VERTICAL | wxALL, 8);

    mainSizer->Add(hSizer,
                    0, wxALL, 8);

    SetAutoLayout(true);
    SetSizer(mainSizer);
    mainSizer->Fit(this);
    mainSizer->SetSizeHints(this);

    //TODO Delete this debug code
    delete [] m_cLangNames;
    delete [] m_cLangCodes;


}
//---------------------------------------------------------------------------------------
DlgChooseLanguage::DlgChooseLanguage(wxWindow* parent, wxWindowID id,
                                   const wxString& title)
    : wxDialog(parent, id, title)
{
    GetLanguages(m_cLangCodes, m_cLangNames);
    m_nNumLangs = m_cLangNames.GetCount();

    wxString sysLang = GetSystemLanguageCode();

    wxBoxSizer *mainSizer = LENMUS_NEW wxBoxSizer(wxVERTICAL);
    wxBoxSizer *hSizer;

    hSizer = LENMUS_NEW wxBoxSizer(wxHORIZONTAL);
    hSizer->Add(LENMUS_NEW wxStaticText(this, -1,
                                    _("Choose language to use:")),
                0, wxALIGN_CENTRE | wxALIGN_CENTER_VERTICAL | wxALL, 8);

    wxString *langArray = LENMUS_NEW wxString[m_nNumLangs];
    for(int i=0; i < m_nNumLangs; i++)
        langArray[i] = m_cLangNames[i];
    m_pChoice = LENMUS_NEW wxChoice(this, -1, wxDefaultPosition, wxDefaultSize,
                            m_nNumLangs, langArray);
    m_pChoice->SetSelection(0); // in case nothing else matches
    delete[] langArray;

    for(int i=0; i < m_nNumLangs; i++)
    {
        if (m_cLangCodes[i] == sysLang)
            m_pChoice->SetSelection(i);
    }
    hSizer->Add(m_pChoice,
                0, wxALIGN_CENTRE | wxALIGN_CENTER_VERTICAL | wxALL, 8);

    mainSizer->Add(hSizer,
                    0, wxALL, 8);

    wxButton *ok = LENMUS_NEW wxButton(this, wxID_OK, _("OK"));
    ok->SetDefault();
    mainSizer->Add(ok, 0, wxALIGN_CENTRE | wxALL, 8);

    SetAutoLayout(true);
    SetSizer(mainSizer);
    mainSizer->Fit(this);
    mainSizer->SetSizeHints(this);

    // set default language, just in case user closes the dialog by clicking on
    // the dialog title [X] button
    m_sLang = m_cLangCodes[m_pChoice->GetSelection()];
}
Beispiel #12
0
void GUI::ShowTextBox(wxWindow* parent, wxString title, wxString content)
{
	wxDialog* dlg = newd wxDialog(parent, wxID_ANY, title, wxDefaultPosition, wxDefaultSize, wxRESIZE_BORDER | wxCAPTION | wxCLOSE_BOX);
	wxSizer* topsizer = newd wxBoxSizer(wxVERTICAL);
	wxTextCtrl* text_field = newd wxTextCtrl(dlg, wxID_ANY, content, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE | wxTE_READONLY);
	text_field->SetMinSize(wxSize(400, 550));
	topsizer->Add(text_field, wxSizerFlags(5).Expand());

	wxSizer* choicesizer = newd wxBoxSizer(wxHORIZONTAL);
	choicesizer->Add(newd wxButton(dlg, wxID_CANCEL, wxT("OK")), wxSizerFlags(1).Center());
	topsizer->Add(choicesizer, wxSizerFlags(0).Center());
	dlg->SetSizerAndFit(topsizer);

	dlg->ShowModal();
}
Beispiel #13
0
BrushPalettePanel::BrushPalettePanel(wxWindow* parent, const TilesetContainer& tilesets, TilesetCategoryType category, wxWindowID id) :
	PalettePanel(parent, id),
	palette_type(category),
	choicebook(nullptr),
	size_panel(nullptr)
{
	wxSizer* topsizer = newd wxBoxSizer(wxVERTICAL);

	// Create the tileset panel
	wxSizer* ts_sizer = newd wxStaticBoxSizer(wxVERTICAL, this, wxT("Tileset"));
	wxChoicebook* tmp_choicebook = newd wxChoicebook(this, wxID_ANY, wxDefaultPosition, wxSize(180,250));
	ts_sizer->Add(tmp_choicebook, 1, wxEXPAND);
	topsizer->Add(ts_sizer, 1, wxEXPAND);

	for(TilesetContainer::const_iterator iter = tilesets.begin(); iter != tilesets.end(); ++iter) {
		const TilesetCategory* tcg = iter->second->getCategory(category);
		if(tcg && tcg->size() > 0) {
			BrushPanel* panel = newd BrushPanel(tmp_choicebook);
			panel->AssignTileset(tcg);
			tmp_choicebook->AddPage(panel, wxstr(iter->second->name));
		}
	}

	SetSizerAndFit(topsizer);

	choicebook = tmp_choicebook;
}
Beispiel #14
0
wxWindow* PropertiesWindow::createContainerPanel(wxWindow* parent)
{
	Container* container = (Container*)edit_item;
	wxPanel* panel = newd wxPanel(parent, ITEM_PROPERTIES_CONTAINER_TAB);
	wxSizer* topSizer = newd wxBoxSizer(wxVERTICAL);

	wxSizer* gridSizer = newd wxGridSizer(6, 5, 5);

	bool use_large_sprites = g_settings.getBoolean(Config::USE_LARGE_CONTAINER_ICONS);
	for(uint32_t i = 0; i < container->getVolume(); ++i) {
		Item* item = container->getItem(i);
		ContainerItemButton* containerItemButton = newd ContainerItemButton(panel, use_large_sprites, i, edit_map, item);

		container_items.push_back(containerItemButton);
		gridSizer->Add(containerItemButton, wxSizerFlags(0));
	}

	topSizer->Add(gridSizer, wxSizerFlags(1).Expand());

	/*
	wxSizer* optSizer = newd wxBoxSizer(wxHORIZONTAL);
	optSizer->Add(newd wxButton(panel, ITEM_PROPERTIES_ADD_ATTRIBUTE, "Add Item"), wxSizerFlags(0).Center());
	// optSizer->Add(newd wxButton(panel, ITEM_PROPERTIES_REMOVE_ATTRIBUTE, "Remove Attribute"), wxSizerFlags(0).Center());
	topSizer->Add(optSizer, wxSizerFlags(0).Center().DoubleBorder());
	*/

	panel->SetSizer(topSizer);
	return panel;
}
Beispiel #15
0
PanelObjectList::PanelObjectList(wxFrame* parentframe)
: wxPanel( parentframe, wxID_ANY, wxDefaultPosition, wxSize(300, 600), wxTAB_TRAVERSAL | wxNO_BORDER, "Memory" )
{
    m_pTree_Objects = MyNew wxTreeCtrl( this, wxID_ANY, wxDefaultPosition, wxSize(2000,2000),
        wxTR_HAS_BUTTONS | wxTR_LINES_AT_ROOT | wxTR_EDIT_LABELS | wxTR_MULTIPLE );
    //wxTreeItemId idroot =
    m_pTree_Objects->AddRoot( "Objects" );

    // setup a sizer to resize the tree
    wxBoxSizer* sizer = MyNew wxBoxSizer( wxHORIZONTAL );
    sizer->Add( m_pTree_Objects, 0, wxGROW|wxALL, 2 );
    SetSizer( sizer );

    PanelObjectListDropTarget* pDropTarget = MyNew PanelObjectListDropTarget;
    pDropTarget->m_pPanelObjectList = this;
    m_pTree_Objects->SetDropTarget( pDropTarget );

    m_pCallbackFunctionObject = 0;
    m_pOnTreeSelectionChangedFunction = 0;
    m_UpdatePanelWatchOnSelection = true;

    Update();

    Connect( wxEVT_TREE_SEL_CHANGED, wxTreeEventHandler( PanelObjectList::OnTreeSelectionChanged ) );
    m_pTree_Objects->Connect( wxEVT_LEFT_DOWN, wxMouseEventHandler( PanelObjectList::OnTreeItemLeftDown ) );
    //Connect( wxEVT_LEFT_UP, wxMouseEventHandler( PanelObjectList::OnTreeItemLeftUp ) );
    //m_pTree_Objects->Connect( wxEVT_LEFT_UP, wxMouseEventHandler( PanelObjectList::OnTreeItemLeftUp ) );
    Connect( wxEVT_TREE_BEGIN_LABEL_EDIT, wxTreeEventHandler( PanelObjectList::OnTreeBeginLabelEdit ) );
    Connect( wxEVT_TREE_END_LABEL_EDIT, wxTreeEventHandler( PanelObjectList::OnTreeEndLabelEdit ) );
    Connect( wxEVT_TREE_ITEM_MENU, wxTreeEventHandler( PanelObjectList::OnTreeContextMenuRequested ) );
    Connect( wxEVT_TREE_BEGIN_DRAG, wxTreeEventHandler( PanelObjectList::OnDragBegin ) );
    Connect( wxEVT_COMMAND_TREE_ITEM_ACTIVATED, wxTreeEventHandler( PanelObjectList::OnActivate ) );
    Connect( wxEVT_TREE_KEY_DOWN, wxTreeEventHandler( PanelObjectList::OnKeyDown ) );
}
Beispiel #16
0
BrushThicknessPanel::BrushThicknessPanel(wxWindow* parent) :
	PalettePanel(parent, wxID_ANY)
{
	wxSizer* thickness_sizer = newd wxBoxSizer(wxVERTICAL);

	wxSizer* thickness_sub_sizer = newd wxBoxSizer(wxHORIZONTAL);
	thickness_sub_sizer->Add(20,10);
	use_button = newd wxCheckBox(this, PALETTE_DOODAD_USE_THICKNESS, wxT("Use custom thickness"));
	thickness_sub_sizer->Add(use_button);
	thickness_sizer->Add(thickness_sub_sizer, 1, wxEXPAND);

	slider = newd wxSlider(this, PALETTE_DOODAD_SLIDER, 5, 1, 10, wxDefaultPosition);
	thickness_sizer->Add(slider, 1, wxEXPAND);

	SetSizerAndFit(thickness_sizer);
}
Beispiel #17
0
//---------------------------------------------------------------------------------------
void WizardDevicesPage::CreateControls()
{
    wxBoxSizer* itemBoxSizer3 = LENMUS_NEW wxBoxSizer(wxVERTICAL);
    SetSizer(itemBoxSizer3);

    wxBoxSizer* itemBoxSizer4 = LENMUS_NEW wxBoxSizer(wxHORIZONTAL);
    itemBoxSizer3->Add(itemBoxSizer4, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);

    wxStaticText* itemStaticText5 = LENMUS_NEW wxStaticText( this, wxID_STATIC, _("Midi devices to use"), wxDefaultPosition, wxDefaultSize, 0 );
    itemStaticText5->SetFont(wxFont(14, wxSWISS, wxNORMAL, wxBOLD, false, "Arial"));
    itemBoxSizer4->Add(itemStaticText5, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxADJUST_MINSIZE, 5);

    wxBoxSizer* itemBoxSizer6 = LENMUS_NEW wxBoxSizer(wxHORIZONTAL);
    itemBoxSizer3->Add(itemBoxSizer6, 1, wxGROW|wxALL, 5);

    wxBoxSizer* itemBoxSizer7 = LENMUS_NEW wxBoxSizer(wxVERTICAL);
    itemBoxSizer6->Add(itemBoxSizer7, 1, wxGROW|wxALL, 5);

    wxStaticText* itemStaticText8 = LENMUS_NEW wxStaticText( this, wxID_STATIC, _("To generate sounds the program needs a MIDI synthesizer device. Normally, one of these devices is included in the sound board of the PC, but your PC might have more than one."), wxDefaultPosition, wxSize(250, -1), 0 );
    itemBoxSizer7->Add(itemStaticText8, 1, wxGROW|wxALL|wxADJUST_MINSIZE, 5);

    wxStaticText* itemStaticText9 = LENMUS_NEW wxStaticText( this, wxID_STATIC, _("If your PC has more than one device, choose one of them. You can test all of them and choose the one whose sound you prefer."), wxDefaultPosition, wxSize(250, -1), 0 );
    itemBoxSizer7->Add(itemStaticText9, 1, wxGROW|wxALL|wxADJUST_MINSIZE, 5);

    wxStaticLine* itemStaticLine10 = LENMUS_NEW wxStaticLine( this, wxID_STATIC, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL );
    itemBoxSizer6->Add(itemStaticLine10, 0, wxGROW|wxALL, 5);

    wxBoxSizer* itemBoxSizer11 = LENMUS_NEW wxBoxSizer(wxVERTICAL);
    itemBoxSizer6->Add(itemBoxSizer11, 1, wxGROW|wxALL, 5);

    wxStaticText* itemStaticText12 = LENMUS_NEW wxStaticText( this, wxID_STATIC, _("Output device:"), wxDefaultPosition, wxDefaultSize, 0 );
    itemBoxSizer11->Add(itemStaticText12, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5);

    wxString* m_pOutComboStrings = NULL;
    m_pOutCombo = LENMUS_NEW wxComboBox( this, ID_COMBO_OUT_DEVICES, "", wxDefaultPosition, wxSize(250, -1), 0, m_pOutComboStrings, wxCB_READONLY );
    itemBoxSizer11->Add(m_pOutCombo, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxBOTTOM, 5);

	//TODO: Un-comment when ready to use MIDI input
    //wxStaticText* itemStaticText14 = LENMUS_NEW wxStaticText( this, wxID_STATIC, _("Input device:"), wxDefaultPosition, wxDefaultSize, 0 );
    //itemBoxSizer11->Add(itemStaticText14, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5);

	//TODO: Un-comment when ready to use MIDI input
    //wxString* m_pInComboStrings = NULL;
    //m_pInCombo = LENMUS_NEW wxComboBox( this, ID_COMBO_IN_DEVICES, "", wxDefaultPosition, wxSize(250, -1), 0, m_pInComboStrings, wxCB_READONLY );
    //itemBoxSizer11->Add(m_pInCombo, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxBOTTOM, 5);

}
Beispiel #18
0
//---------------------------------------------------------------------------------------
void LangOptionsPanel::create_controls()
{
    //content generated with wxFormBuilder

	this->SetExtraStyle( wxWS_EX_BLOCK_EVENTS );

	wxBoxSizer* pMainSizer;
	pMainSizer = LENMUS_NEW wxBoxSizer( wxVERTICAL );

	m_pTitlePannel = LENMUS_NEW wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxRAISED_BORDER|wxTAB_TRAVERSAL );
	wxBoxSizer* pTitleSizer;
	pTitleSizer = LENMUS_NEW wxBoxSizer( wxHORIZONTAL );

	m_pTitle = LENMUS_NEW wxStaticText( m_pTitlePannel, wxID_ANY, _("Language preferences"), wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT );
	m_pTitle->Wrap( -1 );
	m_pTitle->SetFont( wxFont( 8, 74, 90, 92, false, "Tahoma" ) );

	pTitleSizer->Add( m_pTitle, 0, wxALIGN_TOP|wxALL|wxADJUST_MINSIZE, 5 );


	pTitleSizer->Add( 5, 5, 1, wxALIGN_CENTER_VERTICAL|wxALL, 5 );

	m_pTitleIcon = LENMUS_NEW wxStaticBitmap( m_pTitlePannel, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 );
	pTitleSizer->Add( m_pTitleIcon, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );

	m_pTitlePannel->SetSizer( pTitleSizer );
	m_pTitlePannel->Layout();
	pTitleSizer->Fit( m_pTitlePannel );
	pMainSizer->Add( m_pTitlePannel, 0, wxEXPAND|wxBOTTOM, 5 );

	wxBoxSizer* pLangSizer;
	pLangSizer = LENMUS_NEW wxBoxSizer( wxHORIZONTAL );

	m_pLang = LENMUS_NEW wxStaticText( this, wxID_ANY, _("Choose language to use:"), wxDefaultPosition, wxDefaultSize, 0 );
	m_pLang->Wrap( -1 );
	pLangSizer->Add( m_pLang, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxADJUST_MINSIZE, 5 );

	wxArrayString m_pChoiceChoices;
	m_pChoice = LENMUS_NEW wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_pChoiceChoices, 0 );
	m_pChoice->SetSelection( 0 );
	pLangSizer->Add( m_pChoice, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );

	pMainSizer->Add( pLangSizer, 0, wxEXPAND|wxALL, 5 );

	this->SetSizer( pMainSizer );
	this->Layout();
}
Beispiel #19
0
MapTabbook::MapTabbook(wxWindow *parent, wxWindowID id) :
	wxPanel(parent, id, wxDefaultPosition, wxDefaultSize)
{
	wxSizer* wxz = newd wxBoxSizer(wxHORIZONTAL);
	notebook = newd wxAuiNotebook(this, wxID_ANY, wxDefaultPosition, wxDefaultSize);
	wxz->Add(notebook, 1, wxEXPAND);
	SetSizerAndFit(wxz);
}
Beispiel #20
0
EditHouseDialog::EditHouseDialog(wxWindow* parent, Map* map, House* house) :
	wxDialog(parent, wxID_ANY, wxT("House"), wxDefaultPosition, wxSize(250,160)),
	map(map),
	what_house(house)
{
	ASSERT(map);
	ASSERT(house);

	// Create topsizer
	wxSizer* sizer = newd wxBoxSizer(wxVERTICAL);
	wxSizer* tmpsizer;

	house_name = wxstr(house->name);
	house_id = i2ws(house->id);
	house_rent = i2ws(house->rent);

	// House options
	tmpsizer = newd wxStaticBoxSizer(wxHORIZONTAL, this, wxT("Name"));
	name_field = newd wxTextCtrl(this, wxID_ANY, wxT(""), wxDefaultPosition, wxSize(230,20), 0, wxTextValidator(wxFILTER_ASCII, &house_name));
	tmpsizer->Add(name_field);
 
	sizer->Add(tmpsizer, wxSizerFlags().Border(wxALL, 20));

	tmpsizer = newd wxStaticBoxSizer(wxHORIZONTAL, this, wxT("Rent / ID"));
	rent_field = newd wxTextCtrl(this, wxID_ANY, wxT(""), wxDefaultPosition, wxSize(160,20), 0, wxTextValidator(wxFILTER_NUMERIC, &house_rent));
	tmpsizer->Add(rent_field);
	id_field = newd wxTextCtrl(this, wxID_ANY, wxT(""), wxDefaultPosition, wxSize(70,20), 0, wxTextValidator(wxFILTER_NUMERIC, &house_id));
	id_field->Enable(false);
	tmpsizer->Add(id_field);
	sizer->Add(tmpsizer, wxSizerFlags().Border(wxALL, 20));
	
	// House options
	guildhall_field = newd wxCheckBox(this, wxID_ANY, wxT("Guildhall"), wxDefaultPosition);
 
	sizer->Add(guildhall_field, wxSizerFlags().Border(wxRIGHT | wxLEFT | wxBOTTOM, 20));
	guildhall_field->SetValue(house->guildhall);

	// OK/Cancel buttons
	tmpsizer = newd wxBoxSizer(wxHORIZONTAL);
	tmpsizer->Add(newd wxButton(this, wxID_OK, wxT("OK")), wxSizerFlags(1).Center());
	tmpsizer->Add(newd wxButton(this, wxID_CANCEL, wxT("Cancel")), wxSizerFlags(1).Center());
	sizer->Add(tmpsizer, wxSizerFlags(1).Center().Border(wxRIGHT | wxLEFT | wxBOTTOM, 20));

	SetSizerAndFit(sizer);
}
Beispiel #21
0
void ControlToolBar::ArrangeButtons()
{
   int flags = wxALIGN_CENTER | wxRIGHT;

   // (Re)allocate the button sizer
   if( mSizer )
   {
      Detach( mSizer );
      delete mSizer;
   }

   Add((mSizer = safenew wxBoxSizer(wxHORIZONTAL)), 1, wxEXPAND);

   // Start with a little extra space
   mSizer->Add( 5, 55 );

   // Add the buttons in order based on ergonomic setting
   if( mErgonomicTransportButtons )
   {
      mPause->MoveBeforeInTabOrder( mRecord );
      mPlay->MoveBeforeInTabOrder( mRecord );
      mStop->MoveBeforeInTabOrder( mRecord );
      mRewind->MoveBeforeInTabOrder( mRecord );
      mFF->MoveBeforeInTabOrder( mRecord );

      mSizer->Add( mPause,  0, flags, 2 );
      mSizer->Add( mPlay,   0, flags, 2 );
      mSizer->Add( mStop,   0, flags, 2 );
      mSizer->Add( mRewind, 0, flags, 2 );
      mSizer->Add( mFF,     0, flags, 10 );
      mSizer->Add( mRecord, 0, flags, 5 );
   }
   else
   {
      mRewind->MoveBeforeInTabOrder( mFF );
      mPlay->MoveBeforeInTabOrder( mFF );
      mRecord->MoveBeforeInTabOrder( mFF );
      mPause->MoveBeforeInTabOrder( mFF );
      mStop->MoveBeforeInTabOrder( mFF );

      mSizer->Add( mRewind, 0, flags, 2 );
      mSizer->Add( mPlay,   0, flags, 2 );
      mSizer->Add( mRecord, 0, flags, 2 );
      mSizer->Add( mPause,  0, flags, 2 );
      mSizer->Add( mStop,   0, flags, 2 );
      mSizer->Add( mFF,     0, flags, 5 );
   }

   // Layout the sizer
   mSizer->Layout();

   // Layout the toolbar
   Layout();

   // (Re)Establish the minimum size
   SetMinSize( GetSizer()->GetMinSize() );
}
Beispiel #22
0
//==============================================================================
browsers::TDTbrowser::TDTbrowser(wxWindow *parent, wxWindowID id, 
   const wxPoint& pos, const wxSize& size, long style) : 
                                       wxPanel(parent, id, pos, size)
                                          //,
                                       //style | wxTR_FULL_ROW_HIGHLIGHT) 
{
   wxBoxSizer *thesizer = DEBUG_NEW wxBoxSizer( wxVERTICAL );
      
   wxBoxSizer *sizer1 = DEBUG_NEW wxBoxSizer( wxHORIZONTAL );
   
   _hierButton = DEBUG_NEW wxButton( this, BT_CELLS_HIER, wxT("Hier") );
   //Set bold font for _hierButton
   wxFont font = _hierButton->GetFont();
   font.SetWeight(wxFONTWEIGHT_BOLD);
   _hierButton->SetFont(font);

   _flatButton = DEBUG_NEW wxButton( this, BT_CELLS_FLAT, wxT("Flat") );
   sizer1->Add(_hierButton, 1, wxEXPAND|wxBOTTOM, 3);
   sizer1->Add(_flatButton, 1, wxEXPAND|wxBOTTOM, 3);
   fCellBrowser = DEBUG_NEW CellBrowser(this, tui::ID_TPD_CELLTREE_F,pos, size, style);
   
   hCellBrowser = DEBUG_NEW CellBrowser(this, tui::ID_TPD_CELLTREE_H, pos, size, style);
   
   thesizer->Add(hCellBrowser, 1, wxEXPAND | wxBOTTOM);
   thesizer->Add(fCellBrowser, 1, wxEXPAND | wxBOTTOM);
   fCellBrowser->Hide();
   thesizer->Add(sizer1, 0, wxEXPAND | wxALL);

   _imageList = DEBUG_NEW wxImageList(16, 16, TRUE);
#ifdef __WXMSW__
/*TODO : Under windows - resource loading*/
//    m_imageListNormal->Add( wxIcon(_T("icon1"), wxBITMAP_TYPE_ICO_RESOURCE) );
//
#else
    _imageList->Add( wxIcon( cell_normal   ) );
    _imageList->Add( wxIcon( cell_expanded ) );
#endif
   hCellBrowser->SetImageList(_imageList);
//   _llfont_bold.SetWeight(wxBOLD);
//   _llfont_normal.SetWeight(wxNORMAL);
   SetSizerAndFit(thesizer);
   thesizer->SetSizeHints( this );

}
Beispiel #23
0
BrushPanel::BrushPanel(wxWindow *parent) :
	wxPanel(parent, wxID_ANY),
	tileset(nullptr),
	brushbox(nullptr),
	loaded(false),
	list_type(BRUSHLIST_LISTBOX)
{
	sizer = newd wxBoxSizer(wxVERTICAL);
	SetSizerAndFit(sizer);
}
Beispiel #24
0
wxWindow* PropertiesWindow::createAttributesPanel(wxWindow* parent)
{
	wxPanel* panel = newd wxPanel(parent, wxID_ANY);
	wxSizer* topSizer = newd wxBoxSizer(wxVERTICAL);

	attributesGrid = newd wxGrid(panel, ITEM_PROPERTIES_ADVANCED_TAB, wxDefaultPosition, wxSize(-1, 160));
	topSizer->Add(attributesGrid, wxSizerFlags(1).Expand());

	wxFont time_font(*wxSWISS_FONT);
	attributesGrid->SetDefaultCellFont(time_font);
	attributesGrid->CreateGrid(0, 3);
	attributesGrid->DisableDragRowSize();
	attributesGrid->DisableDragColSize();
	attributesGrid->SetSelectionMode(wxGrid::wxGridSelectRows);
	attributesGrid->SetRowLabelSize(0);
	//log->SetColLabelSize(0);
	//log->EnableGridLines(false);
	attributesGrid->EnableEditing(true);

	attributesGrid->SetColLabelValue(0, "Key");
	attributesGrid->SetColSize(0, 100);
	attributesGrid->SetColLabelValue(1, "Type");
	attributesGrid->SetColSize(1, 80);
	attributesGrid->SetColLabelValue(2, "Value");
	attributesGrid->SetColSize(2, 410);

	// contents
	ItemAttributeMap attrs = edit_item->getAttributes();
	attributesGrid->AppendRows(attrs.size());
	int i = 0;
	for(ItemAttributeMap::iterator aiter = attrs.begin(); aiter != attrs.end(); ++aiter, ++i)
		SetGridValue(attributesGrid, i, aiter->first, aiter->second);

	wxSizer* optSizer = newd wxBoxSizer(wxHORIZONTAL);
	optSizer->Add(newd wxButton(panel, ITEM_PROPERTIES_ADD_ATTRIBUTE, "Add Attribute"), wxSizerFlags(0).Center());
	optSizer->Add(newd wxButton(panel, ITEM_PROPERTIES_REMOVE_ATTRIBUTE, "Remove Attribute"), wxSizerFlags(0).Center());
	topSizer->Add(optSizer, wxSizerFlags(0).Center().DoubleBorder());

	panel->SetSizer(topSizer);

	return panel;
}
Beispiel #25
0
BrushIconBox::BrushIconBox(wxWindow *parent, const TilesetCategory *_tileset, RenderSize rsz) :
	wxScrolledWindow(parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxVSCROLL),
	BrushBoxInterface(_tileset),
	icon_size(rsz)
{
	ASSERT(tileset->getType() >= TILESET_UNKNOWN && tileset->getType() <= TILESET_HOUSE);
	int width;
	if(icon_size == RENDER_SIZE_32x32) {
		width = max(g_settings.getInteger(Config::PALETTE_COL_COUNT) / 2 + 1, 1);
	} else {
		width = max(g_settings.getInteger(Config::PALETTE_COL_COUNT) + 1, 1);
	}

	// Create buttons
	wxSizer* stacksizer = newd wxBoxSizer(wxVERTICAL);
	wxSizer* rowsizer = nullptr;
	int item_counter = 0;
	for(BrushVector::const_iterator iter = tileset->brushlist.begin(); iter != tileset->brushlist.end(); ++iter) {
		ASSERT(*iter);
		++item_counter;

		if(!rowsizer) {
			rowsizer = newd wxBoxSizer(wxHORIZONTAL);
		}

		BrushButton* bb = newd BrushButton(this, *iter, rsz);
		rowsizer->Add(bb);
		brush_buttons.push_back(bb);

		if(item_counter % width == 0) { // newd row
			stacksizer->Add(rowsizer);
			rowsizer = nullptr;
		}
	}
	if(rowsizer) {
		stacksizer->Add(rowsizer);
	}

	SetScrollbars(20,20, 8, item_counter/width, 0, 0);
	SetSizer(stacksizer);
}
CStructEditView::CStructEditView(wxWindow* pParent) : wxPanel(pParent)
{
	wxBoxSizer* m_pSizer;
	m_pSizer = ZION_NEW wxBoxSizer(wxVERTICAL);
	m_pPropGrid = ZION_NEW wxPropertyGrid(this, ID_OBJECT_GRID, wxDefaultPosition, wxDefaultSize, wxPG_SPLITTER_AUTO_CENTER | wxPG_DEFAULT_STYLE );
	m_pPropGrid->SetExtraStyle( wxPG_EX_HELP_AS_TOOLTIPS );
	m_pPropGrid->SetColumnProportion(0, 30);
	m_pPropGrid->SetColumnProportion(1, 70);
	m_pSizer->Add(m_pPropGrid, 1, wxGROW|wxALIGN_CENTER_VERTICAL);
	SetSizer(m_pSizer);
	m_pInfo = NULL;
	m_pData = NULL;
}
Beispiel #27
0
browsers::LayerBrowser::LayerBrowser(wxWindow* parent, wxWindowID id) 
   :wxScrolledWindow(parent, id, wxDefaultPosition, wxDefaultSize),
   _layerPanel(NULL),
   _thesizer(NULL)
{
   _thesizer = DEBUG_NEW wxBoxSizer(wxVERTICAL);

   wxBoxSizer *sizer1 = DEBUG_NEW wxBoxSizer(wxHORIZONTAL);
   sizer1->Add(DEBUG_NEW wxButton(this, BT_LAYER_SHOW_ALL, wxT("Show All")), 1, wxTOP, 3);
   sizer1->Add(DEBUG_NEW wxButton(this, BT_LAYER_HIDE_ALL, wxT("Hide All")), 1, wxTOP, 3);
   _thesizer->Add(sizer1, 0, wxTOP);

   wxBoxSizer *sizer2 = DEBUG_NEW wxBoxSizer(wxHORIZONTAL);
   sizer2->Add(DEBUG_NEW wxButton(this, BT_LAYER_LOCK_ALL, wxT("Lock All")), 1, wxTOP, 3);
   sizer2->Add(DEBUG_NEW wxButton(this, BT_LAYER_UNLOCK_ALL, wxT("Unlock All")), 1, wxTOP, 3);
   _thesizer->Add(sizer2, 0, wxTOP);

   _layerPanel = DEBUG_NEW LayerPanel(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxVSCROLL);
   _thesizer->Add(_layerPanel, 3, wxEXPAND|wxALL);
   SetSizerAndFit(_thesizer);
   _thesizer->SetSizeHints( this );
}
Beispiel #28
0
void GUI::ListDialog(wxWindow* parent, wxString title, const wxArrayString& param_items)
{
	if(param_items.empty())
		return;

	wxArrayString list_items(param_items);

	// Create the window
	wxDialog* dlg = newd wxDialog(parent, wxID_ANY, title, wxDefaultPosition, wxDefaultSize, wxRESIZE_BORDER | wxCAPTION | wxCLOSE_BOX);

	wxSizer* sizer = newd wxBoxSizer(wxVERTICAL);
	wxListBox* item_list = newd wxListBox(dlg, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0, nullptr, wxLB_SINGLE);
	item_list->SetMinSize(wxSize(500, 300));

	for(size_t i = 0; i != list_items.GetCount();) {
		wxString str = list_items[i];
		size_t pos = str.find(wxT("\n"));
		if(pos != wxString::npos) {
			// Split string!
			item_list->Append(str.substr(0, pos));
			list_items[i] = str.substr(pos+1);
			continue;
		}
		item_list->Append(list_items[i]);
		++i;
	}
	sizer->Add(item_list, 1, wxEXPAND);

	wxSizer* stdsizer = newd wxBoxSizer(wxHORIZONTAL);
	stdsizer->Add(newd wxButton(dlg, wxID_OK, wxT("OK")), wxSizerFlags(1).Center());
	sizer->Add(stdsizer, wxSizerFlags(0).Center());

	dlg->SetSizerAndFit(sizer);

	// Show the window
	dlg->ShowModal();
	delete dlg;
}
Beispiel #29
0
//---------------------------------------------------------------------------------------
void WizardMetronomePage::CreateControls()
{
    wxBoxSizer* itemBoxSizer35 = LENMUS_NEW wxBoxSizer(wxVERTICAL);
    SetSizer(itemBoxSizer35);

    wxBoxSizer* itemBoxSizer36 = LENMUS_NEW wxBoxSizer(wxHORIZONTAL);
    itemBoxSizer35->Add(itemBoxSizer36, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);

    wxStaticText* itemStaticText37 = LENMUS_NEW wxStaticText( this, wxID_STATIC, _("Metronome channel and sounds"), wxDefaultPosition, wxDefaultSize, 0 );
    itemStaticText37->SetFont(wxFont(14, wxSWISS, wxNORMAL, wxBOLD, false, "Arial"));
    itemBoxSizer36->Add(itemStaticText37, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxADJUST_MINSIZE, 5);

    wxBoxSizer* itemBoxSizer38 = LENMUS_NEW wxBoxSizer(wxHORIZONTAL);
    itemBoxSizer35->Add(itemBoxSizer38, 1, wxGROW|wxALL, 5);

    wxBoxSizer* itemBoxSizer39 = LENMUS_NEW wxBoxSizer(wxVERTICAL);
    itemBoxSizer38->Add(itemBoxSizer39, 1, wxGROW|wxALL, 5);

    wxStaticText* itemStaticText40 = LENMUS_NEW wxStaticText( this, wxID_STATIC, _("Channels 10 and 16 are specialized in percussion sounds. So it is recommended to choose one of these (it doesn't matter wich one)."), wxDefaultPosition, wxSize(250, -1), 0 );
    itemBoxSizer39->Add(itemStaticText40, 1, wxGROW|wxALL|wxADJUST_MINSIZE, 5);

    wxStaticText* itemStaticText41 = LENMUS_NEW wxStaticText( this, wxID_STATIC, _("To better identify the first beat of each measure it is possible to assign a different sound to it. But you can also choose the same sound for both, the first beat and the others."), wxDefaultPosition, wxSize(250, -1), 0 );
    itemBoxSizer39->Add(itemStaticText41, 1, wxGROW|wxALL|wxADJUST_MINSIZE, 5);

    wxStaticLine* itemStaticLine42 = LENMUS_NEW wxStaticLine( this, wxID_STATIC, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL );
    itemBoxSizer38->Add(itemStaticLine42, 0, wxGROW|wxALL, 5);

    wxBoxSizer* itemBoxSizer43 = LENMUS_NEW wxBoxSizer(wxVERTICAL);
    itemBoxSizer38->Add(itemBoxSizer43, 1, wxGROW|wxALL, 5);

    wxStaticText* itemStaticText44 = LENMUS_NEW wxStaticText( this, wxID_STATIC, _("Channel:"), wxDefaultPosition, wxDefaultSize, 0 );
    itemBoxSizer43->Add(itemStaticText44, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5);

    wxString* m_pMtrChannelComboStrings = NULL;
    m_pMtrChannelCombo = LENMUS_NEW wxComboBox( this, ID_COMBO_MTR_CHANNEL, "", wxDefaultPosition, wxSize(70, -1), 0, m_pMtrChannelComboStrings, wxCB_READONLY );
    itemBoxSizer43->Add(m_pMtrChannelCombo, 0, wxALIGN_LEFT|wxALL, 5);

    wxBoxSizer* itemBoxSizer46 = LENMUS_NEW wxBoxSizer(wxVERTICAL);
    itemBoxSizer43->Add(itemBoxSizer46, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);

    wxStaticText* itemStaticText47 = LENMUS_NEW wxStaticText( this, wxID_STATIC, _("Sound for first beat of each measure:"), wxDefaultPosition, wxDefaultSize, 0 );
    itemBoxSizer43->Add(itemStaticText47, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5);

    wxString* m_pMtrInstr1ComboStrings = NULL;
    m_pMtrInstr1Combo = LENMUS_NEW wxComboBox( this, ID_COMBO_MTR_INSTR1, "", wxDefaultPosition, wxSize(250, -1), 0, m_pMtrInstr1ComboStrings, wxCB_READONLY );
    itemBoxSizer43->Add(m_pMtrInstr1Combo, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxBOTTOM, 5);

    wxStaticText* itemStaticText49 = LENMUS_NEW wxStaticText( this, wxID_STATIC, _("Sound for other beats of each measure:"), wxDefaultPosition, wxDefaultSize, 0 );
    itemBoxSizer43->Add(itemStaticText49, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5);

    wxString* m_pMtrInstr2ComboStrings = NULL;
    m_pMtrInstr2Combo = LENMUS_NEW wxComboBox( this, ID_COMBO_MTR_INSTR2, "", wxDefaultPosition, wxSize(250, -1), 0, m_pMtrInstr2ComboStrings, wxCB_READONLY );
    itemBoxSizer43->Add(m_pMtrInstr2Combo, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxBOTTOM, 5);

    wxButton* itemButton51 = LENMUS_NEW wxButton( this, ID_BUTTON, _("Test sound"), wxDefaultPosition, wxDefaultSize, 0 );
    itemBoxSizer43->Add(itemButton51, 0, wxALIGN_LEFT|wxALL, 5);

}
Beispiel #30
0
wxNotebookPage* PreferencesWindow::CreateEditorPage() {
	wxNotebookPage* editor_page = newd wxPanel(book, wxID_ANY);

	wxSizer* sizer = newd wxBoxSizer(wxVERTICAL);

	sizer->Add(group_actions_chkbox = newd wxCheckBox(editor_page, wxID_ANY, wxT("Group same-type actions")));
	group_actions_chkbox->SetValue(settings.getBoolean(Config::GROUP_ACTIONS));
	group_actions_chkbox->SetToolTip(wxT("This will group actions of the same type (drawing, selection..) when several take place in consecutive order."));

	sizer->Add(duplicate_id_warn_chkbox = newd wxCheckBox(editor_page, wxID_ANY, wxT("Warn for duplicate IDs")));
	duplicate_id_warn_chkbox->SetValue(settings.getBoolean(Config::WARN_FOR_DUPLICATE_ID));
	duplicate_id_warn_chkbox->SetToolTip(wxT("Warns for most kinds of duplicate IDs."));

	sizer->Add(house_remove_chkbox = newd wxCheckBox(editor_page, wxID_ANY, wxT("House brush removes items")));
	house_remove_chkbox->SetValue(settings.getBoolean(Config::HOUSE_BRUSH_REMOVE_ITEMS));
	house_remove_chkbox->SetToolTip(wxT("When this option is checked, the house brush will automaticly remove items that will respawn every time the map is loaded."));

	sizer->Add(auto_assign_doors_chkbox = newd wxCheckBox(editor_page, wxID_ANY, wxT("Auto-assign door ids")));
	auto_assign_doors_chkbox->SetValue(settings.getBoolean(Config::AUTO_ASSIGN_DOORID));
	auto_assign_doors_chkbox->SetToolTip(wxT("This will auto-assign unique door ids to all doors placed with the door brush (or doors painted over with the house brush).\nDoes NOT affect doors placed using the RAW palette."));
	
	sizer->Add(doodad_erase_same_chkbox = newd wxCheckBox(editor_page, wxID_ANY, wxT("Doodad brush only erases same")));
	doodad_erase_same_chkbox->SetValue(settings.getBoolean(Config::DOODAD_BRUSH_ERASE_LIKE));
	doodad_erase_same_chkbox->SetToolTip(wxT("The doodad brush will only erase items that belongs to the current brush."));

	sizer->Add(eraser_leave_unique_chkbox = newd wxCheckBox(editor_page, wxID_ANY, wxT("Eraser leaves unique items")));
	eraser_leave_unique_chkbox->SetValue(settings.getBoolean(Config::ERASER_LEAVE_UNIQUE));
	eraser_leave_unique_chkbox->SetToolTip(wxT("The eraser will leave containers with items in them, items with unique or action id and items."));

	sizer->Add(allow_spawnless_chkbox = newd wxCheckBox(editor_page, wxID_ANY, wxT("Allow creatures without spawn")));
	allow_spawnless_chkbox->SetValue(settings.getBoolean(Config::ALLOW_CREATURES_WITHOUT_SPAWN));
	allow_spawnless_chkbox->SetToolTip(wxT("When this option is checked, you can place creatures without placing a spawn, they will NOT be saved, however."));

	sizer->Add(allow_multiple_orderitems_chkbox = newd wxCheckBox(editor_page, wxID_ANY, wxT("Prevent toporder conflict")));
	allow_multiple_orderitems_chkbox->SetValue(settings.getBoolean(Config::RAW_LIKE_SIMONE));
	allow_multiple_orderitems_chkbox->SetToolTip(wxT("When this option is checked, you can not place several items with the same toporder on one tile using a RAW Brush."));

	sizer->Add(20,10);

	sizer->Add(merge_move_chkbox = newd wxCheckBox(editor_page, wxID_ANY, wxT("Use merge move")));
	merge_move_chkbox->SetValue(settings.getBoolean(Config::MERGE_MOVE));
	merge_move_chkbox->SetToolTip(wxT("Moved tiles won't replace already placed tiles."));
	sizer->Add(merge_paste_chkbox = newd wxCheckBox(editor_page, wxID_ANY, wxT("Use merge paste")));
	merge_paste_chkbox->SetValue(settings.getBoolean(Config::MERGE_PASTE));
	merge_paste_chkbox->SetToolTip(wxT("Pasted tiles won't replace already placed tiles."));

	editor_page->SetSizerAndFit(sizer);

	return editor_page;
}