3 /// Class for the fixed-size frame that holds the main app
7 Copyright (C) 2009-2012, Net Direct Inc. (http://www.netdirect.ca/)
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 2 of the License, or
12 (at your option) any later version.
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU General Public License in the COPYING file at the
19 root directory of this project for more details.
22 #ifndef __BARRYDESKTOP_BASEFRAME_H__
23 #define __BARRYDESKTOP_BASEFRAME_H__
26 #include <wx/process.h>
28 #include <barry/pin.h>
29 #include "exechelper.h"
31 #define MAIN_HEADER_OFFSET 40
39 class BaseFrame
: public wxFrame
, public TermCatcher
42 DECLARE_EVENT_TABLE() // sets to protected:
45 std::auto_ptr
<wxBitmap
> m_background
;
46 std::auto_ptr
<MainMenuMode
> m_main_menu_mode
;// only this mode is
48 std::auto_ptr
<SyncMode
> m_sync_mode
;
49 std::auto_ptr
<BrowseMode
> m_browse_mode
;
50 std::auto_ptr
<ClickableImage
> m_barry_logo
, m_netdirect_logo
;
51 std::auto_ptr
<wxMenu
> m_sysmenu
;
52 std::auto_ptr
<wxComboBox
> m_device_combo
;
53 std::auto_ptr
<wxButton
> m_back_button
;
54 int m_width
, m_height
;
58 ExecHelper m_backup_process
;
61 BaseFrame(const wxImage
&background
);
64 void UpdateMenuState();
65 void CreateDeviceCombo(Barry::Pin pin
= Barry::Pin());
66 Barry::Pin
GetCurrentComboPin();
67 void EnableBackButton(Mode
*new_mode
);
68 void DisableBackButton(); // also returns to the main menu
71 void OnSize(wxSizeEvent
&event
);
72 void OnPaint(wxPaintEvent
&event
);
73 void OnMouseMotion(wxMouseEvent
&event
);
74 void OnLeftDown(wxMouseEvent
&event
);
75 void OnLeftUp(wxMouseEvent
&event
);
76 void OnBackupRestore(wxCommandEvent
&event
);
77 void OnSync(wxCommandEvent
&event
);
78 void OnModem(wxCommandEvent
&event
);
79 void OnAppLoader(wxCommandEvent
&event
);
80 void OnMigrateDevice(wxCommandEvent
&event
);
81 void OnBrowseDatabases(wxCommandEvent
&event
);
82 void OnMediaManagement(wxCommandEvent
&event
);
83 void OnMisc(wxCommandEvent
&event
);
84 void OnBackButton(wxCommandEvent
&event
);
85 void OnTermBackupAndRestore(wxProcessEvent
&event
);
86 void OnBarryLogoClicked(wxCommandEvent
&event
);
87 void OnNetDirectLogoClicked(wxCommandEvent
&event
);
88 void OnDeviceComboChange(wxCommandEvent
&event
);
90 // sys menu (triggered by the Barry logo)
91 void OnVerboseLogging(wxCommandEvent
&event
);
92 void OnRenameDevice(wxCommandEvent
&event
);
93 void OnResetDevice(wxCommandEvent
&event
);
94 void OnRescanUsb(wxCommandEvent
&event
);
95 void OnAbout(wxCommandEvent
&event
);
96 void OnExit(wxCommandEvent
&event
);