widget.tcl
This file is part of Unifix BWidget Toolkit
$Id: widget.tcl,v 1.21 2002/10/14 20:54:52 hobbs Exp $
Index of commands:
- Widget::tkinclude
- Widget::bwinclude
- Widget::declare
- Widget::addmap
- Widget::init
- Widget::destroy
- Widget::setoption
- Widget::configure
- Widget::cget
- Widget::subcget
- Widget::hasChanged
- Widget::_get_tkwidget_options
- Widget::_test_tkresource
- Widget::_test_bwresource
- Widget::_test_synonym
- Widget::_test_string
- Widget::_test_flag
- Widget::_test_enum
- Widget::_test_int
- Widget::_test_boolean
Each megawidget gets a namespace of the same name inside the Widget namespace
Each of these has an array opt, which contains information about the
megawidget options. It maps megawidget options to a list with this format:
{optionType defaultValue isReadonly {additionalOptionalInfo}}
Option types and their additional optional info are:
TkResource {genericTkWidget genericTkWidgetOptionName}
BwResource {nothing}
Enum {list of enumeration values}
Int {Boundary information}
Boolean {nothing}
String {nothing}
Flag {string of valid flag characters}
Synonym {nothing}
Color {nothing}
Next, each namespace has an array map, which maps class options to their
component widget options:
map(-foreground) => {.e -foreground .f -foreground}
Each has an array ${path}:opt, which contains the value of each megawidget
option for a particular instance $path of the megawidget, and an array
${path}:mod, which stores the "changed" status of configuration options.
| Widget | |
| Comments | Steps for creating a bwidget megawidget: 1. parse args to extract subwidget spec 2. Create frame with appropriate class and command line options 3. Get initialization options from optionDB, using frame 4. create subwidgets Uses newer string operations |
| Arguments | |
| Used by | |
| Uses | |
namespace eval Widget { |
|
| Widget::_configure_option | |
| Comments | Command Widget::_configure_option |
| Arguments | option altopt |
| Used by | |
| Uses | |
proc Widget::_configure_option { option altopt } { |
|
| Widget::_get_configure | |
| Comments | Command Widget::_get_configure returns the configuration list of options (as tk widget do - [$w configure ?option?]) |
| Arguments | path options |
| Used by | |
| Uses | |
proc Widget::_get_configure { path options } { |
|
| Widget::_get_tkwidget_options | |
| Comments | Command Widget::_get_tkwidget_options |
| Arguments | tkwidget |
| Used by | Widget::parseArgs |
| Uses | |
proc Widget::_get_tkwidget_options { tkwidget } { |
|
| Widget::_get_window | |
| Comments | Command Widget::_get_window returns the window corresponding to widget path |
| Arguments | class path |
| Used by | |
| Uses | |
proc Widget::_get_window { class path } { |
|
| Widget::_test_boolean | |
| Comments | Command Widget::_test_boolean |
| Arguments | option value arg |
| Used by | |
| Uses | |
proc Widget::_test_boolean { option value arg } { |
|
| Widget::_test_bwresource | |
| Comments | Command Widget::_test_bwresource |
| Arguments | option value arg |
| Used by | |
| Uses | |
proc Widget::_test_bwresource { option value arg } { |
|
| Widget::_test_color | |
| Comments | Command Widget::_test_color |
| Arguments | option value arg |
| Used by | |
| Uses | |
proc Widget::_test_color { option value arg } { |
|
| Widget::_test_enum | |
| Comments | Command Widget::_test_enum |
| Arguments | option value arg |
| Used by | |
| Uses | |
proc Widget::_test_enum { option value arg } { |
|
| Widget::_test_flag | |
| Comments | Command Widget::_test_flag |
| Arguments | option value arg |
| Used by | |
| Uses | |
proc Widget::_test_flag { option value arg } { |
|
| Widget::_test_int | |
| Comments | Command Widget::_test_int |
| Arguments | option value arg |
| Used by | |
| Uses | |
proc Widget::_test_int { option value arg } { |
|
| Widget::_test_string | |
| Comments | Command Widget::_test_string |
| Arguments | option value arg |
| Used by | |
| Uses | |
proc Widget::_test_string { option value arg } { |
|
| Widget::_test_synonym | |
| Comments | Command Widget::_test_synonym |
| Arguments | option value arg |
| Used by | |
| Uses | |
proc Widget::_test_synonym { option value arg } { |
|
| Widget::_test_tkresource | |
| Comments | Command Widget::_test_tkresource |
| Arguments | option value arg |
| Used by | |
| Uses | |
proc Widget::_test_tkresource { option value arg } { |
|
| Widget::addmap | |
| Comments | Command Widget::addmap |
| Arguments | class subclass subpath options |
| Used by | |
| Uses | |
proc Widget::addmap { class subclass subpath options } { |
|
| Widget::bwinclude | |
| Comments | Command Widget::bwinclude Includes BWidget resources to BWidget widget. class class name of the BWidget subclass BWidget class to include subpath subpath to configure args additionnal args for included options |
| Arguments | class subclass subpath args |
| Used by | |
| Uses | |
proc Widget::bwinclude { class subclass subpath args } { |
|
| Widget::configure | |
| Comments | Command Widget::configure |
| Arguments | path options |
| Used by | Button::create ScrollView::configure Dialog::configure Separator::configure ProgressBar::configure ListBox::configure PagesManager::configure MainFrame::configure Tree::configure NoteBook::configure ListBox::itemconfigure NoteBook::_itemconfigure ScrollableFrame::configure Tree::itemconfigure ArrowButton::configure LabelEntry::configure Entry::configure Button::configure TitleFrame::configure DynamicHelp::configure ButtonBox::configure ComboBox::configure LabelFrame::configure PasswdDlg::configure ProgressDlg::configure Widget::setoption SelectFont::configure ScrolledWindow::configure BWLabel::configure PanedWindow::configure SpinBox::configure |
| Uses | |
proc Widget::configure { path options } { |
|
| Widget::copyinit | |
| Comments | Bastien Chevreux (bach@mwgdna.com) copyinit performs basically the same job as init, but it uses a existing template to initialize its values. So, first a perferct copy from the template is made just to be altered by any existing options afterwards. But this still saves time as the first initialization parsing block is skipped. As additional bonus, items that differ in just a few options can be initialized faster by leaving out the options that are equal. This function is currently used only by ListBox::multipleinsert, but other calls should follow :) Command Widget::copyinit |
| Arguments | class templatepath path options |
| Used by | ListBox::multipleinsert |
| Uses | |
proc Widget::copyinit { class templatepath path options } { |
|
| Widget::declare | |
| Comments | Command Widget::declare Declares new options to BWidget class. |
| Arguments | class optlist |
| Used by | DragSite::include DynamicHelp::include DropSite::include |
| Uses | |
proc Widget::declare { class optlist } { |
|
| Widget::destroy | |
| Comments | Command Widget::destroy |
| Arguments | path |
| Used by | ScrollView::_destroy DropSite::register Separator::create SpinBox::_destroy TitleFrame::create ScrolledWindow::_destroy NoteBook::_destroy SelectColor::menu MainFrame::_destroy ButtonBox::_destroy PanedWindow::_destroy Tree::_subdelete SelectFont::_draw BWLabel::create MessageDlg::create Dialog::_destroy ArrowButton::_destroy Tree::_destroy PagesManager::_destroy ProgressBar::_destroy DragSite::register Entry::_destroy ListBox::delete SelectFont::_destroy ListBox::_destroy |
| Uses | |
proc Widget::destroy { path } { |
|
| Widget::focusNext | |
| Comments | Command Widget::focusNext Same as tk_focusNext, but call Widget::focusOK |
| Arguments | w |
| Used by | |
| Uses | |
proc Widget::focusNext { w } { |
|
| Widget::focusOK | |
| Comments | Command Widget::focusOK Same as tk_focusOK, but handles -editable option and whole tags list. |
| Arguments | w |
| Used by | BWLabel::setfocus |
| Uses | |
proc Widget::focusOK { w } { |
|
| Widget::focusPrev | |
| Comments | Command Widget::focusPrev Same as tk_focusPrev, but call Widget::focusOK |
| Arguments | w |
| Used by | |
| Uses | |
proc Widget::focusPrev { w } { |
|
| Widget::getMegawidgetOption | |
| Comments | Widget::getMegawidgetOption -- Bypass the superfluous checks in cget and just directly peer at the widget's data space. This is much more fragile than cget, so it should only be used with great care, in places where speed is critical. Arguments: path widget to lookup options for. option option to retrieve. Results: value option value. |
| Arguments | path option |
| Used by | DropSite::register ArrowButton::create Button::_release ComboBox::getvalue Tree::visiblenodes ComboBox::_mapliste Button::_repeat SpinBox::_modify_value ComboBox::setvalue Button::invoke Dialog::draw Button::create Entry::invoke Entry::create DragSite::register Tree::insert SpinBox::getvalue ComboBox::_select ComboBox::_modify_value Entry::configure SpinBox::setvalue Button::_press SpinBox::_test_options |
| Uses | |
proc Widget::getMegawidgetOption {path option} { |
|
| Widget::hasChanged | |
| Comments | Command Widget::hasChanged |
| Arguments | path option pvalue |
| Used by | ScrolledWindow::configure ScrollView::configure MainFrame::configure ScrollableFrame::configure PanedWindow::configure Tree::itemconfigure ButtonBox::configure Dialog::configure DropSite::setdrop Tree::configure Separator::configure NoteBook::configure ArrowButton::configure ListBox::itemconfigure ListBox::configure DragSite::setdrag NoteBook::_itemconfigure BWLabel::configure TitleFrame::configure DynamicHelp::configure SelectFont::configure |
| Uses | Widget::cget |
proc Widget::hasChanged { path option pvalue } { |
|
| Widget::hasChangedX | |
| Comments | |
| Arguments | path option args |
| Used by | DynamicHelp::sethelp Button::configure SpinBox::configure ComboBox::configure Entry::configure ProgressBar::configure |
| Uses | |
proc Widget::hasChangedX { path option args } { |
|
| Widget::init | |
| Comments | Command Widget::init |
| Arguments | class path options |
| Used by | ListBox::multipleinsert PanedWindow::create ListBox::insert LabelFrame::create ListBox::create ScrollableFrame::create SelectFont::create DropSite::register NoteBook::insert NoteBook::create TitleFrame::create ButtonBox::create MainFrame::create Tree::insert Tree::create DragSite::register ScrollView::create PagesManager::create SelectColor::dialog ScrolledWindow::create SelectColor::menu PanedWindow::add |
| Uses | |
proc Widget::init { class path options } { |
|
| Widget::initFromODB | |
| Comments | Widget::initFromODB -- Initialize a megawidgets options with information from the option database and from the command-line arguments given. Arguments: class class of the widget. path path of the widget -- should already exist. options command-line arguments. Results: None. |
| Arguments | class path options |
| Used by | BWLabel::create ProgressBar::create Button::create PasswdDlg::create ComboBox::create LabelEntry::create Entry::create Dialog::create Separator::create ProgressDlg::create SpinBox::create MessageDlg::create ArrowButton::create |
| Uses | |
proc Widget::initFromODB {class path options} { |
|
| Widget::parseArgs | |
| Comments | Widget::parseArgs -- Given a widget class and a command-line spec, cannonize and validate the given options, and return a keyed list consisting of the component widget and its masked portion of the command-line spec, and one extra entry consisting of the portion corresponding to the megawidget itself. Arguments: class widget class to parse for. options command-line spec Results: result keyed list of portions of the megawidget and that segment of the command line in which that portion is interested. |
| Arguments | class options |
| Used by | Button::create ProgressBar::create LabelEntry::create Entry::create MessageDlg::create PasswdDlg::create SpinBox::create Separator::create ProgressDlg::create Dialog::create BWLabel::create ComboBox::create ArrowButton::create |
| Uses | Widget::_get_tkwidget_options |
proc Widget::parseArgs {class options} { |
|
| Widget::setMegawidgetOption | |
| Comments | Widget::setMegawidgetOption -- Bypass the superfluous checks in cget and just directly poke at the widget's data space. This is much more fragile than configure, so it should only be used with great care, in places where speed is critical. Arguments: path widget to lookup options for. option option to retrieve. value option value. Results: value option value. |
| Arguments | path option value |
| Used by | SpinBox::_test_options |
| Uses | |
proc Widget::setMegawidgetOption {path option value} { |
|
| Widget::setoption | |
| Comments | Command Widget::setoption |
| Arguments | path option value |
| Used by | ButtonBox::configure SelectFont::_update Tree::_recexpand |
| Uses | Widget::configure |
proc Widget::setoption { path option value } { |
|
| Widget::subcget | |
| Comments | Command Widget::subcget |
| Arguments | path subwidget |
| Used by | Tree::create ScrollableFrame::create ScrolledWindow::create MainFrame::create ListBox::create NoteBook::create LabelFrame::create PagesManager::create ButtonBox::create ScrollView::create TitleFrame::create |
| Uses | |
proc Widget::subcget { path subwidget } { |
|
| Widget::syncoptions | |
| Comments | Command Widget::syncoptions |
| Arguments | class subclass subpath options |
| Used by | |
| Uses | |
proc Widget::syncoptions { class subclass subpath options } { |
|
| Widget::tkinclude | |
| Comments | Command Widget::tkinclude Includes tk widget resources to BWidget widget. class class name of the BWidget tkwidget tk widget to include subpath subpath to configure args additionnal args for included options |
| Arguments | class tkwidget subpath args |
| Used by | |
| Uses | |
proc Widget::tkinclude { class tkwidget subpath args } { |
|
| Widget::varForOption | |
| Comments | Widget::varForOption -- Retrieve a fully qualified variable name for the option specified. If the option is not one for which a variable exists, throw an error (ie, those options that map directly to widget options). Arguments: path megawidget to get an option var for. option option to get a var for. Results: varname name of the variable, fully qualified, suitable for tracing. |
| Arguments | path option |
| Used by | ComboBox::_create_popup |
| Uses | |
proc Widget::varForOption {path option} { |
|