ctkWidgetOption

        This class models the options of a widget.

Programming notes

Base class
        ctkParser
Class member
        $debug
Data member
        See base class

Maintenance

        Author: MARCO
        Date:   01.01.2007
        History
                        05.12.2007 refactoring
                        10.09.2008 version 1.02 minor enhancements
                        28.10.2008 version 1.03
                        07.12.2009 version 1.04

Methods

preprocessOptions

        Eliminate positional option for scrolled widgets
        like scrolled('listbox', <options>)

split_opt

        input: options string
        output: array of pairs (-param=>value,-param2=>value2,...)
        input  := (option)
        option := name ',' | '=>' value
        name   := \w+
        value  := [\w\s]+
        output := (name,option)
        Processing
                - eliminate positional option by means of message preprocessOptions,
                - resolve qw/qq constructs by means of message parse_qw_array()
                - parse the string by means of message parseString,
                - convert token list into widget options list using message parseWidgetOptions,
                - return option's list or size of the list
                depending on context.
        Note
                the client code set up and sends message split_opt,
                split_opt sends message parse_qw_array(@w)
                parse_qw_array sends message _split_opt($opt)

quotate

        Quotate option's values of the given list.
        Argument
                widget constructor statement
        Return
                string containing the same constructor statement but with quotated values.
        Note
                It calls split_opt to parse the options list.

validateOptions

        This method validates the given options-HASH
                - get rid of empty options,
                - quotate the values by means of quotatY,
                - eval the options to find sytax errors,
                - check some specaial cases like -text and -image,
                - return the discovered errors aas a string or
                  UNDEF if none has been found.
        Arguments
                - widget ID
                - ref to option's HASH
        Returns
                - string or UNDEF

edit

        Edit the widget's options which are defined
        in the widget class defintion.
        Precondition
                widget must be selected
        Arguments
                ref to parent widget
        Return values
                1      on successful editing
                undef  if no editsing has been performed

Back to index