fromHelp.gif (4612 bytes)

Visual Editing
In Gui4Cli the gadgets in the guis can be moved around, resized, deleted, cloned or cloned into other guis, while the gui is running.
Selecting Gadgets :
At any time you can select a gadget for editing by clicking on it with the Right Mouse button while holding down the  Control key. A rectangle will be drawn around the gadget's window. You can now let go of the Control key and move the gadget around.

Sometimes a gadget may be below another and difficult to select. You can select the one on top of it and then press TAB (or "[", or "]") to switch to the other gadgets, below this one. Also, you can press N to select the next gadget in the gui. This will rotate through all of the gui's visible gadgets.

Moving Gadgets :
After you select a gadget with Control - RMButton, the resize cursor will be shown and you can move the gadget around with the mouse or with the Arrow keys. The outline of the gadget will move in increments of the current Grid size (which is 5 pixels, by default). You can increase or decrease the grid size using the + or - keys.

While moving, you can press the space bar to enter Resize mode.

Ending the editing
When you are satisfied with the new position (or size), you can set the gadget down to its new position by Clicking the Left Mouse button or pressing the Enter key.

If you want to abort without changing the gadget, Click the Right mouse button or press the Escape key.

Resizing Gadgets :
You can select a gadget for resizing by Clicking on the lower right corner of its window. The resize cursor will be shown. You can resize the gadget using the mouse or the arrow keys.

Sometimes it may be difficult to click on the low right corner because things like scroll bars etc (which are independent windows) interfere with your clicks (happens in listviews, drop lists etc). In this case select the gadget for moving and change to resize mode with the space bar.

Resizing the Window
When you resize the window all the gadgets will remain in the same place, unless you have told them how to resize/reposition themselves with the Resize Attribute or with Winresize. In this case you will need to be able to resize the window (to make more room for gadgets) without having them resize themselves automatically. This is done by holding down the Control key while resizing the window.
Cloning gadgets (same or other window)
After selecting a gadget you can "clone" it (i.e. make a copy) in the same window by pressing "C". A copy of the gadget will  be created and drawn where the outline of the gadget is.

If, while the gadget is selected, you move the mouse over another Gui4Cli window, the gadget's outline will be drawn into the other window. You can now Click the Left mouse button (or the enter key) and a copy of the gadget you had selected will  be created and drawn into this other window.

Note that in either case only the basic gadget information, such as size, type, etc are copied. The gadget attributes and commands are not copied. This means that the gadget may not look like the one you cloned it from and you have to add manually any extra attributes (such as frames etc) that you may want.

Deleting gadgets :
You can delete a gadget by selecting it and pressing the Delete key. The gadget will be removed from the window.

After you save the gui and have a look at its code, you'll note that Gui4Cli has commented the line where the gadget is declared as well as all its commands - ie all the lines that follow the gadget, up until another gadget declaration (or end of file). So you can undo the delete by uncommenting the lines in your text editor, or just deleting them all if you really want the gadget removed.

Saving your GUIs
When you are finished moving gadgets around you can save the gui by pressing Control-S. A dialog will appear, asking you if you want to save the gui. Note that when you save it, the gui, (including its window size/position) will be changed forever.

Important notes on saving :

To keep all your file comments etc in tact, Gui4Cli remembers the line numbers of the gadgets when it loads the file, and then, when saving, it goes and changes only these lines, leaving everything else untouched. This means that if it doesn't find the gadget line where it expects it, it will issue an error and abort.

This will happen if, for example, you load a gui, then manually edit its file, then move its gadgets around and then try to save it.

It will also happen if you add gadgets to multi-gui files. When Gui4Cli saves the gui, it will add the new gadgets at the end of the gui's code, before the NewFile command which declares the next gui. This means that all the line numbers of the gadgets in the next guis, will change and Gui4Cli will not find them if you try to save any of them.

The best thing to do is to Reload a gui (by hiting Control-R), before starting to visually edit it or after you save it, thereby refreshing all the gadget line numbers.

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 it.

So Press Control-E and get on with it..