Пример #1
0
	BattleRoomDownloadProgres(wxWindow* parent, const wxString& str_text)
	    : wxPanel(parent, -1, wxDefaultPosition, wxSize(-1, 80), wxNO_BORDER)
	{
		m_main_sizer = new wxBoxSizer(wxHORIZONTAL);
		{
			wxBoxSizer* m_data_sizer = new wxBoxSizer(wxHORIZONTAL); //wxHORIZONTAL
			{
				m_text = new wxStaticText(this, -1, str_text);
				{
					m_data_sizer->Add(m_text, 0, wxALL, 2);
				}

				m_info = new wxStaticText(this, -1, _(" "), wxDefaultPosition, wxSize(-1, -1), wxALIGN_CENTRE);
				{
					m_data_sizer->Add(m_info, 0, wxALL, 2);
				}
				m_main_sizer->Add(m_data_sizer, 0, wxALL, 2);
			}

			m_progres = new wxGauge(this, -1, 100, wxDefaultPosition, wxDefaultSize, wxGA_SMOOTH | wxGA_HORIZONTAL);
			{
				m_main_sizer->Add((wxWindow*)m_progres, 1, wxALL | wxEXPAND, 2);
			}
			SetSizer(m_main_sizer);
		}
		Layout();
	}
Пример #2
0
void MyFrame::OnNewRestrButton(wxCommandEvent& evt) {
    if(restrEntries.size() >= 6) return;
    
    auto textCtrl = new wxTextCtrl(
        this, wxID_ANY, wxT("Новое ограничение"),
        wxDefaultPosition, wxDefaultSize,
        wxTE_PROCESS_ENTER
    );
    restrEntries.emplace_back(textCtrl);
    textCtrl->Bind(wxEVT_TEXT, &MyFrame::on_text_change, this);
    restrSizer->Add(textCtrl, wxSizerFlags().Expand().Border(wxALL, 5));
    
    restrSizer->SetSizeHints(this);
    Fit();
}
Пример #3
0
bool wxNotificationMessageWindow::AddAction(wxWindowID actionid, const wxString &label)
{
    wxSizer* msgSizer = m_messagePanel->GetSizer();
    if ( m_buttonSizer == NULL )
    {
        msgSizer->Detach(m_closeBtn);
        m_closeBtn->Hide();
        m_buttonSizer = new wxBoxSizer(wxVERTICAL);
        msgSizer->Add(m_buttonSizer, wxSizerFlags(0).Center().Border());
    }

    wxButton* actionButton = new wxButton(m_messagePanel, actionid, label);
    actionButton->Bind(wxEVT_BUTTON, &wxNotificationMessageWindow::OnActionButtonClicked, this);
    PrepareNotificationControl(actionButton, false);
    int borderDir = (m_buttonSizer->GetChildren().empty()) ? 0 : wxTOP;
    m_buttonSizer->Add(actionButton, wxSizerFlags(0).Border(borderDir).Expand());

    return true;
}
Пример #4
0
	void append(T *thing, int proportion = 0, int flag = wxEXPAND|wxTOP|wxBOTTOM, int border = 10)
	{
		content->Add(thing, proportion, flag, border);
	}