First pass
This commit is contained in:
@@ -22,32 +22,35 @@
|
||||
|
||||
class ImportEngine;
|
||||
|
||||
#include <wx/wx.h>
|
||||
#include <QFrame>
|
||||
#include <QLocale>
|
||||
#include <QVBoxLayout>
|
||||
#include <QScrollArea>
|
||||
#include <QPushButton>
|
||||
|
||||
#include <controller/KissCount.hpp>
|
||||
|
||||
#include "KissPanel.hpp"
|
||||
#include <qtranslator.h>
|
||||
#include <qtextcodec.h>
|
||||
|
||||
#ifdef WIN32
|
||||
#undef _
|
||||
#define _(s) wxString(wxGetTranslation(s))
|
||||
#endif
|
||||
#define _(s) QObject::tr(s)
|
||||
|
||||
class KissCount;
|
||||
class KissPanel;
|
||||
class AccountPanel;
|
||||
class PreferencesPanel;
|
||||
|
||||
class wxUI: public wxFrame
|
||||
class wxUI: public QFrame
|
||||
{
|
||||
public:
|
||||
static const int MAX_CATEGORY = 12;
|
||||
static wxString months[MAX_CATEGORY];
|
||||
static wxColour categoryColors[MAX_CATEGORY];
|
||||
static std::string months[MAX_CATEGORY];
|
||||
static QColor categoryColors[MAX_CATEGORY];
|
||||
|
||||
wxUI(KissCount* kiss, const wxString& title, const wxPoint& pos, const wxSize& size);
|
||||
wxUI(KissCount* kiss, const QString& title);
|
||||
~wxUI();
|
||||
|
||||
bool SetLanguage(long language);
|
||||
bool SetLanguage(std::string language);
|
||||
|
||||
void ChangeUser();
|
||||
void LoadUser();
|
||||
@@ -62,26 +65,45 @@ public:
|
||||
void ShowPanel(KissPanel* panel);
|
||||
void NeedReload();
|
||||
|
||||
wxLanguage _language;
|
||||
int _language;
|
||||
|
||||
void OnButtonClicked(wxCommandEvent& event);
|
||||
void OnButtonChangeUser(wxCommandEvent& event);
|
||||
void OnButtonAbout(wxCommandEvent& event);
|
||||
void OnButtonQuit(wxCommandEvent& event);
|
||||
void OnButtonClicked(QEvent& event);
|
||||
void OnButtonChangeUser(QEvent& event);
|
||||
void OnButtonAbout(QEvent& event);
|
||||
void OnButtonQuit(QEvent& event);
|
||||
|
||||
private:
|
||||
KissCount *_kiss;
|
||||
wxBoxSizer *_vbox, *_buttonsBox;
|
||||
QVBoxLayout *_vbox, *_buttonsBox;
|
||||
KissPanel *_curPanel;
|
||||
std::vector<KissPanel*> _panels;
|
||||
std::vector<wxBitmapButton*> _buttons;
|
||||
wxLocale *_locale;
|
||||
std::vector<QPushButton*> _buttons;
|
||||
QLocale *_locale;
|
||||
bool _needReload;
|
||||
|
||||
void InitPanels();
|
||||
void LoadPanels();
|
||||
};
|
||||
|
||||
DECLARE_EVENT_TABLE();
|
||||
class KissPanel: public QScrollArea
|
||||
{
|
||||
public:
|
||||
KissPanel(KissCount* kiss, wxUI* parent) :
|
||||
QScrollArea(static_cast<QWidget*>(parent)),
|
||||
_kiss(kiss),
|
||||
_wxUI(parent),
|
||||
_KissButton(0)
|
||||
{hide();}
|
||||
|
||||
virtual void OnShow(QShowEvent * event)=0;
|
||||
virtual KissPanel* CreatePanel()=0;
|
||||
virtual QPushButton* GetButton(int id) {return 0;}
|
||||
virtual std::string GetToolTip() {return "";}
|
||||
|
||||
protected:
|
||||
KissCount* _kiss;
|
||||
wxUI* _wxUI;
|
||||
QPushButton* _KissButton;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user