ClickTk main module.
- Maintenance
-
See clickTk_maintenance.html for details about maintenance history.
- check existence of folder
- allocate temp folder if it doesn't yet exist
- Set up main window
- Check OS
- Parse command line options
- Restore session
- Parse command line file
- Load widget's class definition
- Set up error handler
- Set up some graphic elements
- Set up main window (menu, toolbar, ...)
- Initialize project
- Start main loop .
ctkTitle
getDescriptor
getFile_opt
getGlobalVariables
getLocalVariables
getImageFolder
getMW
getNoname
getPerl
getSelected
getSelected
getTree
getType
getW_attr
getWidgets
get_picW
getmw
haveGeometry
index_of
nonVisual
selectedIsMW
selectedWidget
set_selected
Return the ref to widget in the preview corresponding to
the selected widget.
Return UNDEF if none is selected.
Return true if the $id of the selected widget is
equal to the root widget.
Make the given widget become the selected widget
- set the global variable $selected
- update the widget tree
- update the status bar
- eventually blink the widget in the preview
- return the selected widget id
Return true if the given widget's type (class)
must be managed by a geometry manager.
Return the value (0 | 1) of the nonVisual attribute
of the given widget type (class).
Return the argument to dump data to the work instance.
Compute the program state to update the main menu.
Global variables $main::projectName ,
the state of the undo-stack, the state of the clipboard
and the return value of main::isChanged() are inspected.
Additionally the return value of main::computeEditTreeState
is added.
- ischanged rv += 01 undo,redo normal
- clipboard data 02 paste normal
- !selectedIsMW 04 options,Copy,delete,rename,replace disabled
- selected is not Hidden 08 hide normal
- selected is hidden 16 unhide normal
- hasGeometry 32 view geometryInfo normal
-at least one must match 128
- always 256
Parse the line command options and
set the global variables accordingly.
Parse the line command option files.
The value is converted to standard format
depending on the actual options and stored
into $cmdLineOpt{'file'}.
Set application name and application folder
Set up an intance of type Balloon.
Arguments:
- parent widget (delaut main::getmw())
Return
Ref to widget
Get fg an bg color and apply them to all defined widgets.
get current values using message $mw->Palette
get color for -bg and -fg
set defualt values if required
reset to default colors
recolr all widget of the widget tree
repaint preview
get default options of -fg and -bg
apply the options to the given widget
apply to all children descending the widget tree
reset the default option starting at main window
repaint the preview
See module ctkDialogs
See module ctkDialogs
See module ctkDialogs
See ctkTools::_edit.
See ctkTools::_syntax.
See ctkTools::_run.
See std::dlg_selectCursor.
See required module ctkFontDialog.pm
Wrapper to std::fontExists.
Error handler
log the exception into ctk log
show the error dialog to the user
call the cleanup routine
Process the cleanup code for all exception
- issue Unbusy message to the given widget.
TODO:
exit process if inError is ON
set inError to ON
save debug info
if changed()
then do
roll back last change
save the work as ${projectname}_rescue.pl
end
else do
set inError OFF
return to caller
end
Wrapper to ctkPreview::clear
Wrapper to ctkPreview::init
Wrapper to ctkPreview::repaint
dlg_getVariables
deleteFromLocal
deleteFromGlobal
moveLocal2Global
moveGlobal2Local
editLocal
editGlobal
addLocal
addGlobal
deleteGlobal
deleteLocal
code_variables
Set up and handle the dialog to maintain
all project options
save original values for restore
set up modal dialog (message to std::dlg_codeOptions)
and wait on reply
This method performs the termination of a clickTk session.
- save the session state for restart
- save the project if it has been changed
(asking the user first)
- always save the work
- kill down all help toplevels
genScript
genPackage
genComposite
genSubroutine
code_generate
return the ref to a popup-Menu widget
The menu shows a command for each file saved
in the global variable $previousFiles.
This method sets up the project for the given file.
It is the callback of popup menu set up
by main::setupPopupMenu4PreviousFiles.
Arguments
previous file
Return
true if the job went well, false otherwise
Notes
Read project and convert to internal data.
Rteun true if the job has been well done,
false otherwise.
Return true if the given geometry manager is
in the list of the supported geometry manager
saved in the global variable $main::geomMgr .
This method issues the Forget message depending on the actal
geometry manager of the given widget.
This method issues the message Info depending on the
actual geometry manager of the given widget.
It returns an array of lines in array context, or
the number of lines in scalar context.
Send packForget to the widget in order to unmap the widget.
This is the opposite of main::hideWidget .
It deletes the given widget from the list of hidden
widgets, marks the project as changed, send the tree_repaint message
and send the repaint message to the preview.
- Rules
-
1. Clipboard data consistency (check for signature line)
-
2. All clipboard operations can be performed on single
widget selection (and all it's sub-widgets).
-
3. When placing to clipboard the data must be 'transferred'
to root hierarchy level by substitution of 'parent' for
selected widget.
-
4. While pasting data from clipboard 1st of all the type of
the selected widget (target) must be checked in order to
decide if it can accept the pasted widget.
-
5. Next check is for possible geometry management conflicts
between widget to be inserted and context. User can
choose one of following: 'propagate' | 'adopt' | 'cancel'.
-
6. Last check must be done per widget to be inserted:
does it's ID conflicting with existing widgets?
In case of conflict the widget must be renamed (main::ask_new_id_for_paste).
- Class
-
Module ctkClipboard.pm models the clipboard object.
- Methods in the package main
-
These methods implements the use of the clipboard.
On start up a clipboard operation they first instantiate
ctkClipboard to get access to the clipboard itself.
-
edit_cut
_edit_copy
edit_copy
edit_delete
_edit_delete
edit_paste
edit_replace
ask_new_id_for_paste
_adapt
- process framing & nonVisual
- determine insertion point,
handle special cases :
@legalWidgets,
NoteBook ,
Menu,
(command|checkbutton|radiobutton|separator)
- ask for widget type
- call main::do_insert
- set selected
- edit widget otions if main::autoEdit is ON
This method returns the widgets types which are legal
for the given widget or its parent.
Thus, if the given parent is of type 'Menu' the the legal widget types are
the list (cascade command checkbutton radiobutton separator).
By contrast, if the parent is of type (Menubutton cascade) then only the widget class 'Menu' is legal.
Non-Visual widgets legalize only other non-visual widgets.
Further, if the given Parent is $MW then all registered widgets classes are legal.
Otherwise, all widgets which support a geometry manager are legal.
Arguments
- parent widget (default id of widget)
- path of the widget (default selected widget)
Return
list of the legal widget types or
number of legal widgets depending on context
Notes
The concept of legal widget is not yet
fully implemented. Though, the current implementation
covers most of the needs of the every day programming.
Some special topics will be subject of future implementations
(Toplevel, Frames, non-visuals).
Edit all options of the selected widget.
Process an order for the selected widget
- Find selected element index in @ctkProject::tree
- Ask user for human-readable name here:
- Save current state for undo
- Create descriptor
- Set up default widget's values
- Set up geometry
- Add data to internal structures according to gathered parameters:
- Update the display of the widget's tree
Send message to ctkWidgetOption::edit
Return the list of sibling which need to be checked
for geometry conflicts.
It returns the list or the number of widgets depending on
the context.
Wrapper to the class ctkImages
callback
checkCallbackOption
extractMethodName
extractMethods
extractSubroutineName
extractSubroutines
pushCallback
pushMethod
pushSubroutineName
Fillmenu
SideMenu
AnchorMenu
FrameMenu
cnf_dlg_ballon
depthOfWidgetPath
id_to_path
load_cnf_dlg_ballon
map_pic
parent_path
path_to_id
replace_id
tree_get_brothers
tree_get_sons
redo
undo
undo_save
main_listBindings
main_viewWidgetStructure
view_code
convertToList wrapper to ctkParser
quotatX wrapper to ctkParser
quotatY wrapper to ctkParser
quotatZ wrapper to ctkParser
quotatZZ wrapper to ctkParser
gen_TkCode wrapper to ctkTargetCode
getWidgetIdList wrapper to ctkProject
isRef2Widget wrapper to ctkProject
parseTkCode wrapper to ctkProject
quotate wrapper to ctkWidgetOption
split_opt wrapper to ctkWidgetOption
string2Array wrapper to ctkWidgetOption
Obsolete code
- Set upe arguments for the message ctkTargetCode->parseTargetCode,
- send the message parseTargetCode to the class ctkTargetCode,
- return the return code
Return an instance of the class ctkDescriptor.
Return the default geometry options for the given
class or an empty string if none exists.
TODO: precondition : class exists in %w_attr
Return the default widgets options for the given
class or an empty string if none exists.
TODO: precondition : class exists in %w_attr
Return the name of the default geometry manager for the given
class or an empty string if none exists.
TODO: precondition : class exists in %w_attr
See module ctkParser.
Set up dialog TkAnalysis::showTkVariables
and show it.
Set up and return a string containing the
command line options according to the options
actually in use. (see globals %cmdLineOpt and $debug).
Arguments
None.
Set up the restart process depending on the
running platform and the file extension.
Arguments
file name (optional)