summaryrefslogtreecommitdiff
path: root/ldmicro/ldmicro.cpp
diff options
context:
space:
mode:
authorakshay-c2019-05-06 15:38:45 +0530
committerakshay-c2019-05-06 15:38:45 +0530
commit46fbe3ae31bb5687f31b17acac4c449699876f2f (patch)
tree11165c20484c635632312c8d89b34b2c4ba8d0ed /ldmicro/ldmicro.cpp
parent183053f2d67a92694cd25a4294af98055e4369e7 (diff)
downloadLDmicroQt-46fbe3ae31bb5687f31b17acac4c449699876f2f.tar.gz
LDmicroQt-46fbe3ae31bb5687f31b17acac4c449699876f2f.tar.bz2
LDmicroQt-46fbe3ae31bb5687f31b17acac4c449699876f2f.zip
Remove Gtk code entirely, ported freeze library
Diffstat (limited to 'ldmicro/ldmicro.cpp')
-rw-r--r--ldmicro/ldmicro.cpp16
1 files changed, 13 insertions, 3 deletions
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);