DIAG: Allow drawing the square the user path points to

This commit is contained in:
2014-11-14 21:28:56 +01:00
parent 1387555de6
commit ecf203c825
5 changed files with 119 additions and 9 deletions

View File

@@ -51,8 +51,10 @@ data MyGUI = MkMyGUI {
cB :: ComboBox,
-- |grid check button
gC :: CheckButton,
-- |coord check button
cC :: CheckButton
-- |coord check button
cC :: CheckButton,
-- |Path entry widget for the quad tree.
pE :: Entry
}
@@ -84,6 +86,7 @@ makeMyGladeGUI = do
<*> xmlGetWidget xml castToComboBox "comboalgo"
<*> xmlGetWidget xml castToCheckButton "gridcheckbutton"
<*> xmlGetWidget xml castToCheckButton "coordcheckbutton"
<*> xmlGetWidget xml castToEntry "path"
-- |Main entry point for the GTK GUI routines.
@@ -209,6 +212,7 @@ saveAndDrawDiag fp fps mygui =
(daW, daH) <- widgetGetSize (da mygui)
gd' <- toggleButtonGetActive (gC mygui)
ct' <- toggleButtonGetActive (cC mygui)
pE' <- entryGetText (pE mygui)
let
xD = (,) <$>
@@ -230,7 +234,8 @@ saveAndDrawDiag fp fps mygui =
dY = yD',
alg = alg',
gd = gd',
ct = ct'})
ct = ct',
pQt = pE'})
mesh)
renderWithDrawable dw r
if null fps

View File

@@ -380,6 +380,7 @@ Public License instead of this License.
<property name="height_request">750</property>
<property name="can_focus">False</property>
<property name="title" translatable="yes">CG2</property>
<property name="window_position">mouse</property>
<property name="type_hint">dialog</property>
<child>
<widget class="GtkVBox" id="vbox1">
@@ -460,6 +461,18 @@ Public License instead of this License.
<property name="position">2</property>
</packing>
</child>
<child>
<widget class="GtkHSeparator" id="hseparator2">
<property name="visible">True</property>
<property name="can_focus">False</property>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="padding">5</property>
<property name="position">3</property>
</packing>
</child>
<child>
<widget class="GtkHBox" id="hbox2">
<property name="visible">True</property>
@@ -757,7 +770,71 @@ Public License instead of this License.
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">3</property>
<property name="position">4</property>
</packing>
</child>
<child>
<widget class="GtkHSeparator" id="hseparator1">
<property name="visible">True</property>
<property name="can_focus">False</property>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="padding">5</property>
<property name="position">5</property>
</packing>
</child>
<child>
<widget class="GtkHBox" id="hbox5">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<widget class="GtkLabel" id="pathlabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">QuadTree Path</property>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="padding">5</property>
<property name="position">0</property>
</packing>
</child>
<child>
<widget class="GtkEntry" id="path">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="invisible_char">●</property>
<property name="primary_icon_activatable">False</property>
<property name="secondary_icon_activatable">False</property>
<property name="primary_icon_sensitive">True</property>
<property name="secondary_icon_sensitive">True</property>
</widget>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">6</property>
</packing>
</child>
<child>
<widget class="GtkHSeparator" id="hseparator3">
<property name="visible">True</property>
<property name="can_focus">False</property>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="padding">5</property>
<property name="position">7</property>
</packing>
</child>
<child>
@@ -773,7 +850,7 @@ Show quad tree squares</property>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">4</property>
<property name="position">8</property>
</packing>
</child>
</widget>