Contents | Index | < Browse | Browse >
VISUAL EDITING
===============================================================
Gui4Cli GUIs can be edited while they are running. This is done
by using the CONTROL key together with the mouse :
Moving Gadgets :
Press CONTROL-MouseClick on a Gadget or Graphic to Select it.
You will see that an outline of the gadget is drawn. You can
now let go of the CONTROL button and move the gadget outline
around in your window.
When you are satisfied with the new position, just click the
mouse and the gadget/graphic will be redrawn to this new position.
You can also use CONTROL-H instead of CONTROL-MouseClick to
select a gadget, and CONTROL-H again to place it where you
want.
This comes in handy if :
(a) you are running programs like CycleToMenu etc which may
interfere with your mouse clicks, or
(b) you are trying to paste some gadget over another gadget
in which case GadTools may eat-up the mouse clicks.
There is also a GRID available, which makes lining up the gadgets much
easier. By default the grid size is 1 which means "no grid".
You can set the grid size to any size you want, with "SET GRID 5"
(5 is a good size..) - or through the Prefs gui.
Resizing Gadgets :
You can resize a gadget by clicking on it's bottom right corner.
Note that some gadgets (such as ICONs, Images, xICONs and
CTEXT) can not be resized.
Also note that to resize a listview you have to click on the
listview's bottom right corner - *not* on the arrow buttons
(unless you use control-h).
Since LVs adjust their size automatically to show as many
lines as possible, they may be a little difficult to select
correctly for resizing..
Resizing the window :
You can enlarge or reduce the window size by resizing the
window while holding down the CONTROL key. In this case, the
window is resized, while the gadget sizes/positions remain the
same.
Cloning gadgets :
After selecting a gadget you can "clone" it (i.e. make a copy) by
using the CONTROL-J shortcut. In this case a copy of the gadget will
be created and drawn where the mouse is at.
Note that *only* the gadget information is copied.
The gadgets modifiers and it's commands are *not* copied.
Inter-GUI Cloning :
After selecting a gadget you can also place it in another
Gui4Cli window. In this case a copy of the gadget will be created
and drawn into the window where you clicked.
This enables you to make new guis by copying gadgets from other
guis - in effect, a gui editor.
Here also, *only* the gadget information is copied.
Deleting gadgets :
You can delete a gadget or graphic by selecting it and pressing
the DELETE key.
Saving your GUIs :
Once you have made the GUI of your dreams, you can save it by
pressing CONTROL-G. A simple requester will ask you if you
want to save the gui.
IMPORTANT notes on saving :
- NEVER - load a gui, then change it's file by manually editing
it and then edit & save the gui. To keep all your file notes
etc in tact, Gui4Cli remembers the line numbers of the gadgets
when the file is loaded, and then, when saving, it goes and
changes only these lines, leaving everything else untouched.
So if you have meanwhile changed the gui manually the gadget
line numbers will have changed and ... well you're looking
for trouble, that's what!
Same will happen if you visually edited the file before and
added 1 or more xCYCLER or xRADIO type gadgets. Since these need
extra lines to describe the fields they'll have, it throws the
whole numbering scheme off if you try to save the gui again
without having reloaded it first.
Hitting CONTROL-R to reload the gui (if you have changed it
manually or have added cycler/radio gads) *before* starting
to visually edit it, will reload and thereby refresh the correct
line numbers etc.
Gui4Cli will check and tell you if it doesn't find the edited
gadget where it should be in the file.
- BE VERY CAREFUL when saving multi-gui files, if you are trying
to edit more than one of the file's guis at the same time.
Reloading the gui will *not* refresh the gadget line numbers
of the other guis, since only the active gui is reloaded..
If you must edit many guis of a multi-gui file at the same time,
then reload *all* the file's guis everytime you save any one of
them.
- If you have deleted existing gadgets, then the lines of
the original GUI describing the gadget and all it's attached
commands will be commented (i.e. a ; will be added in front)
This will be done for all the lines following the gadget, until
the next gadget is declared, or the end of file is reached.
- If you have created new gadgets, these will be added at the
bottom of the GUI file. If it's a multi-gui file, then at
the end of the given gui within the file.
- Any RESIZE_BIG/RESIZE_SMALL commands that the gui file may
contain will be commented out and the gui will be saved at
it's current size.
Quirks :
- Circles are selected by clicking on their lower right quarter.
- Boxes (even filled ones) are selected by clicking on their border.
You have to click *exactly* on a pixel on their border.
- TextIn gads (and maybe some others) will give you a little
trouble if you try to paste them over themselves (i.e. move
them a tiny bit. Try to pick them up from their edges..
Final word :
Visual editing is very helpful for creating and setting up a gui
just the way you want it. However, a gui will do nothing unless you
tell it what to do - this can only be achieved by actually
programming them.
So Press CONTROL-E and get on with it..
Example : Run Gui Source