summaryrefslogtreecommitdiff
path: root/ldmicro/lib/linuxUI/linuxUI.h
diff options
context:
space:
mode:
Diffstat (limited to 'ldmicro/lib/linuxUI/linuxUI.h')
-rw-r--r--ldmicro/lib/linuxUI/linuxUI.h101
1 files changed, 65 insertions, 36 deletions
diff --git a/ldmicro/lib/linuxUI/linuxUI.h b/ldmicro/lib/linuxUI/linuxUI.h
index 7054b61..ed2a961 100644
--- a/ldmicro/lib/linuxUI/linuxUI.h
+++ b/ldmicro/lib/linuxUI/linuxUI.h
@@ -11,6 +11,14 @@
#include <QLabel>
#include <QPainter>
#include <QGroupBox>
+#include <QSignalMapper>
+#include <QKeyEvent>
+#include <QScrollArea>
+#include <QScrollBar>
+#include <QMessageBox>
+#include <QFileDialog>
+#include <QStandardPaths>
+#include <QPlainTextEdit>
// #include <QtGui>
// #include <QSize>
// #include "freezeLD.h"
@@ -34,20 +42,20 @@
/// Flags
/// message box
-#define MB_OK 0x00000001L
-#define MB_OKCANCEL 0x00000002L
-#define MB_YESNO 0x00000004L
-#define MB_YESNOCANCEL 0x00000008L
+#define MB_OK QMessageBox::Ok
+#define MB_OKCANCEL QMessageBox::Ok | QMessageBox::Cancel
+#define MB_YESNO QMessageBox::Yes | QMessageBox::No
+#define MB_YESNOCANCEL QMessageBox::Yes | QMessageBox::No | QMessageBox::Cancel
-#define IDOK 1
-#define IDCANCEL 2
-#define IDYES 3
-#define IDNO 4
+#define IDOK QMessageBox::Ok
+#define IDCANCEL QMessageBox::Cancel
+#define IDYES QMessageBox::Yes
+#define IDNO QMessageBox::No
-#define MB_ICONERROR 0x00000010L
-#define MB_ICONQUESTION 0x00000020L
-#define MB_ICONWARNING 0x00000040L
-#define MB_ICONINFORMATION 0x00000080L
+#define MB_ICONERROR QMessageBox::Critical
+#define MB_ICONQUESTION QMessageBox::Question
+#define MB_ICONWARNING QMessageBox::Warning
+#define MB_ICONINFORMATION QMessageBox::Information
/// Scroll
#define SB_LINEUP 0x00000001
@@ -77,34 +85,34 @@
#define PATINVERT 0x00000100L
/// Key masks
-#define VK_TAB GDK_KEY_Tab
+#define VK_TAB Qt::Key_Tab
-#define VK_DOWN 65364
-#define VK_UP 65362
-#define VK_LEFT 65361
-#define VK_RIGHT 65363
+#define VK_DOWN Qt::Key_Down
+#define VK_UP Qt::Key_Up
+#define VK_LEFT Qt::Key_Left
+#define VK_RIGHT Qt::Key_Right
-#define VK_NP_DOWN 65433
-#define VK_NP_UP 65431
-#define VK_NP_LEFT 65430
-#define VK_NP_RIGHT 65432
+#define VK_NP_DOWN Qt::Key_Down
+#define VK_NP_UP Qt::Key_Up
+#define VK_NP_LEFT Qt::Key_Left
+#define VK_NP_RIGHT Qt::Key_Right
-#define VK_RETURN GDK_KEY_Return
-#define VK_ESCAPE GDK_KEY_Escape
-#define VK_F5 GDK_KEY_F5
-#define VK_F1 GDK_KEY_F1
+#define VK_RETURN Qt::Key_Return
+#define VK_ESCAPE Qt::Key_Escape
+#define VK_F5 Qt::Key_F5
+#define VK_F1 Qt::Key_F1
-#define VK_OEM_PLUS GDK_KEY_plus
-#define VK_OEM_MINUS GDK_KEY_minus
-#define VK_OEM_PERIOD GDK_KEY_period
-#define VK_OEM_COMMA GDK_KEY_comma
+#define VK_OEM_PLUS Qt::Key_Plus
+#define VK_OEM_MINUS Qt::Key_Minus
+#define VK_OEM_PERIOD Qt::Key_Period
+#define VK_OEM_COMMA Qt::Key_Comma
-#define VK_DELETE GDK_KEY_Delete
-#define VK_NP_DELETE GDK_KEY_KP_Delete
+#define VK_DELETE Qt::Key_Delete
+#define VK_NP_DELETE Qt::Key_Delete
-// #define VK_OEM_1 GDK_KEY_colon // GDK_KEY_semicolon
-// #define VK_OEM_2 GDK_KEY_question // GDK_KEY_slash
-// #define VK_OEM_5 GDK_KEY_backslash // GDK_KEY_bar
+#define VK_OEM_1 Qt::Key_Colon // GDK_KEY_semicolon
+#define VK_OEM_2 Qt::Key_Question // GDK_KEY_slash
+#define VK_OEM_5 Qt::Key_Backslash // GDK_KEY_bar
/// Window brushes
#define BS_SOLID 0x00000001L
@@ -140,10 +148,14 @@ extern QGroupBox* CursorObject;
extern HWID view;
extern HTVC column;
+// Timer IDs associated with the main window.
+extern int CursorTimer;
+extern int SimulateTimer;
+
/// Structures
typedef struct OpenFileInfoData {
DWORD lStructSize;
- HWID *parentWindow;
+ HWID parentWindow;
LPTSTR lpstrFile;
LPCTSTR lpstrFilter;
DWORD nMaxFile;
@@ -158,11 +170,25 @@ typedef struct TimerRecordTag {
UINT utID;
} TimerRecord;
+/******************************************************************
+Class to create slots for signals
+
+*******************************************************************/
+class ProgramSlots : public QObject
+{
+ Q_OBJECT
+ public:
+ signals:
+ public slots:
+ void LD_WM_Command_call(int CommandCode);
+};
+
/// Variables
extern COLORREF HdcCurrentTextColor;
extern std::vector<TimerRecord> timerRecords;
extern int GLOBAL_mouse_last_clicked_x;
extern int GLOBAL_mouse_last_clicked_y;
+extern ProgramSlots MenuHandle;
/// functions
BOOL GetFocus(HWID window);
@@ -175,7 +201,8 @@ int MessageBox(
HWID pWindow,
char* message,
char* title,
- UINT mFlags);
+ UINT mFlags,
+ UINT iFlags);
BOOL GetSaveFileName(OPENFILENAME *ofn);
@@ -283,6 +310,8 @@ class PaintWidget : public QWidget
Q_OBJECT
public:
// MyWidget();
+ // PaintWidget(QWidget* parent): QWidget(parent)
+ // {}
protected:
void paintEvent(QPaintEvent *event);