Exemplo n.º 1
0
ExeSelectForm::ExeSelectForm(wxWindow* parent, bool hasSeenCDKey, UserCore::ItemManagerI* pItemManager) 
	: gcFrame(parent, wxID_ANY, "#ES_TITLE", wxDefaultPosition, wxSize( 370,150 ), wxCAPTION|wxCLOSE_BOX|wxSYSTEM_MENU|wxWANTS_CHARS|wxMINIMIZE_BOX)
	, m_pItemManager(pItemManager)
	, m_bHasSeenCDKey(hasSeenCDKey)
{
	if (!m_pItemManager)
		m_pItemManager = GetUserCore()->getItemManager();

	m_labInfo = new wxStaticText(this, wxID_ANY, "", wxDefaultPosition, wxDefaultSize, 0 );
	m_pButtonSizer = new wxFlexGridSizer( 8, 2, 0, 0 );

	wxFlexGridSizer* fgSizer1;
	fgSizer1 = new wxFlexGridSizer( 5, 1, 0, 0 );
	fgSizer1->AddGrowableCol( 0 );
	fgSizer1->AddGrowableRow( 2 );
	fgSizer1->AddGrowableRow( 4 );
	fgSizer1->SetFlexibleDirection( wxBOTH );
	fgSizer1->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
	
	fgSizer1->Add( 0, 5, 1, wxEXPAND, 5 );
	fgSizer1->Add( m_labInfo, 0, wxALL, 5 );
	fgSizer1->Add( 0, 0, 1, wxEXPAND, 5 );
	fgSizer1->Add( m_pButtonSizer, 1, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 0 );
	fgSizer1->Add( 0, 0, 1, wxEXPAND, 5 );
	
	this->SetSizer( fgSizer1 );
	this->Layout();
	
	centerOnParent();

	Bind(wxEVT_COMMAND_BUTTON_CLICKED, &ExeSelectForm::onButtonClick, this);
	Bind(wxEVT_CLOSE_WINDOW, &ExeSelectForm::onFormClose, this);
}
Exemplo n.º 2
0
ChangeLogForm::ChangeLogForm( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : gcFrame( parent, id, title, pos, size, style )
{
	this->SetSizeHints( wxSize( 400,300 ), wxDefaultSize );
	
	wxBoxSizer* bSizer1 = new wxBoxSizer( wxVERTICAL );
	wxBoxSizer* bSizer2 = new wxBoxSizer( wxHORIZONTAL );

	m_ieBrowser = new gcMiscWebControl( this, "about:blank", "ChangeLogForm");
	m_butClose = new gcButton( this, wxID_ANY, Managers::GetString(L"#CLOSE"), wxDefaultPosition, wxDefaultSize, 0 );


	bSizer2->Add( 0, 0, 1, wxEXPAND, 5 );
	bSizer2->Add( m_butClose, 0, wxALL, 5 );

	bSizer1->Add( m_ieBrowser, 1, wxLEFT|wxRIGHT|wxTOP|wxEXPAND, 5 );
	bSizer1->Add( bSizer2, 0, wxEXPAND, 5 );
	
	this->SetSizer( bSizer1 );
	this->Layout();

	m_uiItemId = 0;
	m_bApp = false;

	centerOnParent();

	Bind(wxEVT_COMMAND_BUTTON_CLICKED, &ChangeLogForm::onButClick, this);
	Bind(wxEVT_CLOSE_WINDOW, &ChangeLogForm::onFormClose, this);
}
Exemplo n.º 3
0
LaunchItemDialog::LaunchItemDialog( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : gcFrame( parent, id, title, pos, size, style )
{
	this->SetSizeHints( wxDefaultSize, wxDefaultSize );

	m_labItemName = new wxStaticText( this, wxID_ANY, wxT("The [item], [name],"), wxDefaultPosition, wxDefaultSize, 0 );
	m_butLaunch = new gcButton( this, wxID_ANY, Managers::GetString(L"#LAUNCH"), wxDefaultPosition, wxDefaultSize, 0 );
	m_butCancel = new gcButton( this, wxID_ANY, Managers::GetString(L"#CANCEL"), wxDefaultPosition, wxDefaultSize, 0 );

	wxFlexGridSizer* fgSizer1;
	fgSizer1 = new wxFlexGridSizer( 2, 1, 0, 0 );
	fgSizer1->AddGrowableCol( 0 );
	fgSizer1->AddGrowableRow( 0 );
	fgSizer1->SetFlexibleDirection( wxBOTH );
	fgSizer1->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );

	wxBoxSizer* bSizer3 = new wxBoxSizer( wxHORIZONTAL );

	bSizer3->Add( m_labItemName, 0, wxTOP|wxBOTTOM|wxLEFT, 5 );



	wxBoxSizer* bSizer2 = new wxBoxSizer( wxHORIZONTAL );

	bSizer2->Add( 0, 0, 1, wxEXPAND, 5 );
	bSizer2->Add( m_butLaunch, 0, wxTOP|wxBOTTOM|wxLEFT, 5 );
	bSizer2->Add( m_butCancel, 0, wxALL, 5 );

	fgSizer1->Add( bSizer3, 1, wxEXPAND, 5 );
	fgSizer1->Add( bSizer2, 1, wxEXPAND, 5 );

	this->SetSizer( fgSizer1 );
	this->Layout();

	centerOnParent();
}
Exemplo n.º 4
0
UninstallForm::UninstallForm(wxWindow* parent) : gcFrame(parent, wxID_ANY, wxT("Uninstalling item"), wxDefaultPosition, wxSize(370, 140), wxCAPTION|wxCLOSE_BOX|wxFRAME_FLOAT_ON_PARENT|wxSYSTEM_MENU)
{
	m_bsSizer = new wxBoxSizer( wxVERTICAL );
	this->SetSizer( m_bsSizer );
	this->Layout();

	m_pPage = NULL;
	m_bCanClose = true;

	centerOnParent();
}
Exemplo n.º 5
0
GameDiskForm::GameDiskForm(wxWindow* parent, const char* exe, bool cdkey)
	: gcFrame(parent, wxID_ANY, wxT("{0}: Need Game Disk"), wxDefaultPosition, wxSize( 370,145 ), wxDEFAULT_FRAME_STYLE|wxTAB_TRAVERSAL)
{
	this->SetSizeHints( wxDefaultSize, wxDefaultSize );

	m_labInfo = new wxStaticText( this, wxID_ANY, "", wxDefaultPosition, wxDefaultSize, 0 );
	m_labInfo->Wrap( 360 );

	m_cbReminder = new gcCheckBox( this, wxID_ANY, Managers::GetString(L"#GD_REMINDER"), wxDefaultPosition, wxDefaultSize, 0 );
	m_butLaunch = new gcButton( this, wxID_ANY, Managers::GetString(L"#LAUNCH"), wxDefaultPosition, wxDefaultSize, 0 );
	m_butCancel = new gcButton( this, wxID_ANY, Managers::GetString(L"#CANCEL"), wxDefaultPosition, wxDefaultSize, 0 );



	wxBoxSizer* bSizer1 = new wxBoxSizer( wxHORIZONTAL );

	bSizer1->Add( m_cbReminder, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
	bSizer1->Add( 0, 0, 1, wxEXPAND, 5 );
	bSizer1->Add( m_butLaunch, 0, wxTOP|wxBOTTOM|wxLEFT, 5 );
	bSizer1->Add( m_butCancel, 0, wxALL, 5 );


	wxFlexGridSizer* fgSizer1;
	fgSizer1 = new wxFlexGridSizer( 3, 1, 0, 0 );
	fgSizer1->AddGrowableCol( 0 );
	fgSizer1->AddGrowableRow( 1 );
	fgSizer1->SetFlexibleDirection( wxBOTH );
	fgSizer1->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );

	fgSizer1->Add( m_labInfo, 0, wxALL, 5 );
	fgSizer1->Add( 0, 0, 1, wxEXPAND, 5 );
	fgSizer1->Add( bSizer1, 1, wxEXPAND, 5 );


	this->SetSizer( fgSizer1 );
	this->Layout();

	this->Centre( wxBOTH );

	Bind(wxEVT_COMMAND_BUTTON_CLICKED, &GameDiskForm::onButtonClick, this);
	Bind(wxEVT_CLOSE_WINDOW, &GameDiskForm::onFormClose, this);

	m_bHasSeenCDKey = cdkey;
	m_szExe = exe;
	m_pItem = nullptr;

	centerOnParent();
}
Exemplo n.º 6
0
UpdateInfoForm::UpdateInfoForm(wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style) : gcFrame( parent, id, title, pos, size, style )
{
	this->SetSizeHints( wxSize( 400,250 ), wxDefaultSize );
	
	wxFlexGridSizer* fgSizer2;
	fgSizer2 = new wxFlexGridSizer( 4, 1, 0, 0 );
	fgSizer2->AddGrowableCol( 0 );
	fgSizer2->AddGrowableRow( 1 );
	fgSizer2->SetFlexibleDirection( wxBOTH );
	fgSizer2->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
	
	m_labInfo = new wxStaticText( this, wxID_ANY, Managers::GetString(L"#UI_LABEL"), wxDefaultPosition, wxDefaultSize, 0 );
	m_labInfo->Wrap( -1 );
	fgSizer2->Add( m_labInfo, 0, wxTOP|wxLEFT|wxRIGHT, 5 );
	
	m_ieBrowser = new gcMiscWebControl( this, "about:blank", "UpdateInfoForm");
	fgSizer2->Add( m_ieBrowser, 1, wxALL|wxEXPAND, 5 );
	

	m_cbReminder = new gcCheckBox( this, wxID_ANY, Managers::GetString(L"#UI_NO_REMINDER"), wxDefaultPosition, wxDefaultSize, 0 );
	fgSizer2->Add( m_cbReminder, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 );


	m_butUpdate = new gcButton( this, wxID_ANY, Managers::GetString(L"#UPDATE"), wxDefaultPosition, wxDefaultSize, 0 );
	m_butLaunch = new gcButton( this, wxID_ANY, Managers::GetString(L"#LAUNCH"), wxDefaultPosition, wxDefaultSize, 0 );
	nm_butCancel = new gcButton( this, wxID_ANY, Managers::GetString(L"#CANCEL"), wxDefaultPosition, wxDefaultSize, 0 );


	wxBoxSizer* bSizer2 = new wxBoxSizer( wxHORIZONTAL );
	
	bSizer2->Add( 0, 0, 1, wxEXPAND, 5 );
	bSizer2->Add( m_butUpdate, 0, wxTOP|wxBOTTOM|wxLEFT, 5 );
	bSizer2->Add( m_butLaunch, 0, wxTOP|wxBOTTOM|wxLEFT, 5 );
	bSizer2->Add( nm_butCancel, 0, wxALL, 5 );
	
	fgSizer2->Add( bSizer2, 0, wxEXPAND, 5 );
	

	this->SetSizer( fgSizer2 );
	this->Layout();

	m_uiInternId = 0;
	m_bLaunch = true;

	centerOnParent();
}
Exemplo n.º 7
0
CDKeyForm::CDKeyForm(wxWindow* parent, const char* exe, bool launch) : gcFrame(parent, wxID_ANY, wxT("[Item]: CD Key"), wxDefaultPosition, wxSize(370,100), wxCAPTION|wxCLOSE_BOX|wxSYSTEM_MENU|wxTAB_TRAVERSAL)
{
	m_bLaunch = launch;
	m_szExe = exe;

	m_pPage = new CDKProgress(this, m_bLaunch);

	m_bsSizer = new wxBoxSizer( wxVERTICAL );
	m_bsSizer->Add(m_pPage, 1, wxEXPAND, 0);

	this->SetSizer( m_bsSizer );
	this->Layout();
	this->Centre( wxBOTH );

	Bind(wxEVT_CLOSE_WINDOW, &CDKeyForm::onFormClose, this);

	centerOnParent();
}
Exemplo n.º 8
0
ModWizardForm::ModWizardForm(wxWindow* parent) 
	: gcFrame(parent, wxID_ANY, wxT("#MW_TITLE"), wxDefaultPosition, wxSize( 370,160 ), wxCAPTION|wxCLOSE_BOX|wxFRAME_FLOAT_ON_PARENT|wxSYSTEM_MENU|wxTAB_TRAVERSAL)
{
	m_pPage = nullptr;

	SetTitle(Managers::GetString(L"#MW_TITLE"));

	this->SetSizeHints( wxDefaultSize, wxDefaultSize );
	m_bsSizer = new wxBoxSizer( wxVERTICAL );

	m_pPage = new MWInfoPage( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
	m_bsSizer->Add( m_pPage, 1, wxEXPAND, 0 );
	
	this->SetSizer( m_bsSizer );
	this->Layout();

	centerOnParent();

	Bind(wxEVT_CLOSE_WINDOW, &ModWizardForm::onFormClose, this);
}
Exemplo n.º 9
0
ComplexPrompt::ComplexPrompt( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : gcDialog( parent, id, title, pos, size, style )
{
	this->SetSizeHints( wxDefaultSize, wxDefaultSize );
	
	wxFlexGridSizer* fgSizer1;
	fgSizer1 = new wxFlexGridSizer( 3, 1, 0, 0 );
	fgSizer1->AddGrowableCol( 0 );
	fgSizer1->AddGrowableRow( 0 );
	fgSizer1->SetFlexibleDirection( wxBOTH );
	fgSizer1->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
	
	m_labInfo = new wxStaticText( this, wxID_ANY, wxT(""), wxDefaultPosition, wxDefaultSize, 0 );
	m_labInfo->Wrap( 350 );
	fgSizer1->Add( m_labInfo, 0, wxALL, 5 );
	
	
	fgSizer1->Add( 0, 0, 1, wxEXPAND, 5 );
	
	wxBoxSizer* bSizer1;
	bSizer1 = new wxBoxSizer( wxHORIZONTAL );
	
	
	bSizer1->Add( 0, 0, 1, wxEXPAND, 5 );
	
	m_butMoreInfo = new gcButton( this, wxID_ANY, Managers::GetString(L"#MOREINFO"), wxDefaultPosition, wxDefaultSize, 0 );
	bSizer1->Add( m_butMoreInfo, 0, wxTOP|wxBOTTOM|wxLEFT, 5 );
	
	m_butOk = new gcButton( this, wxID_ANY, Managers::GetString(L"#CONTINUE"), wxDefaultPosition, wxDefaultSize, 0 );
	bSizer1->Add( m_butOk, 0, wxTOP|wxBOTTOM|wxLEFT, 5 );
	
	m_butCancel = new gcButton( this, wxID_ANY, Managers::GetString(L"#CANCEL"), wxDefaultPosition, wxDefaultSize, 0 );
	bSizer1->Add( m_butCancel, 0, wxALL, 5 );
	
	fgSizer1->Add( bSizer1, 1, wxEXPAND, 5 );
	
	this->SetSizer( fgSizer1 );
	this->Layout();

	SetTitle(Managers::GetString(L"#IF_CONFLICTTITLE"));
	centerOnParent();
}
Exemplo n.º 10
0
GCUpdateInfo::GCUpdateInfo(wxWindow* parent)
	: gcFrame(parent, wxID_ANY, wxT("#UF_TITLE"), wxDefaultPosition, wxSize( 445,300 ), wxDEFAULT_FRAME_STYLE|wxTAB_TRAVERSAL)
{
	Bind(wxEVT_CLOSE_WINDOW, &GCUpdateInfo::onFormClose, this);
	Bind(wxEVT_COMMAND_BUTTON_CLICKED, &GCUpdateInfo::onButClick, this);

	SetTitle(Managers::GetString(L"#UF_TITLE"));

	m_labInfo = new wxStaticText( this, wxID_ANY, Managers::GetString(L"#UF_INFO"), wxDefaultPosition, wxDefaultSize, 0 );

	m_ieBrowser = new gcMiscWebControl( this, "about:blank", "DesuraUpdate");
	m_ieBrowser->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_ACTIVECAPTION ) );
	m_ieBrowser->onPageLoadEvent += guiDelegate(this, &GCUpdateInfo::onPageLoad);

	m_butRestartNow = new gcButton( this, wxID_ANY, Managers::GetString(L"#UF_RESTART_NOW"), wxDefaultPosition, wxSize( 100,-1 ), 0 );
	m_butRestartLater = new gcButton( this, wxID_ANY, Managers::GetString(L"#UF_RESTART_LATER"), wxDefaultPosition, wxSize( 100,-1 ), 0 );


	wxBoxSizer* bSizer1;
	bSizer1 = new wxBoxSizer( wxHORIZONTAL );
	bSizer1->Add( 0, 0, 1, wxEXPAND, 5 );
	bSizer1->Add( m_butRestartNow, 0, wxTOP|wxBOTTOM|wxLEFT, 5 );
	bSizer1->Add( m_butRestartLater, 0, wxALL, 5 );

	wxFlexGridSizer* fgSizer1;
	fgSizer1 = new wxFlexGridSizer( 3, 1, 0, 0 );
	fgSizer1->AddGrowableCol( 0 );
	fgSizer1->AddGrowableRow( 1 );
	fgSizer1->SetFlexibleDirection( wxBOTH );
	fgSizer1->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );

	fgSizer1->Add( m_labInfo, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT, 5 );
	fgSizer1->Add( m_ieBrowser, 1, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 );
	fgSizer1->Add( bSizer1, 1, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 );
	
	this->SetSizer( fgSizer1 );
	this->Layout();

	centerOnParent();
}
Exemplo n.º 11
0
NewsForm::NewsForm(wxWindow* parent) 
	: gcFrame(parent, wxID_ANY, "[News Form]", wxDefaultPosition, wxSize( 670,600 ), wxDEFAULT_FRAME_STYLE|wxTAB_TRAVERSAL)
{
	Bind(wxEVT_CLOSE_WINDOW, &NewsForm::onFormClose, this);
	Bind(wxEVT_COMMAND_BUTTON_CLICKED, &NewsForm::onButClick, this);

	this->SetSizeHints( wxSize( 400,300 ), wxDefaultSize );

	m_szTitle = Managers::GetString(L"#NF_TITLE");

	m_ieBrowser = new NewsBrowser(this, "about:blank", "NewsForm");
	m_butPrev = new gcButton(this, wxID_ANY, Managers::GetString(L"#NF_PREV"));
	m_butNext = new gcButton(this, wxID_ANY, Managers::GetString(L"#NF_NEXT"));
	m_butClose = new gcButton(this, wxID_ANY, Managers::GetString(L"#CLOSE"));

	
	wxBoxSizer* bSizer4 = new wxBoxSizer( wxHORIZONTAL );
	bSizer4->Add( m_butClose, 0, wxALL, 5 );
	bSizer4->Add( 0, 0, 1, wxEXPAND, 5 );
	bSizer4->Add( m_butPrev, 0, wxTOP|wxBOTTOM|wxLEFT, 5 );
	bSizer4->Add( m_butNext, 0, wxALL, 5 );
	
	wxFlexGridSizer* fgSizer2;
	fgSizer2 = new wxFlexGridSizer( 2, 1, 0, 0 );
	fgSizer2->AddGrowableCol( 0 );
	fgSizer2->AddGrowableRow( 0 );
	fgSizer2->SetFlexibleDirection( wxBOTH );
	fgSizer2->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
	fgSizer2->Add( m_ieBrowser, 1, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 );
	fgSizer2->Add( bSizer4, 1, wxEXPAND, 5 );
	
	this->SetSizer( fgSizer2 );
	this->Layout();

	m_uiSelected = 0;
	centerOnParent();

	m_szLoadingUrl = gcString(GetGCThemeManager()->getWebPage("loading"));
}
Exemplo n.º 12
0
CDKeyForm::CDKeyForm(wxWindow* parent, const char* exe, bool launch, UserCore::ItemManagerI* pItemManager) 
	: gcFrame(parent, wxID_ANY, Managers::GetString("#CDK_TITLE"), wxDefaultPosition, wxSize(370,140), wxCAPTION|wxCLOSE_BOX|wxSYSTEM_MENU|wxTAB_TRAVERSAL)
	, m_pItemManager(pItemManager)
{
	if (!m_pItemManager)
		m_pItemManager = GetUserCore()->getItemManager();

	m_bLaunch = launch;
	m_szExe = exe;

	m_pPage = new CDKProgress(this, m_bLaunch);

	m_bsSizer = new wxBoxSizer( wxVERTICAL );
	m_bsSizer->Add(m_pPage, 1, wxEXPAND, 0);

	this->SetSizer( m_bsSizer );
	this->Layout();
	this->Centre( wxBOTH );

	Bind(wxEVT_CLOSE_WINDOW, &CDKeyForm::onFormClose, this);

	centerOnParent();
}
Exemplo n.º 13
0
InstallBranch::InstallBranch( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : gcDialog( parent, id, title, pos, size, style )
{
	this->SetSizeHints( wxDefaultSize, wxDefaultSize );


	m_labInfo = new wxStaticText( this, wxID_ANY, Managers::GetString(L"#IF_BRANCHINFO"), wxDefaultPosition, wxDefaultSize, 0 );
	m_labInfo->Wrap( 350 );


	wxArrayString m_cbBranchListChoices;
	m_cbBranchList = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_cbBranchListChoices, 0 );
	m_cbBranchList->SetSelection( 0 );

	m_butInfo = new gcButton( this, wxID_ANY, Managers::GetString(L"#MOREINFO"), wxDefaultPosition, wxDefaultSize, 0 );
	m_butInstall = new gcButton( this, wxID_ANY, Managers::GetString(L"#INSTALL"), wxDefaultPosition, wxDefaultSize, 0 );
	m_butCancel = new gcButton( this, wxID_ANY, Managers::GetString(L"#CANCEL"), wxDefaultPosition, wxDefaultSize, 0 );






	wxFlexGridSizer* fgSizer2;
	fgSizer2 = new wxFlexGridSizer( 3, 1, 0, 0 );
	fgSizer2->AddGrowableCol( 0 );
	fgSizer2->AddGrowableRow( 0 );
	fgSizer2->AddGrowableRow( 2 );
	fgSizer2->SetFlexibleDirection( wxBOTH );
	fgSizer2->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
	
	fgSizer2->Add( 0, 0, 1, wxEXPAND, 5 );
	fgSizer2->Add( m_cbBranchList, 1, wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5 );
	fgSizer2->Add( 0, 0, 1, wxEXPAND, 5 );
	



	wxBoxSizer* bSizer1;
	bSizer1 = new wxBoxSizer( wxHORIZONTAL );
	
	bSizer1->Add( 0, 0, 1, wxEXPAND, 5 );
	bSizer1->Add( m_butInfo, 0, wxTOP|wxBOTTOM|wxLEFT, 5 );
	bSizer1->Add( m_butInstall, 0, wxTOP|wxBOTTOM|wxLEFT, 5 );
	bSizer1->Add( m_butCancel, 0, wxALL, 5 );




	wxFlexGridSizer* fgSizer1;
	fgSizer1 = new wxFlexGridSizer( 3, 1, 0, 0 );
	fgSizer1->AddGrowableCol( 0 );
	fgSizer1->AddGrowableRow( 1 );
	fgSizer1->SetFlexibleDirection( wxBOTH );
	fgSizer1->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );

	fgSizer1->Add( m_labInfo, 0, wxALL, 5 );
	fgSizer1->Add( fgSizer2, 1, wxEXPAND, 5 );
	fgSizer1->Add( bSizer1, 1, wxEXPAND, 5 );
	

	this->SetSizer( fgSizer1 );
	this->Layout();

	centerOnParent();
}
Exemplo n.º 14
0
InstallPrompt::InstallPrompt( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : gcDialog( parent, id, title, pos, size, style )
{
	this->SetSizeHints( wxDefaultSize, wxDefaultSize );
	

	m_labQuestion = new wxStaticText( this, wxID_ANY, Managers::GetString(L"#IF_CONFLICT"), wxDefaultPosition, wxSize(-1,30), 0 );
	m_labQuestion->Wrap( 250 );

	wxFlexGridSizer* fgSizer2;
	fgSizer2 = new wxFlexGridSizer( 6, 1, 0, 0 );
	fgSizer2->AddGrowableCol(0);
	fgSizer2->AddGrowableRow(4);
	fgSizer2->SetFlexibleDirection( wxBOTH );
	fgSizer2->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );

	m_butExplorer = new gcButton( this, wxID_ANY, Managers::GetString(L"#IF_SHOWFILES"));
	m_butOk = new gcButton( this, wxID_OK, wxT("Ok"), wxDefaultPosition, wxDefaultSize, 0 );
	m_butCancel = new gcButton( this, wxID_CANCEL, Managers::GetString(L"#CANCEL"), wxDefaultPosition, wxDefaultSize, 0 );


	wxBoxSizer* bSizerD = new wxBoxSizer( wxHORIZONTAL );
	bSizerD->Add( 0, 0, 1, wxEXPAND, 5 );
	bSizerD->Add( m_butExplorer, 0, wxTOP|wxBOTTOM|wxLEFT, 5 );
	bSizerD->Add( m_butOk, 0, wxTOP|wxBOTTOM|wxLEFT, 5 );
	bSizerD->Add( m_butCancel, 0, wxALL, 5 );

#ifdef WIN32
	textA = new gcStaticText(this, wxID_ANY, Managers::GetString(L"#IF_INSTALL_REMOVE"));
	textB = new gcStaticText(this, wxID_ANY, Managers::GetString(L"#IF_INSTALL_LEAVE"));
	textC = new gcStaticText(this, wxID_ANY, Managers::GetString(L"#IF_INSTALL_VERIFY"));

	m_rbInstallRemove = new gcRadioButton( this);
	m_rbInstallLeave = new gcRadioButton( this );
	m_rbInstallVerify = new gcRadioButton( this);

	wxBoxSizer* bSizerA = new wxBoxSizer( wxHORIZONTAL );
	bSizerA->Add(10,0,0,0,0);
	bSizerA->Add( m_rbInstallRemove, 0, 0, 5 );
	bSizerA->Add( textA, 0, wxLEFT, 5 );

	wxBoxSizer* bSizerB = new wxBoxSizer( wxHORIZONTAL );
	bSizerB->Add(10,0,0,0,0);
	bSizerB->Add( m_rbInstallLeave, 0, 0, 5 );
	bSizerB->Add( textB, 0, wxLEFT, 5 );

	wxBoxSizer* bSizerC = new wxBoxSizer( wxHORIZONTAL );
	bSizerC->Add(10,0,0,0,0);
	bSizerC->Add( m_rbInstallVerify, 0, 0, 5 );
	bSizerC->Add( textC, 0, wxLEFT, 5 );

	fgSizer2->Add( m_labQuestion, 0, wxALL|wxEXPAND, 5 );
	fgSizer2->Add( bSizerA, 0, wxLEFT|wxRIGHT|wxTOP|wxEXPAND, 5 );
	fgSizer2->Add( bSizerB, 0, wxLEFT|wxRIGHT|wxTOP|wxEXPAND, 5 );
	fgSizer2->Add( bSizerC, 0, wxLEFT|wxRIGHT|wxTOP|wxEXPAND, 5 );
	fgSizer2->Add(0,0,0,0,0);
	fgSizer2->Add( bSizerD, 0, wxEXPAND, 5 );
#else

	m_rbInstallRemove = new gcCheckBox(this, wxID_ANY, Managers::GetString(L"#IF_INSTALL_REMOVE"));
	m_rbInstallLeave = new gcCheckBox(this, wxID_ANY, Managers::GetString(L"#IF_INSTALL_LEAVE"));
	m_rbInstallVerify = new gcCheckBox(this, wxID_ANY, Managers::GetString(L"#IF_INSTALL_VERIFY"));

	fgSizer2->Add( m_labQuestion, 0, wxALL|wxEXPAND, 5 );
	fgSizer2->Add( m_rbInstallRemove, 0, wxLEFT|wxRIGHT|wxTOP|wxEXPAND, 5 );
	fgSizer2->Add( m_rbInstallLeave, 0, wxLEFT|wxRIGHT|wxTOP|wxEXPAND, 5 );
	fgSizer2->Add( m_rbInstallVerify, 0, wxLEFT|wxRIGHT|wxTOP|wxEXPAND, 5 );
	fgSizer2->Add(0,0,0,0,0);
	fgSizer2->Add( bSizerD, 0, wxEXPAND, 5 );

	Bind(wxEVT_COMMAND_CHECKBOX_CLICKED, &InstallPrompt::onCheckBoxSelect, this);
#endif

	m_rbInstallRemove->SetValue(true);

	this->SetSizer( fgSizer2 );
	this->Layout();

#ifdef WIN32
	textA->Connect( wxEVT_LEFT_DOWN, wxMouseEventHandler( InstallPrompt::onMouseDown ), NULL, this );
	textB->Connect( wxEVT_LEFT_DOWN, wxMouseEventHandler( InstallPrompt::onMouseDown ), NULL, this );
	textC->Connect( wxEVT_LEFT_DOWN, wxMouseEventHandler( InstallPrompt::onMouseDown ), NULL, this );
#endif

	

	centerOnParent();
}
Exemplo n.º 15
0
void Dialog::show() {
	Window::show();
	centerOnParent();
}
Exemplo n.º 16
0
gcMessageDialog::gcMessageDialog(wxWindow* parent, const wxString& message, const wxString& caption, long style, const wxPoint& pos)
    : gcDialog(nullptr, wxID_ANY, caption, pos, wxDefaultSize, wxCAPTION|wxWANTS_CHARS ) //PARENT MUST BE LEFT nullptr. Crashes other wise.
{
    if (style&(wxYES))
        m_bButtonList.push_back(new gcButton(this, wxID_YES, Managers::GetString(L"#YES"), wxDefaultPosition, wxDefaultSize, wxWANTS_CHARS));

    if (style&(wxOK))
        m_bButtonList.push_back(new gcButton(this, wxID_OK, Managers::GetString(L"#OK"), wxDefaultPosition, wxDefaultSize, wxWANTS_CHARS));

    if (style&(wxNO))
        m_bButtonList.push_back(new gcButton(this, wxID_NO, Managers::GetString(L"#NO"), wxDefaultPosition, wxDefaultSize, wxWANTS_CHARS));

    if (style&(wxCANCEL))
        m_bButtonList.push_back(new gcButton(this, wxID_CANCEL, Managers::GetString(L"#CANCEL"), wxDefaultPosition, wxDefaultSize, wxWANTS_CHARS));

    if (style&(wxAPPLY))
        m_bButtonList.push_back(new gcButton(this, wxID_OK, Managers::GetString(L"#APPLY"), wxDefaultPosition, wxDefaultSize, wxWANTS_CHARS));

    if (style&(wxCLOSE))
        m_bButtonList.push_back(new gcButton(this, wxID_OK, Managers::GetString(L"#CLOSE"), wxDefaultPosition, wxDefaultSize, wxWANTS_CHARS));


    m_imgIcon = new gcImageControl( this, wxID_ANY, wxDefaultPosition, wxSize( 48,48 ) );

    int iconmask = (style&wxICON_MASK);

    if (iconmask & wxICON_EXCLAMATION)
    {
        m_imgIcon->setImage(("#icon_warning"));
    }
    else if (iconmask & wxICON_HAND)
    {
        m_imgIcon->setImage(("#icon_hand"));
    }
    else if (iconmask & wxICON_QUESTION)
    {
        m_imgIcon->setImage(("#icon_question"));
    }
    else //if (iconmask & wxICON_INFORMATION)
    {
        m_imgIcon->setImage(("#icon_information"));
    }

    m_labInfo = new wxStaticText( this, wxID_ANY, message, wxDefaultPosition, wxSize( 280 ,-1), 0 );
    m_labInfo->Wrap( 260 );


    wxFlexGridSizer* fgSizer2;
    fgSizer2 = new wxFlexGridSizer( 1, 3, 0, 0 );
    fgSizer2->SetFlexibleDirection( wxBOTH );
    fgSizer2->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
    fgSizer2->Add( m_imgIcon, 0, wxALL, 10 );
    fgSizer2->Add( m_labInfo, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );


    m_bsButtonSizer = new wxBoxSizer( wxHORIZONTAL );
    m_bsButtonSizer->Add( 0, 0, 1, wxEXPAND, 5 );

    for (size_t x=0; x<m_bButtonList.size(); x++)
        m_bsButtonSizer->Add(m_bButtonList[x], 0, wxTOP|wxBOTTOM|wxRIGHT, 5 );

    if (m_bButtonList.size() > 0)
    {
        gcButton* last = m_bButtonList[m_bButtonList.size()-1];

        last->SetFocus();
        last->SetDefault();
    }

    wxFlexGridSizer* fgSizer1;
    fgSizer1 = new wxFlexGridSizer( 2, 1, 0, 0 );
    fgSizer1->AddGrowableCol( 0 );
    fgSizer1->AddGrowableRow( 0 );
    fgSizer1->SetFlexibleDirection( wxBOTH );
    fgSizer1->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
    fgSizer1->Add( fgSizer2, 1, wxEXPAND, 5 );
    fgSizer1->Add( m_bsButtonSizer, 1, wxEXPAND, 5 );

    this->SetSizer(fgSizer1);
    this->SetSize(getBestTextSize());
    this->Layout();

    centerOnParent(parent);

#ifdef NIX
    this->Raise();
#endif

    m_pHelper = nullptr;
    Bind(wxEVT_COMMAND_BUTTON_CLICKED, &gcMessageDialog::onButtonClick, this);
    Bind(wxEVT_CHAR, &gcMessageDialog::onChar, this);

    for (size_t x = 0; x < m_bButtonList.size(); ++x)
    {
        m_bButtonList[x]->Bind(wxEVT_CHAR, &gcMessageDialog::onChar, this);
    }
}