Package: uiDocForm
use class::ui::uiDocForm;
The file uiDocForm.pm is located in the subdirectory './class/ui'
This packages contains all functions that are needed to build and modify the user interface of a DocForm object (DocForm.pm).
This is the stuff I don't like on the Tk toolkit: Large spaghetti-code just to produce the GUI of one Window. So I put all these functions in a separate file in ./class/ui, where every window has one file that produces the GUI. I try to prevent to work in these files often, because I hate them.
This package file is not designed to function as an object, so there are no attributes, no methods and no Get/Set functions, it is only a package of functions that belong thematically together (They are working with the same window object).
The windows object is placed in ./class, there is all of the windows functionality
Coding: 90% done
Documentation: up-do-date
uiDocForm::build_ui_first_step($ref_docform);
Builds up the user interface of a DocForm object and stores the references to all created widgets in the $ref_docform->{'ui'} hash.
This function builds up everything except the OptionMenus, because these need to be uild up later in the processing of the constructor of the DocForm object (DocForm.pm). This is done in the other functions called 'build_ui_second_step(..)' and 'build_ui_third_step(..)'in this package.
The attributes are accessed directly ($ref_docform->{'ui'}->{...}) because there is no Get/Set-method for each widget.
F.ex. the Toplevel is created in $ref_docform->{'ui'}->{'top'}.
Parameters:
(+) $ref_docform: Reference to the DocForm object which user interface has to be created
uiDocForm::build_ui_second_step($ref_docform);
Builds up the rest of the user interface of a DocForm object. Everything that is not done by the function 'build_ui_first_step'.
uiDocForm::build_ui_second_step() is called very late in the DocForm-constructor, when almost everything of the DocForm object is initialised already. This is necessery for the style-lists and the backend. They are filled, but the Frame that holds them is still not packed.
The attributes are accessed directly ($ref_docform->{'ui'}->{...}) because there is no Get/Set-method for each widget.
Parameters:
(+) $ref_docform: Reference to the DocForm object which user interface has to be created
uiDocForm::build_ui_third_step($ref_docform);
Builds up the third part of the user interface of a DocForm object.
uiDocForm::build_ui_third_step() is called very late in the DocForm-constructor, when almost everything of the DocForm object is initialised already. This is necessery for the style-lists and the backend. This function performs the packing of the Toolbox that contains the style-selection drop-down-components.
The attributes are accessed directly ($ref_docform->{'ui'}->{...}) because there is no Get/Set-method for each widget.
Parameters:
(+) $ref_docform: Reference to the DocForm object which user interface has to be created
my $new_doctext
= uiDocForm::build_doctext($ref_docform,
$pack_it, $bind_events);
Builds the 'doctext' textwidget and sets all neccessary bindings for key and mouse events.
This is done in a seperate function, because the text widget has to be rebuild several times again. This is because tests have shown that it is much more faster to destroy and rebuild an exiting text widget instead of clearing all text and tags in it.
The function return a reference to the new text widget.
Parameters:
(+) $ref_docform: Reference to the DocForm object which user interface has to be created
(+) $pack_it: If set to 1, the textwidget gets packed now, if set to 0, it stays unpacked. (This is used for allowing it to build up a loaded document invisible in the background and displaying it at-once. This is much fatser and prevents flickering on the screen.
(+) $bind_events: If set to 1, the cursor movements get binded now. (same reason as the above option)
uiDocForm::doctext_bind_events($ref_docform, $ref_doctext);
Binds the events to the Text widget
This is done seperatly to allow creating of the doctext and binding the events later. Only used for loading a new document (speed issues).
Parameters:
(+) $ref_docform: A reference to the DocForm object which user interface has to be created
(+) $ref_doctext: A reference to the Text widget