1
0
Fork 0
forked from len0rd/rockbox

fix Tab navigation in rbutil, and make it also look at other places for rbutil.ini.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13603 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Dominik Wenger 2007-06-09 20:34:00 +00:00
parent f3145ba07c
commit 19cc9d063a
8 changed files with 103 additions and 384 deletions

View file

@ -22,7 +22,7 @@
#define CREDITS_H_INCLUDED #define CREDITS_H_INCLUDED
#define RBUTIL_FULLNAME "The Rockbox Utility" #define RBUTIL_FULLNAME "The Rockbox Utility"
#define RBUTIL_VERSION "Version 0.3.2.3" #define RBUTIL_VERSION "Version 0.3.2.4"
static const wxString rbutil_developers[] = { static const wxString rbutil_developers[] = {
wxT("Christi Alice Scarborough"), wxT("Christi Alice Scarborough"),

View file

@ -663,7 +663,7 @@ bool rockboxInstallDlg::TransferDataToWindow()
BuildRadioBox->SetSelection(BUILD_RELEASE); BuildRadioBox->SetSelection(BUILD_RELEASE);
} else { } else {
BuildRadioBox->Enable(BUILD_RELEASE, false); BuildRadioBox->Enable(BUILD_RELEASE, false);
BuildRadioBox->SetSelection(BUILD_DAILY); BuildRadioBox->SetSelection(BUILD_BLEEDING);
} }
wxPostEvent(this, updateradiobox); wxPostEvent(this, updateradiobox);

View file

@ -1,8 +1,8 @@
#define RBUTIL 1 #define RBUTIL 1
#include <wx/msw/wx.rc> #include <wx/msw/wx.rc>
RBUTIL VERSIONINFO RBUTIL VERSIONINFO
FILEVERSION 0,3,2,3 FILEVERSION 0,3,2,4
PRODUCTVERSION 0,3,2,3 PRODUCTVERSION 0,3,2,4
FILEOS 0x00000004 FILEOS 0x00000004
FILETYPE 0x00000001 FILETYPE 0x00000001
BEGIN BEGIN
@ -10,8 +10,8 @@ BEGIN
BEGIN BEGIN
BLOCK "FFFF0000" BLOCK "FFFF0000"
BEGIN BEGIN
VALUE "FileVersion", "0.3.2.3\0" VALUE "FileVersion", "0.3.2.4\0"
VALUE "ProductVersion", "0.3.2.3\0" VALUE "ProductVersion", "0.3.2.4\0"
VALUE "CompanyName", "Rockbox Team\0" VALUE "CompanyName", "Rockbox Team\0"
VALUE "FileDescription", "Rockbox Utility\0" VALUE "FileDescription", "Rockbox Utility\0"
VALUE "InternalName", "rbutil\0" VALUE "InternalName", "rbutil\0"

View file

@ -123,20 +123,19 @@ bool rbutilFrmApp::ReadGlobalConfig(rbutilFrm* myFrame)
wxLogVerbose(wxT("=== begin rbutilFrmApp::ReadGlobalConfig(%p)"), wxLogVerbose(wxT("=== begin rbutilFrmApp::ReadGlobalConfig(%p)"),
(void*) myFrame); (void*) myFrame);
// Cross-platform compatibility: look for rbutil.ini in the same dir as the // Cross-platform compatibility: look for rbutil.ini in then in the app dir
// executable before trying the standard data directory. On Windows these // then in the user config dir (linux ~/) and
// are of course the same directory. // then config dir (linux /etc/ )
buf.Printf(wxT("%s" PATH_SEP "rbutil.ini"), gv->AppDir.c_str() );
// if (! wxFileExists(buf) ) buf.Printf(wxT("%s" PATH_SEP "rbutil.ini"), gv->AppDir.c_str() );
// { if (! wxFileExists(buf) )
// gv->ResourceDir = gv->stdpaths->GetResourcesDir(); {
// buf.Printf(wxT("%s" PATH_SEP "rbutil.ini"), buf.Printf(wxT("%s" PATH_SEP ".rbutil" PATH_SEP "rbutil.ini"), gv->stdpaths->GetUserConfigDir().c_str() );
// gv->ResourceDir.c_str() ); if (! wxFileExists(buf) )
// } else {
// { buf.Printf(wxT("%s" PATH_SEP "rbutil.ini"), gv->stdpaths->GetConfigDir().c_str() );
// gv->ResourceDir = gv->AppDir; }
// } }
wxFileInputStream* cfgis = new wxFileInputStream(buf); wxFileInputStream* cfgis = new wxFileInputStream(buf);

View file

@ -52,17 +52,17 @@ wxSize ImageCtrl::DoGetBestSize() const
//// Theme Control //// Theme Control
////////////////////////////////////////////// //////////////////////////////////////////////
BEGIN_EVENT_TABLE(ThemeCtrl, wxControl) BEGIN_EVENT_TABLE(ThemeCtrl, wxPanel)
EVT_LISTBOX(ID_THEME_LST, ThemeCtrl::OnThemesLst) EVT_LISTBOX(ID_THEME_LST, ThemeCtrl::OnThemesLst)
END_EVENT_TABLE() END_EVENT_TABLE()
IMPLEMENT_DYNAMIC_CLASS(ThemeCtrl, wxControl) IMPLEMENT_DYNAMIC_CLASS(ThemeCtrl, wxPanel)
bool ThemeCtrl::Create(wxWindow* parent, wxWindowID id, bool ThemeCtrl::Create(wxWindow* parent, wxWindowID id,
const wxPoint& pos, const wxSize& size, long style, const wxPoint& pos, const wxSize& size, long style,
const wxValidator& validator) const wxString title )
{ {
if (!wxControl::Create(parent, id, pos, size, style, validator)) return false; if (!wxPanel::Create(parent, id, pos, size, style, title)) return false;
CreateControls(); CreateControls();
@ -291,17 +291,17 @@ void ThemeCtrl::OnThemesLst(wxCommandEvent& event)
//// Ok Cancel Control //// Ok Cancel Control
////////////////////////////////////////////// //////////////////////////////////////////////
BEGIN_EVENT_TABLE(OkCancelCtrl, wxControl) BEGIN_EVENT_TABLE(OkCancelCtrl, wxPanel)
END_EVENT_TABLE() END_EVENT_TABLE()
IMPLEMENT_DYNAMIC_CLASS(OkCancelCtrl, wxControl) IMPLEMENT_DYNAMIC_CLASS(OkCancelCtrl, wxPanel)
bool OkCancelCtrl::Create(wxWindow* parent, wxWindowID id, bool OkCancelCtrl::Create(wxWindow* parent, wxWindowID id,
const wxPoint& pos, const wxSize& size, long style, const wxPoint& pos, const wxSize& size, long style,
const wxValidator& validator) const wxString title)
{ {
if (!wxControl::Create(parent, id, pos, size, style, validator)) return false; if (!wxPanel::Create(parent, id, pos, size, style, title)) return false;
CreateControls(); CreateControls();
GetSizer()->Fit(this); GetSizer()->Fit(this);
@ -333,23 +333,23 @@ void OkCancelCtrl::CreateControls()
//// Device Selector //// Device Selector
////////////////////////////////////////////// //////////////////////////////////////////////
BEGIN_EVENT_TABLE(DeviceSelectorCtrl, wxControl) BEGIN_EVENT_TABLE(DeviceSelectorCtrl, wxPanel)
EVT_BUTTON(ID_AUTODETECT_BTN, DeviceSelectorCtrl::OnAutoDetect) EVT_BUTTON(ID_AUTODETECT_BTN, DeviceSelectorCtrl::OnAutoDetect)
EVT_COMBOBOX(ID_DEVICE_CBX,DeviceSelectorCtrl::OnComboBox) EVT_COMBOBOX(ID_DEVICE_CBX,DeviceSelectorCtrl::OnComboBox)
END_EVENT_TABLE() END_EVENT_TABLE()
IMPLEMENT_DYNAMIC_CLASS(DeviceSelectorCtrl, wxControl) IMPLEMENT_DYNAMIC_CLASS(DeviceSelectorCtrl, wxPanel)
bool DeviceSelectorCtrl::Create(wxWindow* parent, wxWindowID id, bool DeviceSelectorCtrl::Create(wxWindow* parent, wxWindowID id,
const wxPoint& pos, const wxSize& size, long style, const wxPoint& pos, const wxSize& size, long style,
const wxValidator& validator) const wxString title)
{ {
if (!wxControl::Create(parent, id, pos, size, style, validator)) return false; if (!wxPanel::Create(parent, id, pos, size, style, title)) return false;
CreateControls(); CreateControls();
GetSizer()->Fit(this); GetSizer()->Fit(this);
GetSizer()->SetSizeHints(this); GetSizer()->SetSizeHints(this);
return true; return true;
} }
void DeviceSelectorCtrl::CreateControls() void DeviceSelectorCtrl::CreateControls()
@ -359,7 +359,6 @@ void DeviceSelectorCtrl::CreateControls()
this->SetSizer(topSizer); this->SetSizer(topSizer);
//Device Selection //Device Selection
wxBoxSizer* horizontalSizer = new wxBoxSizer(wxHORIZONTAL); wxBoxSizer* horizontalSizer = new wxBoxSizer(wxHORIZONTAL);
topSizer->Add(horizontalSizer, 0, wxALIGN_LEFT|wxALL, 5); topSizer->Add(horizontalSizer, 0, wxALIGN_LEFT|wxALL, 5);
m_desc = new wxStaticText( this, wxID_STATIC, m_desc = new wxStaticText( this, wxID_STATIC,
@ -367,7 +366,7 @@ void DeviceSelectorCtrl::CreateControls()
wxDefaultSize, 0 ); wxDefaultSize, 0 );
horizontalSizer->Add(m_desc, 0, wxALIGN_LEFT|wxALL, 5); horizontalSizer->Add(m_desc, 0, wxALIGN_LEFT|wxALL, 5);
m_deviceCbx = new wxComboBox(this, ID_DEVICE_CBX,wxT(""), m_deviceCbx = new wxComboBox(this, ID_DEVICE_CBX,wxT("Select your Device"),
wxDefaultPosition,wxDefaultSize,gv->plat_name,wxCB_READONLY); wxDefaultPosition,wxDefaultSize,gv->plat_name,wxCB_READONLY);
m_deviceCbx->SetToolTip(wxT("Select your Device.")); m_deviceCbx->SetToolTip(wxT("Select your Device."));
@ -379,8 +378,9 @@ void DeviceSelectorCtrl::CreateControls()
wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator,
wxT("AutodetectBtn")); wxT("AutodetectBtn"));
m_autodetectBtn->SetToolTip(wxT("Autodetection of the Device.")); m_autodetectBtn->SetToolTip(wxT("Click here to autodetect your Device."));
m_autodetectBtn->SetHelpText(wxT("Autodetection of the Device.")); m_autodetectBtn->SetHelpText(wxT("Autodetection of the Device."));
// m_autodetectBtn->SetFocus();
horizontalSizer->Add(m_autodetectBtn,0,wxGROW | wxALL,5); horizontalSizer->Add(m_autodetectBtn,0,wxGROW | wxALL,5);
Layout(); Layout();
@ -457,17 +457,17 @@ void DeviceSelectorCtrl::OnAutoDetect(wxCommandEvent& event)
//// DevicePosition Selector //// DevicePosition Selector
////////////////////////////////////////////// //////////////////////////////////////////////
BEGIN_EVENT_TABLE(DevicePositionCtrl, wxControl) BEGIN_EVENT_TABLE(DevicePositionCtrl, wxPanel)
EVT_BUTTON(ID_BROWSE_BTN, DevicePositionCtrl::OnBrowseBtn) EVT_BUTTON(ID_BROWSE_BTN, DevicePositionCtrl::OnBrowseBtn)
END_EVENT_TABLE() END_EVENT_TABLE()
IMPLEMENT_DYNAMIC_CLASS(DevicePositionCtrl, wxControl) IMPLEMENT_DYNAMIC_CLASS(DevicePositionCtrl, wxPanel)
bool DevicePositionCtrl::Create(wxWindow* parent, wxWindowID id, bool DevicePositionCtrl::Create(wxWindow* parent, wxWindowID id,
const wxPoint& pos, const wxSize& size, long style, const wxPoint& pos, const wxSize& size, long style,
const wxValidator& validator) const wxString title)
{ {
if (!wxControl::Create(parent, id, pos, size, style, validator)) return false; if (!wxPanel::Create(parent, id, pos, size, style, title)) return false;
CreateControls(); CreateControls();
GetSizer()->Fit(this); GetSizer()->Fit(this);
@ -491,8 +491,8 @@ void DevicePositionCtrl::CreateControls()
topSizer->Add(horizontalSizer, 0, wxGROW|wxALL, 5); topSizer->Add(horizontalSizer, 0, wxGROW|wxALL, 5);
m_devicePos = new wxTextCtrl(this,wxID_ANY,gv->curdestdir); m_devicePos = new wxTextCtrl(this,wxID_ANY,gv->curdestdir);
m_devicePos->SetToolTip(wxT("Select your Devicefolder")); m_devicePos->SetToolTip(wxT("Type the folder where your Device is here"));
m_devicePos->SetHelpText(wxT("Select your Devicefolder")); m_devicePos->SetHelpText(wxT("Type the folder where your Device is here"));
horizontalSizer->Add(m_devicePos,0,wxGROW | wxALL,5); horizontalSizer->Add(m_devicePos,0,wxGROW | wxALL,5);
m_browseBtn = new wxButton(this, ID_BROWSE_BTN, wxT("Browse"), m_browseBtn = new wxButton(this, ID_BROWSE_BTN, wxT("Browse"),
@ -534,7 +534,7 @@ void DevicePositionCtrl::OnBrowseBtn(wxCommandEvent& event)
//// FirmwarePosition Selector //// FirmwarePosition Selector
////////////////////////////////////////////// //////////////////////////////////////////////
BEGIN_EVENT_TABLE(FirmwarePositionCtrl, wxControl) BEGIN_EVENT_TABLE(FirmwarePositionCtrl, wxPanel)
EVT_BUTTON(ID_BROWSE_BTN, FirmwarePositionCtrl::OnBrowseBtn) EVT_BUTTON(ID_BROWSE_BTN, FirmwarePositionCtrl::OnBrowseBtn)
END_EVENT_TABLE() END_EVENT_TABLE()
@ -542,9 +542,9 @@ IMPLEMENT_DYNAMIC_CLASS(FirmwarePositionCtrl, wxControl)
bool FirmwarePositionCtrl::Create(wxWindow* parent, wxWindowID id, bool FirmwarePositionCtrl::Create(wxWindow* parent, wxWindowID id,
const wxPoint& pos, const wxSize& size, long style, const wxPoint& pos, const wxSize& size, long style,
const wxValidator& validator) const wxString title)
{ {
if (!wxControl::Create(parent, id, pos, size, style, validator)) return false; if (!wxPanel::Create(parent, id, pos, size, style, title)) return false;
CreateControls(); CreateControls();
GetSizer()->Fit(this); GetSizer()->Fit(this);
@ -568,8 +568,8 @@ void FirmwarePositionCtrl::CreateControls()
topSizer->Add(horizontalSizer, 0, wxALIGN_LEFT|wxALL, 5); topSizer->Add(horizontalSizer, 0, wxALIGN_LEFT|wxALL, 5);
m_firmwarePos = new wxTextCtrl(this,wxID_ANY,gv->curdestdir); m_firmwarePos = new wxTextCtrl(this,wxID_ANY,gv->curdestdir);
m_firmwarePos->SetToolTip(wxT("Select the original Firmware")); m_firmwarePos->SetToolTip(wxT("Type the folder where the original Firmware is here"));
m_firmwarePos->SetHelpText(wxT("Select the original Firmware")); m_firmwarePos->SetHelpText(wxT("Type the folder where the original Firmware is here"));
horizontalSizer->Add(m_firmwarePos,0,wxGROW | wxALL,5); horizontalSizer->Add(m_firmwarePos,0,wxGROW | wxALL,5);
m_browseBtn = new wxButton(this, ID_BROWSE_BTN, wxT("Browse"), m_browseBtn = new wxButton(this, ID_BROWSE_BTN, wxT("Browse"),

View file

@ -39,7 +39,7 @@ protected:
}; };
class ThemeCtrl: public wxControl class ThemeCtrl: public wxPanel
{ {
DECLARE_DYNAMIC_CLASS(ThemeCtrl) DECLARE_DYNAMIC_CLASS(ThemeCtrl)
DECLARE_EVENT_TABLE() DECLARE_EVENT_TABLE()
@ -58,18 +58,18 @@ public:
ThemeCtrl(wxWindow* parent, wxWindowID id, ThemeCtrl(wxWindow* parent, wxWindowID id,
const wxPoint& pos = wxDefaultPosition, const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, const wxSize& size = wxDefaultSize,
long style = wxNO_BORDER, long style = wxNO_BORDER|wxTAB_TRAVERSAL,
const wxValidator& validator = wxDefaultValidator) const wxString title = wxT(""))
{ {
Init(); Init();
Create(parent, id, pos, size, style, validator); Create(parent, id, pos, size, style, title);
} }
// Creation // Creation
bool Create(wxWindow* parent, wxWindowID id, bool Create(wxWindow* parent, wxWindowID id,
const wxPoint& pos = wxDefaultPosition, const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, const wxSize& size = wxDefaultSize,
long style = wxNO_BORDER, long style = wxNO_BORDER|wxTAB_TRAVERSAL,
const wxValidator& validator = wxDefaultValidator); const wxString title = wxT(""));
// Creates the controls and sizers // Creates the controls and sizers
void CreateControls(); void CreateControls();
@ -100,7 +100,7 @@ protected:
}; };
class OkCancelCtrl: public wxControl class OkCancelCtrl: public wxPanel
{ {
DECLARE_DYNAMIC_CLASS(OkCancelCtrl) DECLARE_DYNAMIC_CLASS(OkCancelCtrl)
DECLARE_EVENT_TABLE() DECLARE_EVENT_TABLE()
@ -111,18 +111,18 @@ public:
OkCancelCtrl(wxWindow* parent, wxWindowID id, OkCancelCtrl(wxWindow* parent, wxWindowID id,
const wxPoint& pos = wxDefaultPosition, const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, const wxSize& size = wxDefaultSize,
long style = wxNO_BORDER, long style = wxNO_BORDER|wxTAB_TRAVERSAL,
const wxValidator& validator = wxDefaultValidator) const wxString title = wxT(""))
{ {
Init(); Init();
Create(parent, id, pos, size, style, validator); Create(parent, id, pos, size, style, title);
} }
// Creation // Creation
bool Create(wxWindow* parent, wxWindowID id, bool Create(wxWindow* parent, wxWindowID id,
const wxPoint& pos = wxDefaultPosition, const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, const wxSize& size = wxDefaultSize,
long style = wxNO_BORDER, long style = wxNO_BORDER|wxTAB_TRAVERSAL,
const wxValidator& validator = wxDefaultValidator); const wxString title = wxT(""));
// Creates the controls and sizers // Creates the controls and sizers
void CreateControls(); void CreateControls();
@ -135,7 +135,7 @@ protected:
}; };
class DeviceSelectorCtrl: public wxControl class DeviceSelectorCtrl: public wxPanel
{ {
DECLARE_DYNAMIC_CLASS(DeviceSelectorCtrl) DECLARE_DYNAMIC_CLASS(DeviceSelectorCtrl)
DECLARE_EVENT_TABLE() DECLARE_EVENT_TABLE()
@ -151,17 +151,17 @@ public:
DeviceSelectorCtrl(wxWindow* parent, wxWindowID id, DeviceSelectorCtrl(wxWindow* parent, wxWindowID id,
const wxPoint& pos = wxDefaultPosition, const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, const wxSize& size = wxDefaultSize,
long style = wxNO_BORDER, long style = wxNO_BORDER|wxTAB_TRAVERSAL,
const wxValidator& validator = wxDefaultValidator) const wxString title = wxT(""))
{ {
Create(parent, id, pos, size, style, validator); Create(parent, id, pos, size, style, title);
} }
// Creation // Creation
bool Create(wxWindow* parent, wxWindowID id, bool Create(wxWindow* parent, wxWindowID id,
const wxPoint& pos = wxDefaultPosition, const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, const wxSize& size = wxDefaultSize,
long style = wxNO_BORDER, long style = wxNO_BORDER|wxTAB_TRAVERSAL,
const wxValidator& validator = wxDefaultValidator); const wxString title = wxT(""));
// Creates the controls and sizers // Creates the controls and sizers
void CreateControls(); void CreateControls();
@ -181,7 +181,7 @@ protected:
}; };
class DevicePositionCtrl: public wxControl class DevicePositionCtrl: public wxPanel
{ {
DECLARE_DYNAMIC_CLASS(DevicePositionCtrl) DECLARE_DYNAMIC_CLASS(DevicePositionCtrl)
DECLARE_EVENT_TABLE() DECLARE_EVENT_TABLE()
@ -196,18 +196,18 @@ public:
DevicePositionCtrl(wxWindow* parent, wxWindowID id, DevicePositionCtrl(wxWindow* parent, wxWindowID id,
const wxPoint& pos = wxDefaultPosition, const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, const wxSize& size = wxDefaultSize,
long style = wxNO_BORDER, long style = wxNO_BORDER|wxTAB_TRAVERSAL,
const wxValidator& validator = wxDefaultValidator) const wxString title = wxT(""))
{ {
Init(); Init();
Create(parent, id, pos, size, style, validator); Create(parent, id, pos, size, style, title);
} }
// Creation // Creation
bool Create(wxWindow* parent, wxWindowID id, bool Create(wxWindow* parent, wxWindowID id,
const wxPoint& pos = wxDefaultPosition, const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, const wxSize& size = wxDefaultSize,
long style = wxNO_BORDER, long style = wxNO_BORDER|wxTAB_TRAVERSAL,
const wxValidator& validator = wxDefaultValidator); const wxString title = wxT(""));
// Creates the controls and sizers // Creates the controls and sizers
void CreateControls(); void CreateControls();
@ -228,7 +228,7 @@ protected:
}; };
class FirmwarePositionCtrl: public wxControl class FirmwarePositionCtrl: public wxPanel
{ {
DECLARE_DYNAMIC_CLASS(FirmwarePositionCtrl) DECLARE_DYNAMIC_CLASS(FirmwarePositionCtrl)
DECLARE_EVENT_TABLE() DECLARE_EVENT_TABLE()
@ -243,300 +243,18 @@ public:
FirmwarePositionCtrl(wxWindow* parent, wxWindowID id, FirmwarePositionCtrl(wxWindow* parent, wxWindowID id,
const wxPoint& pos = wxDefaultPosition, const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, const wxSize& size = wxDefaultSize,
long style = wxNO_BORDER, long style = wxNO_BORDER|wxTAB_TRAVERSAL,
const wxValidator& validator = wxDefaultValidator) const wxString title = wxT(""))
{ {
Init(); Init();
Create(parent, id, pos, size, style, validator); Create(parent, id, pos, size, style, title);
} }
// Creation // Creation
bool Create(wxWindow* parent, wxWindowID id, bool Create(wxWindow* parent, wxWindowID id,
const wxPoint& pos = wxDefaultPosition, const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, const wxSize& size = wxDefaultSize,
long style = wxNO_BORDER, long style = wxNO_BORDER|wxTAB_TRAVERSAL,
const wxValidator& validator = wxDefaultValidator); const wxString title = wxT(""));
// Creates the controls and sizers
void CreateControls();
// Common initialization
void Init() { }
// Event handlers
void OnBrowseBtn(wxCommandEvent& event);
// Accessors
wxString getFirmwarePos();
void setDefault();
protected:
wxTextCtrl* m_firmwarePos;
wxStaticText* m_desc;
wxButton* m_browseBtn;
};
#endif
#ifndef RBUTILCTRLS_H_INCLUDED
#define RBUTILCTRLS_H_INCLUDED
#include "rbutil.h"
class ImageCtrl: public wxControl
{
DECLARE_DYNAMIC_CLASS(ImageCtrl)
DECLARE_EVENT_TABLE()
public:
// Constructors
ImageCtrl() { }
ImageCtrl(wxWindow* parent, wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxNO_BORDER,
const wxValidator& validator = wxDefaultValidator)
{
Create(parent, id, pos, size, style, validator);
}
// Creation
bool Create(wxWindow* parent, wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxNO_BORDER,
const wxValidator& validator = wxDefaultValidator);
// Event handlers
void OnPaint(wxPaintEvent& event);
wxSize DoGetBestSize() const ;
void SetBitmap(wxBitmap bmp);
protected:
wxBitmap m_bitmap;
};
class ThemeCtrl: public wxControl
{
DECLARE_DYNAMIC_CLASS(ThemeCtrl)
DECLARE_EVENT_TABLE()
public:
enum {
ID_DESC = 10001,
ID_FILESIZE= 10002,
ID_INSTALLCHECKBOX= 10003,
ID_PREVIEW_BITMAP = 10004,
ID_THEME_LST = 10005,
}; //End of Enum
public:
// Constructors
ThemeCtrl() { Init(); }
ThemeCtrl(wxWindow* parent, wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxNO_BORDER,
const wxValidator& validator = wxDefaultValidator)
{
Init();
Create(parent, id, pos, size, style, validator);
}
// Creation
bool Create(wxWindow* parent, wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxNO_BORDER,
const wxValidator& validator = wxDefaultValidator);
// Creates the controls and sizers
void CreateControls();
// Common initialization
void Init();
// Event handlers
void OnThemesLst(wxCommandEvent& event);
void OnCheckBox(wxCommandEvent& event);
void setDevice(wxString device);
wxArrayString getThemesToInstall();
protected:
wxString m_currentimage;
wxString m_currentResolution;
wxStaticText* m_desc;
wxListBox* m_themeList;
wxStaticText* m_size;
wxStaticText* m_themedesc;
ImageCtrl* m_PreviewBitmap;
wxArrayString m_Themes;
wxArrayString m_Themes_path;
wxArrayString m_Themes_size;
wxArrayString m_Themes_image;
wxArrayString m_Themes_desc;
wxCriticalSection m_setDeviceSection;
wxCriticalSection m_ThemeSelectSection;
};
class OkCancelCtrl: public wxControl
{
DECLARE_DYNAMIC_CLASS(OkCancelCtrl)
DECLARE_EVENT_TABLE()
public:
// Constructors
OkCancelCtrl() { Init(); }
OkCancelCtrl(wxWindow* parent, wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxNO_BORDER,
const wxValidator& validator = wxDefaultValidator)
{
Init();
Create(parent, id, pos, size, style, validator);
}
// Creation
bool Create(wxWindow* parent, wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxNO_BORDER,
const wxValidator& validator = wxDefaultValidator);
// Creates the controls and sizers
void CreateControls();
// Common initialization
void Init() { }
protected:
wxButton* m_OkBtn;
wxButton* m_CancelBtn;
};
class DeviceSelectorCtrl: public wxControl
{
DECLARE_DYNAMIC_CLASS(DeviceSelectorCtrl)
DECLARE_EVENT_TABLE()
public:
enum {
ID_DEVICE_CBX = 10001,
ID_AUTODETECT_BTN= 10002,
}; //End of Enum
public:
// Constructors
DeviceSelectorCtrl() { }
DeviceSelectorCtrl(wxWindow* parent, wxWindowID id,bool bootmode,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxNO_BORDER,
const wxValidator& validator = wxDefaultValidator)
{
Create(parent, id,bootmode, pos, size, style, validator);
}
// Creation
bool Create(wxWindow* parent, wxWindowID id,bool bootmode,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxNO_BORDER,
const wxValidator& validator = wxDefaultValidator);
// Creates the controls and sizers
void CreateControls(bool bootmode);
// Event handlers
void OnAutoDetect(wxCommandEvent& event);
void OnComboBox(wxCommandEvent& event);
// Accessors
wxString getDevice();
void setDefault();
protected:
wxString m_currentDevice;
wxComboBox* m_deviceCbx;
wxStaticText* m_desc;
wxButton* m_autodetectBtn;
};
class DevicePositionCtrl: public wxControl
{
DECLARE_DYNAMIC_CLASS(DevicePositionCtrl)
DECLARE_EVENT_TABLE()
public:
enum {
ID_BROWSE_BTN = 10003,
}; //End of Enum
public:
// Constructors
DevicePositionCtrl() { Init(); }
DevicePositionCtrl(wxWindow* parent, wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxNO_BORDER,
const wxValidator& validator = wxDefaultValidator)
{
Init();
Create(parent, id, pos, size, style, validator);
}
// Creation
bool Create(wxWindow* parent, wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxNO_BORDER,
const wxValidator& validator = wxDefaultValidator);
// Creates the controls and sizers
void CreateControls();
// Common initialization
void Init() { }
// Event handlers
void OnBrowseBtn(wxCommandEvent& event);
// Accessors
wxString getDevicePos();
void setDefault();
protected:
wxTextCtrl* m_devicePos;
wxStaticText* m_desc;
wxButton* m_browseBtn;
};
class FirmwarePositionCtrl: public wxControl
{
DECLARE_DYNAMIC_CLASS(FirmwarePositionCtrl)
DECLARE_EVENT_TABLE()
public:
enum {
ID_BROWSE_BTN = 10004,
}; //End of Enum
public:
// Constructors
FirmwarePositionCtrl() { Init(); }
FirmwarePositionCtrl(wxWindow* parent, wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxNO_BORDER,
const wxValidator& validator = wxDefaultValidator)
{
Init();
Create(parent, id, pos, size, style, validator);
}
// Creation
bool Create(wxWindow* parent, wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxNO_BORDER,
const wxValidator& validator = wxDefaultValidator);
// Creates the controls and sizers // Creates the controls and sizers
void CreateControls(); void CreateControls();

View file

@ -89,12 +89,15 @@ void rbutilFrm::CreateGUIControls(void)
wxBitmap rockboxbmp(rblogo_xpm); wxBitmap rockboxbmp(rblogo_xpm);
ImageCtrl* rockboxbmpCtrl = new ImageCtrl(mainPanel,wxID_ANY); ImageCtrl* rockboxbmpCtrl = new ImageCtrl(mainPanel,wxID_ANY);
rockboxbmpCtrl->SetBitmap(rockboxbmp); rockboxbmpCtrl->SetBitmap(rockboxbmp);
WxBoxSizer0->Add(rockboxbmpCtrl,0,wxALIGN_CENTER_HORIZONTAL | wxALL,5); WxBoxSizer0->Add(rockboxbmpCtrl,0,wxALIGN_CENTER_HORIZONTAL | wxALL,5);
myDeviceSelector = new DeviceSelectorCtrl(mainPanel,wxID_ANY); myDeviceSelector = new DeviceSelectorCtrl(mainPanel,wxID_ANY);
myDeviceSelector->setDefault(); myDeviceSelector->setDefault();
WxBoxSizer0->Add(myDeviceSelector,0,wxGROW|wxALL,5); WxBoxSizer0->Add(myDeviceSelector,0,wxGROW|wxALL,5);
wxNotebook* tabwindow = new wxNotebook(mainPanel,wxID_ANY); wxNotebook* tabwindow = new wxNotebook(mainPanel,wxID_ANY);
WxBoxSizer0->Add(tabwindow,1,wxGROW|wxALL,5); WxBoxSizer0->Add(tabwindow,1,wxGROW|wxALL,5);
@ -128,8 +131,7 @@ void rbutilFrm::CreateGUIControls(void)
WxBitmapButton4 = new wxBitmapButton(installpage, ID_BOOTLOADER_BTN, WxBitmapButton4 = new wxBitmapButton(installpage, ID_BOOTLOADER_BTN,
BootloaderInstallButton, wxPoint(0,0), wxSize(64,54), BootloaderInstallButton, wxPoint(0,0), wxSize(64,54),
wxRAISED_BORDER | wxBU_AUTODRAW); wxRAISED_BORDER | wxBU_AUTODRAW);
WxBitmapButton4->SetToolTip(wxT("Instructions for installing the " WxBitmapButton4->SetToolTip(wxT("Click here to install the Rockbox bootloader"));
"Rockbox bootloader on your audio device"));
WxFlexGridSizer1->Add(WxBitmapButton4, 0, WxFlexGridSizer1->Add(WxBitmapButton4, 0,
wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL | wxALL,5); wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL | wxALL,5);
@ -146,7 +148,7 @@ void rbutilFrm::CreateGUIControls(void)
WxBitmapButton1_BITMAP, wxPoint(0,0), wxSize(64,54), WxBitmapButton1_BITMAP, wxPoint(0,0), wxSize(64,54),
wxRAISED_BORDER | wxBU_AUTODRAW, wxDefaultValidator, wxRAISED_BORDER | wxBU_AUTODRAW, wxDefaultValidator,
wxT("WxBitmapButton1")); wxT("WxBitmapButton1"));
WxBitmapButton1->SetToolTip(wxT("Install Rockbox")); WxBitmapButton1->SetToolTip(wxT("Click here to install Rockbox"));
WxFlexGridSizer1->Add(WxBitmapButton1,0, WxFlexGridSizer1->Add(WxBitmapButton1,0,
wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL | wxALL,5); wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL | wxALL,5);
@ -176,7 +178,7 @@ void rbutilFrm::CreateGUIControls(void)
WxBitmapButton3 = new wxBitmapButton(themepage, ID_FONT_BTN, WxBitmapButton3 = new wxBitmapButton(themepage, ID_FONT_BTN,
FontInstallButton, wxPoint(0,0), wxSize(64,54), FontInstallButton, wxPoint(0,0), wxSize(64,54),
wxRAISED_BORDER | wxBU_AUTODRAW); wxRAISED_BORDER | wxBU_AUTODRAW);
WxBitmapButton3->SetToolTip(wxT("Download the most up to date " WxBitmapButton3->SetToolTip(wxT("Click here to install the most up to date "
"Rockbox fonts.")); "Rockbox fonts."));
WxFlexGridSizer2->Add(WxBitmapButton3, 0, WxFlexGridSizer2->Add(WxBitmapButton3, 0,
wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL | wxALL,5); wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL | wxALL,5);
@ -193,7 +195,7 @@ void rbutilFrm::CreateGUIControls(void)
WxBitmapButton5 = new wxBitmapButton(themepage, ID_THEMES_BTN, WxBitmapButton5 = new wxBitmapButton(themepage, ID_THEMES_BTN,
ThemesInstallButton, wxPoint(0,0), wxSize(64,54), ThemesInstallButton, wxPoint(0,0), wxSize(64,54),
wxRAISED_BORDER | wxBU_AUTODRAW); wxRAISED_BORDER | wxBU_AUTODRAW);
WxBitmapButton5->SetToolTip(wxT("Download other Themes for Rockbox.")); WxBitmapButton5->SetToolTip(wxT("Click here to install themes for Rockbox."));
WxFlexGridSizer2->Add(WxBitmapButton5, 0, WxFlexGridSizer2->Add(WxBitmapButton5, 0,
wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL | wxALL,5); wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL | wxALL,5);
@ -207,7 +209,7 @@ void rbutilFrm::CreateGUIControls(void)
WxBitmapButton6 = new wxBitmapButton(themepage, ID_DOOM_BTN, WxBitmapButton6 = new wxBitmapButton(themepage, ID_DOOM_BTN,
DoomInstallButton, wxPoint(0,0), wxSize(64,54), DoomInstallButton, wxPoint(0,0), wxSize(64,54),
wxRAISED_BORDER | wxBU_AUTODRAW); wxRAISED_BORDER | wxBU_AUTODRAW);
WxBitmapButton6->SetToolTip(wxT("Download freedoom wad files.")); WxBitmapButton6->SetToolTip(wxT("Click here to install the freedoom wad files."));
WxFlexGridSizer2->Add(WxBitmapButton6, 0, WxFlexGridSizer2->Add(WxBitmapButton6, 0,
wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL | wxALL,5); wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL | wxALL,5);
@ -238,7 +240,7 @@ void rbutilFrm::CreateGUIControls(void)
WxBitmapButton2_BITMAP, wxPoint(0,0), wxSize(64,54), WxBitmapButton2_BITMAP, wxPoint(0,0), wxSize(64,54),
wxRAISED_BORDER | wxBU_AUTODRAW, wxDefaultValidator, wxRAISED_BORDER | wxBU_AUTODRAW, wxDefaultValidator,
wxT("WxBitmapButton2")); wxT("WxBitmapButton2"));
WxBitmapButton2->SetToolTip(wxT("Uninstall Rockbox")); WxBitmapButton2->SetToolTip(wxT("Click here to uninstall Rockbox"));
WxFlexGridSizer3->Add(WxBitmapButton2,0, WxFlexGridSizer3->Add(WxBitmapButton2,0,
wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL | wxALL,5); wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL | wxALL,5);
@ -252,7 +254,7 @@ void rbutilFrm::CreateGUIControls(void)
WxBitmapButton4_BITMAP, wxPoint(0,0), wxSize(64,54), WxBitmapButton4_BITMAP, wxPoint(0,0), wxSize(64,54),
wxRAISED_BORDER | wxBU_AUTODRAW, wxDefaultValidator, wxRAISED_BORDER | wxBU_AUTODRAW, wxDefaultValidator,
wxT("WxBitmapButton4")); wxT("WxBitmapButton4"));
WxBitmapButton4->SetToolTip(wxT("Uninstall Bootloader")); WxBitmapButton4->SetToolTip(wxT("Click here to uninstall the Bootloader"));
WxFlexGridSizer3->Add(WxBitmapButton4,0, WxFlexGridSizer3->Add(WxBitmapButton4,0,
wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL | wxALL,5); wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL | wxALL,5);