summaryrefslogtreecommitdiff
path: root/ldmicro/maincontrols.cpp
diff options
context:
space:
mode:
authorNatsuDrag92018-06-11 10:03:03 +0530
committerNatsuDrag92018-06-11 10:03:03 +0530
commit615a572781721256ab3098f8916fac96c880f87e (patch)
tree722eac5ef6a224c6c86ecc205cc2f6cb54b5ae05 /ldmicro/maincontrols.cpp
parentf3279da9e036419bbe70e946e31a8961ea331877 (diff)
downloadLDMicroGtk-615a572781721256ab3098f8916fac96c880f87e.tar.gz
LDMicroGtk-615a572781721256ab3098f8916fac96c880f87e.tar.bz2
LDMicroGtk-615a572781721256ab3098f8916fac96c880f87e.zip
Drawing Area is resized on resizing Main Window.
Diffstat (limited to 'ldmicro/maincontrols.cpp')
-rw-r--r--ldmicro/maincontrols.cpp17
1 files changed, 14 insertions, 3 deletions
diff --git a/ldmicro/maincontrols.cpp b/ldmicro/maincontrols.cpp
index 543ec53..330d5e1 100644
--- a/ldmicro/maincontrols.cpp
+++ b/ldmicro/maincontrols.cpp
@@ -122,6 +122,7 @@ static HMENU TopMenu; // Menu
static HMENU settings;
static HMENU compile;
static HMENU help;
+static HMENU ScrollWindow;
// listview used to maintain the list of I/O pins with symbolic names, plus
// the internal relay too
@@ -468,7 +469,7 @@ void MakeMainWindowControls(void)
gtk_grid_attach (GTK_GRID (grid), MakeMainWindowMenus(), 0, 0, 1, 1);
// Creating Scrolled Window
- GtkWidget* ScrollWindow = gtk_scrolled_window_new (NULL, NULL);
+ ScrollWindow = gtk_scrolled_window_new (NULL, NULL);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (ScrollWindow),
GTK_POLICY_AUTOMATIC,
GTK_POLICY_ALWAYS);
@@ -480,7 +481,7 @@ void MakeMainWindowControls(void)
gtk_widget_set_hexpand (ScrollWindow, TRUE);
// Appending tree view to pane and pane to grid
- gtk_paned_add2 (GTK_PANED(pane), view);
+ gtk_paned_pack2 (GTK_PANED(pane), view, FALSE, FALSE);
gtk_paned_set_position (GTK_PANED (pane), 250);
gtk_grid_attach (GTK_GRID (grid), pane, 0, 0, 1, 1);
@@ -743,7 +744,17 @@ void GenerateIoListDontLoseSelection(void)
RefreshControlsToSettings();
}
-
+//-----------------------------------------------------------------------------
+// Called when the main window has been resized. Adjust the size of the
+// status bar and the listview to reflect the new window size.
+//-----------------------------------------------------------------------------
+void MainWindowResized(void)
+{
+ // Make sure that the I/O list can't disappear entirely.
+ if(IoListHeight < 30) {
+ IoListHeight = 30;
+ }
+}
//-----------------------------------------------------------------------------
// Start real-time simulation. Have to update the controls grayed status