diff options
author | akshay-c | 2019-05-06 15:38:45 +0530 |
---|---|---|
committer | akshay-c | 2019-05-06 15:38:45 +0530 |
commit | 46fbe3ae31bb5687f31b17acac4c449699876f2f (patch) | |
tree | 11165c20484c635632312c8d89b34b2c4ba8d0ed | |
parent | 183053f2d67a92694cd25a4294af98055e4369e7 (diff) | |
download | LDmicroQt-46fbe3ae31bb5687f31b17acac4c449699876f2f.tar.gz LDmicroQt-46fbe3ae31bb5687f31b17acac4c449699876f2f.tar.bz2 LDmicroQt-46fbe3ae31bb5687f31b17acac4c449699876f2f.zip |
Remove Gtk code entirely, ported freeze library
-rw-r--r-- | ldmicro/CMakeLists.txt | 14 | ||||
-rw-r--r-- | ldmicro/helpdialog.cpp | 126 | ||||
-rw-r--r-- | ldmicro/includes/ldmicro.h | 2 | ||||
-rw-r--r-- | ldmicro/ldmicro.cpp | 16 | ||||
-rw-r--r-- | ldmicro/lib/freezeLD/freezeLD.cpp | 131 | ||||
-rw-r--r-- | ldmicro/lib/linuxUI/linuxLD.h | 18 | ||||
-rw-r--r-- | ldmicro/lib/linuxUI/linuxUI.cpp | 1 | ||||
-rw-r--r-- | ldmicro/lib/linuxUI/linuxUI.h | 7 | ||||
-rw-r--r-- | ldmicro/maincontrols.cpp | 2 |
9 files changed, 59 insertions, 258 deletions
diff --git a/ldmicro/CMakeLists.txt b/ldmicro/CMakeLists.txt index 7010ced..6ee451d 100644 --- a/ldmicro/CMakeLists.txt +++ b/ldmicro/CMakeLists.txt @@ -45,10 +45,6 @@ IF(UNIX) endif() MESSAGE( STATUS "Performing system check - done" ) - MESSAGE ( STATUS "Searching for GTK+3.0..." ) - find_package (PkgConfig REQUIRED) - pkg_check_modules (GTK3 REQUIRED gtk+-3.0) - ## Set object dir set(OBJDIR ${CMAKE_CURRENT_SOURCE_DIR}/obj) @@ -89,16 +85,6 @@ IF(UNIX) ) # MESSAGE ( STATUS " PROJECT_INCLUDE_DIR: " ${PROJECT_INCLUDE_DIR} ) - ## Add GTK3 include files if GTK3 is found - IF ( GTK3_FOUND ) - include_directories (${GTK3_INCLUDE_DIRS}) - link_directories (${GTK3_LIBRARY_DIRS}) - add_definitions (${GTK3_CFLAGS_OTHER}) - link_libraries (${GTK3_LIBRARIES}) - # MESSAGE( STATUS " GTK3_INCLUDE_DIR: " ${GTK3_INCLUDE_DIRS} ) - # MESSAGE( STATUS " GTK3_LIBRARIES: " ${GTK3_LIBRARIES} ) - ENDIF ( GTK3_FOUND ) - set_property(SOURCE ${OBJDIR}/helptext.cpp PROPERTY SKIP_AUTOGEN ON) set(CMAKE_AUTOMOC ON) diff --git a/ldmicro/helpdialog.cpp b/ldmicro/helpdialog.cpp index 8317e52..baf1389 100644 --- a/ldmicro/helpdialog.cpp +++ b/ldmicro/helpdialog.cpp @@ -100,73 +100,17 @@ static int TitleHeight; HWID PackBoxHelp; HWID TextView; -GtkTextBuffer* TextBuffer; -GtkTextIter* TextIter = new GtkTextIter; #define RICH_EDIT_HEIGHT(h) \ ((((h) - 3 + (FONT_HEIGHT/2)) / FONT_HEIGHT) * FONT_HEIGHT) -static void SizeRichEdit(int a) -{ - gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (RichEdit[a]), - GTK_POLICY_AUTOMATIC, - GTK_POLICY_ALWAYS); - gtk_widget_set_hexpand(GTK_WIDGET(RichEdit[a]), TRUE); - gtk_widget_set_vexpand(GTK_WIDGET(RichEdit[a]), TRUE); -} - -// static BOOL Resizing(RECT *r, int wParam) -// { -// BOOL touched = FALSE; -// if(r->right - r->left < 650) { -// int diff = 650 - (r->right - r->left); -// if(wParam == WMSZ_RIGHT || wParam == WMSZ_TOPRIGHT || -// wParam == WMSZ_BOTTOMRIGHT) -// { -// r->right += diff; -// } else { -// r->left -= diff; -// } -// touched = TRUE; -// } - -// if(!(wParam == WMSZ_LEFT || wParam == WMSZ_RIGHT)) { -// int h = r->bottom - r->top - TitleHeight - 5; -// if(RICH_EDIT_HEIGHT(h) != h) { -// int diff = h - RICH_EDIT_HEIGHT(h); -// if(wParam == WMSZ_TOP || wParam == WMSZ_TOPRIGHT || -// wParam == WMSZ_TOPLEFT) -// { -// r->top += diff; -// } else { -// r->bottom -= diff; -// } -// touched = TRUE; -// } -// } - -// return !touched; -// } - static void MakeControls(int a) { - // HMODULE re = LoadLibrary("RichEd20.dll"); - // if(!re) oops(); - RichEdit[a] = new QPlainTextEdit(); RichEdit[a]->setReadOnly(TRUE); QPalette pal = RichEdit[a]->palette(); pal.setColor(QPalette::Base, (*(HBRUSH)GetStockObject(BLACK_BRUSH))); RichEdit[a]->setPalette(pal); - /*TextView = gtk_text_view_new (); - TextBuffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (TextView)); - gtk_text_view_set_editable (GTK_TEXT_VIEW (TextView), FALSE);*/ - // SizeRichEdit(a); - // gtk_text_view_set_wrap_mode (GTK_TEXT_VIEW (TextView), GTK_WRAP_WORD); - // gtk_text_buffer_get_start_iter (TextBuffer, TextIter); - // COLORREF color; - // gtk_text_buffer_create_tag (TextBuffer, "ForegroundColor1", - // "foreground", "blue"); int i; BOOL nextSubHead = FALSE; @@ -222,20 +166,15 @@ static void MakeControls(int a) copy[j] = ' '; } s += j; - // color = RGB(255, 110, 255); - // gtk_widget_override_color (TextView, GTK_STATE_FLAG_NORMAL, &color); + nextSubHead = !nextSubHead; } else { COLORREF color = RGB(255, 255, 255); cf.setForeground(QBrush(color)); RichEdit[a]->setCurrentCharFormat(cf); - // gtk_widget_override_color (TextView, GTK_STATE_FLAG_NORMAL, &color); } - // gtk_text_buffer_insert_with_tags_by_name (TextBuffer, TextIter, - // s, -1, "ForegroundColor1", NULL); - // gtk_text_buffer_insert (TextBuffer, TextIter, s, -1); RichEdit[a]->appendPlainText(QString::fromStdString((const char*)s)); if(Text[a][i+1]) { @@ -243,75 +182,12 @@ static void MakeControls(int a) // RichEdit[a]->appendPlainText("\n"); } } - /*gtk_widget_override_background_color (TextView, GTK_STATE_FLAG_NORMAL, - ((HBRUSH)GetStockObject(BLACK_BRUSH))); - gtk_container_add (GTK_CONTAINER(RichEdit[a]), TextView);*/ - -} - -//----------------------------------------------------------------------------- -// Window proc for the help dialog. -//----------------------------------------------------------------------------- -// static LRESULT CALLBACK HelpProc(HWND hwnd, UINT msg, WPARAM wParam, -// LPARAM lParam) -// { -// int a = (hwnd == HelpDialog[0] ? 0 : 1); -// switch (msg) { -// case WM_SIZING: { -// RECT *r = (RECT *)lParam; -// return Resizing(r, wParam); -// break; -// } -// case WM_SIZE: -// SizeRichEdit(a); -// break; - -// case WM_ACTIVATE: -// case WM_KEYDOWN: -// SetFocus(RichEdit[a]); -// break; - -// case WM_DESTROY: -// case WM_CLOSE: -// HelpWindowOpen[a] = FALSE; -// // fall through -// default: -// return DefWindowProc(hwnd, msg, wParam, lParam); -// } - -// return 1; -// } - -//----------------------------------------------------------------------------- -// Create the class for the help window. -//----------------------------------------------------------------------------- -static void MakeClass(void) -{ -// WNDCLASSEX wc; -// memset(&wc, 0, sizeof(wc)); -// wc.cbSize = sizeof(wc); - -// wc.style = CS_BYTEALIGNCLIENT | CS_BYTEALIGNWINDOW | CS_OWNDC | -// CS_DBLCLKS; -// wc.lpfnWndProc = (WNDPROC)HelpProc; -// wc.hInstance = Instance; -// wc.lpszClassName = "LDmicroHelp"; -// wc.lpszMenuName = NULL; -// wc.hCursor = LoadCursor(NULL, IDC_ARROW); -// wc.hIcon = (HICON)LoadImage(Instance, MAKEINTRESOURCE(4000), -// IMAGE_ICON, 32, 32, 0); -// wc.hIconSm = (HICON)LoadImage(Instance, MAKEINTRESOURCE(4000), -// IMAGE_ICON, 16, 16, 0); - -// RegisterClassEx(&wc); } void ShowHelpDialog(BOOL about) { int a = about ? 1 : 0; - - // MakeClass(); const char *s = about ? "About LDmicro" : "LDmicro Help"; diff --git a/ldmicro/includes/ldmicro.h b/ldmicro/includes/ldmicro.h index bff804f..29583a2 100644 --- a/ldmicro/includes/ldmicro.h +++ b/ldmicro/includes/ldmicro.h @@ -593,6 +593,7 @@ extern HWID MainWindow; extern QIcon* MWIcon; extern QMenuBar* MainMenu; extern HWID DrawWindow; +extern WM_SCROLL scrollbar; extern PlcProgram Prog; extern char CurrentSaveFile[MAX_PATH]; extern char CurrentCompileFile[MAX_PATH]; @@ -607,6 +608,7 @@ void CheckHeap(char *file, int line); class MyWidget : public QWidget { public: + void resizeEvent(QResizeEvent *event); void closeEvent(QCloseEvent* event); }; diff --git a/ldmicro/ldmicro.cpp b/ldmicro/ldmicro.cpp index fbf2b3d..e0bf5f3 100644 --- a/ldmicro/ldmicro.cpp +++ b/ldmicro/ldmicro.cpp @@ -42,6 +42,7 @@ QIcon* MWIcon; QMenuBar* MainMenu; QGroupBox* CursorObject; HWID DrawWindow; +WM_SCROLL scrollbar; // parameters used to capture the mouse when implementing our totally non- // general splitter control //static HHOOK MouseHookHandle; @@ -70,9 +71,6 @@ char CurrentCompileFile[MAX_PATH]; // project file. PlcProgram Prog; -/// Function to safely quit program gtk main loop -gboolean LD_WM_Close_call(GtkWidget *widget, GdkEvent *event, gpointer user_data); - //----------------------------------------------------------------------------- // Get a filename with a common dialog box and then save the program to that // file and then set our default filename to that. @@ -358,6 +356,7 @@ static void ProcessMenu(int code) case MNU_NEW: if(CheckSaveUserCancels()) break; NewProgram(); + DrawWindow->resize(scrollbar->size()); strcpy(CurrentSaveFile, ""); strcpy(CurrentCompileFile, ""); GenerateIoListDontLoseSelection(); @@ -366,6 +365,7 @@ static void ProcessMenu(int code) break; case MNU_OPEN: + DrawWindow->resize(scrollbar->size()); if(CheckSaveUserCancels()) break; OpenDialog(); break; @@ -704,12 +704,22 @@ void PaintWidget::keyPressEvent(QKeyEvent* event) return; } +void MyWidget::resizeEvent(QResizeEvent *event) +{ + DrawWindow->resize(scrollbar->size()); +} + void MyWidget::closeEvent(QCloseEvent* event) { if(CheckSaveUserCancels()) event->ignore(); else + { event->accept(); + FreezeWindowPos(MainWindow); + IoListHeight = IoList->height(); + FreezeDWORD(IoListHeight); + } /*GdkRectangle allocation; gtk_widget_get_allocation(GTK_WIDGET(view), &allocation); diff --git a/ldmicro/lib/freezeLD/freezeLD.cpp b/ldmicro/lib/freezeLD/freezeLD.cpp index 6ae42eb..25843fc 100644 --- a/ldmicro/lib/freezeLD/freezeLD.cpp +++ b/ldmicro/lib/freezeLD/freezeLD.cpp @@ -11,6 +11,7 @@ #include <cstdlib> #include <fstream> #include <stdlib.h> +#include <unistd.h> #include <stdio.h> /* @@ -18,7 +19,7 @@ */ void FreezeWindowPosF(HWID hwid, char *subKey, char *name) { - /*char* Ld_CWD = (char *)malloc(MAX_PATH); + char* Ld_CWD = (char *)malloc(MAX_PATH); getcwd(Ld_CWD, MAX_PATH); if (!Ld_CWD) @@ -31,7 +32,7 @@ void FreezeWindowPosF(HWID hwid, char *subKey, char *name) } sprintf(moveToKeyLocatin, "mkdir -p %s/%s/%s", getenv("HOME"), FREEZE_REGISTER, subKey); - system(moveToKeyLocatin); + system(moveToKeyLocatin); sprintf(moveToKeyLocatin, "%s/%s/%s", getenv("HOME"), FREEZE_REGISTER, subKey); if (-1 == chdir(moveToKeyLocatin)) { @@ -50,9 +51,9 @@ void FreezeWindowPosF(HWID hwid, char *subKey, char *name) Key newKey; - int val; + QSize val; - sprintf(keyName, "%s_width", name); + sprintf(keyName, "%s_size", name); std::ofstream Register(keyName, std::ios::binary | std::ios::trunc); if (!Register.is_open()) { @@ -60,27 +61,14 @@ void FreezeWindowPosF(HWID hwid, char *subKey, char *name) free(keyName); return; } - gtk_window_get_size(GTK_WINDOW(hwid), &val, NULL); - newKey.type = 'i'; - newKey.val.i = val; - Register.write((char*) &newKey, sizeof(newKey)); + // gtk_window_get_size(GTK_WINDOW(hwid), &val, NULL); + val = hwid->size(); + Register.write((char*)&val, sizeof(val)); Register.close(); - sprintf(keyName, "%s_height", name); - Register.open(keyName, std::ios::binary | std::ios::trunc); - if (!Register.is_open()) - { - free(Ld_CWD); - free(keyName); - return; - } - gtk_window_get_size(GTK_WINDOW(hwid), NULL, &val); - newKey.type = 'i'; - newKey.val.i = val; - Register.write((char*) &newKey, sizeof(newKey)); - Register.close(); + QPoint pos; - sprintf(keyName, "%s_posX", name); + sprintf(keyName, "%s_pos", name); Register.open(keyName, std::ios::binary | std::ios::trunc); if (!Register.is_open()) { @@ -88,26 +76,13 @@ void FreezeWindowPosF(HWID hwid, char *subKey, char *name) free(keyName); return; } - gtk_window_get_position(GTK_WINDOW(hwid), &val, NULL); - newKey.type = 'i'; - newKey.val.i = val; - Register.write((char*) &newKey, sizeof(newKey)); - Register.close(); - - sprintf(keyName, "%s_posY", name); - Register.open(keyName, std::ios::binary | std::ios::trunc); - if (!Register.is_open()) - { - free(Ld_CWD); - free(keyName); - return; - } - gtk_window_get_position(GTK_WINDOW(hwid), NULL, &val); - newKey.type = 'i'; - newKey.val.i = val; - Register.write((char*) &newKey, sizeof(newKey)); + + pos = hwid->pos(); + Register.write((char*) &pos, sizeof(pos)); Register.close(); + unsigned int WindowState; + sprintf(keyName, "%s_maximized", name); Register.open(keyName, std::ios::binary | std::ios::trunc); if (!Register.is_open()) @@ -116,14 +91,13 @@ void FreezeWindowPosF(HWID hwid, char *subKey, char *name) free(keyName); return; } - newKey.type = 'b'; - newKey.val.b = gtk_window_is_maximized(GTK_WINDOW(hwid)); - Register.write((char*) &newKey, sizeof(newKey)); + WindowState = hwid->windowState(); + Register.write((char*) &WindowState, sizeof(unsigned int)); Register.close(); free(keyName); chdir(Ld_CWD); - free(Ld_CWD);*/ + free(Ld_CWD); } static void Clamp(LONG *v, LONG min, LONG max) @@ -166,10 +140,10 @@ void ThawWindowPosF(HWID hwid, char *subKey, char *name) return; } - Key newKey1, newKey2; + QSize val; /// set size - sprintf(keyName, "%s_width", name); + sprintf(keyName, "%s_size", name); std::ifstream Register(keyName, std::ios::binary); if (!Register.is_open()) { @@ -177,39 +151,18 @@ void ThawWindowPosF(HWID hwid, char *subKey, char *name) free(keyName); return; } - Register.read((char*) &newKey1, sizeof(newKey1)); - Register.close(); - - sprintf(keyName, "%s_height", name); - Register.open(keyName, std::ios::binary); - if (!Register.is_open()) - { - free(Ld_CWD); - free(keyName); - return; - } - Register.read((char*) &newKey2, sizeof(newKey2)); + Register.read((char*) &val, sizeof(val)); Register.close(); - if (newKey1.type == 'i' && newKey2.type == 'i') + if (val.width()>100 && val.height()>50) { - QSize MwSize(newKey1.val.i,newKey2.val.i); - hwid->resize(MwSize); + hwid->resize(val); } /// set position - sprintf(keyName, "%s_posX", name); - Register.open(keyName, std::ios::binary); - if (!Register.is_open()) - { - free(Ld_CWD); - free(keyName); - return; - } - Register.read((char*) &newKey1, sizeof(newKey1)); - Register.close(); - sprintf(keyName, "%s_posY", name); + QPoint pos; + sprintf(keyName, "%s_pos", name); Register.open(keyName, std::ios::binary); if (!Register.is_open()) { @@ -217,11 +170,12 @@ void ThawWindowPosF(HWID hwid, char *subKey, char *name) free(keyName); return; } - Register.read((char*) &newKey2, sizeof(newKey2)); + Register.read((char*) &pos, sizeof(pos)); Register.close(); - if (newKey1.type == 'i' && newKey2.type == 'i') - hwid->move(newKey1.val.i, newKey2.val.i); + hwid->move(pos); + + unsigned int value; sprintf(keyName, "%s_maximized", name); Register.open(keyName, std::ios::binary); @@ -231,11 +185,10 @@ void ThawWindowPosF(HWID hwid, char *subKey, char *name) free(keyName); return; } - Register.read((char*) &newKey1, sizeof(newKey1)); + Register.read((char*) &value, sizeof(unsigned int)); Register.close(); - if (newKey1.type == 'b') - if (newKey1.val.b) - hwid->showMaximized(); + if (value == Qt::WindowMaximized) + hwid->setWindowState(Qt::WindowMaximized); /// gtk_window_move handles off-screen window placement @@ -274,12 +227,9 @@ void FreezeDWORDF(DWORD val, char *subKey, char *name) } free(moveToKeyLocatin); - Key newKey; - newKey.type = 'D'; - newKey.val.D = val; std::ofstream Register(name, std::ios::binary | std::ios::trunc); - Register.write((char*) &newKey, sizeof(newKey)); + Register.write((char*) &val, sizeof(DWORD)); Register.close(); chdir(Ld_CWD); @@ -313,7 +263,7 @@ DWORD ThawDWORDF(DWORD val, char *subKey, char *name) } free(moveToKeyLocatin); - Key newKey; + DWORD newKey; std::ifstream Register(name, std::ios::binary); Register.read((char*) &newKey, sizeof(newKey)); @@ -324,11 +274,8 @@ DWORD ThawDWORDF(DWORD val, char *subKey, char *name) if(Register.bad()) return val; - - if(newKey.type == 'D') - return newKey.val.D; else - return val; + return newKey; } /* @@ -336,7 +283,7 @@ DWORD ThawDWORDF(DWORD val, char *subKey, char *name) */ void FreezeStringF(char *val, char *subKey, char *name) { - char* Ld_CWD = (char *)malloc(MAX_PATH); + /*char* Ld_CWD = (char *)malloc(MAX_PATH); getcwd(Ld_CWD, MAX_PATH); if (!Ld_CWD) @@ -366,7 +313,7 @@ void FreezeStringF(char *val, char *subKey, char *name) Register.close(); chdir(Ld_CWD); - free(Ld_CWD); + free(Ld_CWD);*/ } /* @@ -374,7 +321,7 @@ void FreezeStringF(char *val, char *subKey, char *name) */ void ThawStringF(char *val, int max, char *subKey, char *name) { - char* Ld_CWD = (char *)malloc(MAX_PATH); + /*char* Ld_CWD = (char *)malloc(MAX_PATH); getcwd(Ld_CWD, MAX_PATH); if (!Ld_CWD) @@ -407,6 +354,6 @@ void ThawStringF(char *val, int max, char *subKey, char *name) Register >> val; chdir(Ld_CWD); - free(Ld_CWD); + free(Ld_CWD);*/ } diff --git a/ldmicro/lib/linuxUI/linuxLD.h b/ldmicro/lib/linuxUI/linuxLD.h index 231e499..46eb523 100644 --- a/ldmicro/lib/linuxUI/linuxLD.h +++ b/ldmicro/lib/linuxUI/linuxLD.h @@ -78,18 +78,13 @@ typedef PVOID HANDLE; typedef HANDLE HINSTANCE; typedef HANDLE HGDIOBJ; -typedef GtkApplication* HAPP; -typedef GtkTreeViewColumn* HTVC; -typedef GdkRectangle* GDRECT; typedef QTreeWidget* HLIST; typedef QList<QTreeWidgetItem *> ITLIST; -typedef GDRECT* PGDRECT; typedef QMenu* HMENU; typedef ITLIST HITLIST; typedef QPainter* HCRDC; typedef QWidget* HWID; typedef QWidget* HWND; -typedef GdkPixbuf* HICON; typedef QScrollArea* WM_SCROLL; @@ -238,19 +233,6 @@ BOOL HeapFree( DWORD dwFlags, LPVOID lpMem); -HICON LoadImage( - HINSTANCE hinst, - LPCTSTR lpszName, - UINT uType, - int cxDesired, - int cyDesired, - UINT fuLoad -); - -void RECT_to_GDRECT( - const RECT *rc, - GDRECT *gdrc); - /// functions to be ported void OutputDebugString(char*); double GetTickCount(void); diff --git a/ldmicro/lib/linuxUI/linuxUI.cpp b/ldmicro/lib/linuxUI/linuxUI.cpp index eca0b50..e9ae716 100644 --- a/ldmicro/lib/linuxUI/linuxUI.cpp +++ b/ldmicro/lib/linuxUI/linuxUI.cpp @@ -25,7 +25,6 @@ const UINT MF_UNCHECKED = 3; /// ListStore HWID view; -HTVC column; /// Wraper function for gtk_window_has_toplevel_focus BOOL GetFocus(HWID window) diff --git a/ldmicro/lib/linuxUI/linuxUI.h b/ldmicro/lib/linuxUI/linuxUI.h index 629ede6..f35b9be 100644 --- a/ldmicro/lib/linuxUI/linuxUI.h +++ b/ldmicro/lib/linuxUI/linuxUI.h @@ -2,7 +2,6 @@ #define __LINUX_UI__ /// includes -#include <gtk/gtk.h> #include <QApplication> #include <QWidget> #include <QMenu> @@ -40,6 +39,9 @@ // 4000 ICON "ldmicro.ico" +#define TRUE true +#define FALSE false + /// version control #define LDMicro_VERSION_MAJOR 1 #define LDMicro_VERSION_MINOR 0 @@ -148,13 +150,10 @@ extern const UINT MF_CHECKED; extern const UINT MF_UNCHECKED; /// Accelerators (keyboard shortcuts) -extern GtkAccelGroup* AccelGroup; -extern GClosure* closure; extern QGroupBox* CursorObject; /// ListStore extern HWID view; -extern HTVC column; // Timer IDs associated with the main window. extern int CursorTimer; diff --git a/ldmicro/maincontrols.cpp b/ldmicro/maincontrols.cpp index b1b1f9d..4ae1f5b 100644 --- a/ldmicro/maincontrols.cpp +++ b/ldmicro/maincontrols.cpp @@ -549,7 +549,7 @@ void MakeMainWindowControls(void) IoList->insertTopLevelItems(0, items);*/ DrawWindow->setAutoFillBackground(true); QSize DWSize; - WM_SCROLL scrollbar = new QScrollArea(); + scrollbar = new QScrollArea(); scrollbar->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn); scrollbar->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOn); scrollbar->setFocusPolicy(Qt::NoFocus); |