TEXT 27
OpenGUI-VCL Guest on 6th September 2020 05:43:49 PM
  1. OpenGUI
  2. Miroslav Kharchuk, Ukraine 1998
  3.  
  4.  
  5.           Classes for Visual Components Library (VCL).
  6.  
  7.  
  8.  
  9.      1. General information
  10.      2. Class
  11.      3. Components
  12.  
  13.  
  14.  
  15.      1. General information
  16.  
  17.  
  18.      Each class of VCL describes one visual component only, embedded
  19. into owner window.
  20.  
  21.      Position of the component is given relatively to top-left corner
  22. of the viewport of the owner window.
  23.  
  24.      Visual components are adjustible ,that is fit into the the window,
  25. provide auto-correction for a length of the text constants (where used)
  26. and other.
  27.  
  28.      Being used, VCL classes are listed (in the format given below)
  29. in the section Controls-section in FRM-file.
  30.  
  31.      Any kind of errors or unexactnesses causes avioding the components,
  32. but not the run-time errors.
  33.  
  34.      Number of spaces (or blank text lines) is not considered by in-built
  35. resources compiler.
  36.  
  37.      Manual adusting of the visual components is possible by means of
  38. in-built visual editor (on pressing right mouse button on the component).
  39.  
  40.      For examples, see demonstration package "OpenGUI".
  41.  
  42.  
  43.      2. Class
  44.  
  45.  Class "Class_Name" {
  46.  
  47.   Name="Component_Name"
  48.   ID=2
  49.   Metrics=(x, y, width, height)
  50.   Dockable=0
  51.  
  52.  
  53.  
  54.   Data {
  55.     [...Data...]
  56.   }
  57.  }
  58.  
  59.  
  60.  
  61.      where: Class - keyword for ANY class;
  62.                        "Class_Name" - name of the predefined class
  63.                               (see source code package).
  64.  
  65.  
  66.      Keywords for parameters:
  67.  
  68.             Name   - proper name of the component (upto 40 ASCII symbols),
  69.                            (used if FRM-file (frames descriptor) to refer a component);
  70.             ID         - integer identification number
  71.  
  72.             Metrics=(x, y, width, height)
  73.          where :
  74.  
  75.                        x, y       - left-top corner;
  76.                        width,
  77.                        height - size of VC;
  78.  
  79.     Dockable=N    , applicable for some components (areas, scrollbars, scalelines, other)
  80.               when resizing the windows, it is “docked” to some position
  81.          where :
  82.  
  83.                N = 0 (or not quoted) - component is not “docked” to any border,
  84.                N = 1 - component is “docked” to the right border
  85.                N = 2 - component is “docked” to the bottom border
  86.                N = 3 - component is “docked” to the right-bottom corner
  87.                N = 4 - component is “docked” to the corner image (for scrollbars)
  88.  
  89.  
  90.  
  91.  
  92.  
  93.      * If parameters are omitted or quoted wrong then ether no reference to
  94.        the component is provided or metrics of VC is "tied up" to the point.
  95.  
  96.             Data - Data section (differ from class to class).
  97.                        Described for each VC class in chapter "Components".
  98.  
  99.             {...} (inner) - open and closing brackets for Data section.
  100.             {...} - open and closing brackets for class.
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.      3. Components
  109.  
  110.  
  111.  
  112.      - Button -
  113.  
  114.  Class type "tVCButton".
  115.  
  116.  Data section :
  117.  
  118.   Example :
  119.  
  120.   Data {
  121.     Font={"FONTS\sys16.fnt", (0, 0, 0, 1)}
  122.     IconSrc="IMAGES\rivets.bmp"
  123.     StripAngles=0
  124.   }
  125.  
  126.   Parameters :
  127.  
  128.    Font={"Font_Name", (p1, p2, p3, 1)} -
  129.                  Font_Name - name of used bitmapped font
  130.                  style record in brackets -
  131.                              p1 - italic, p2 - bold, p3 - inderlined
  132.                              (1 - paremeter is used; 0 - not used)
  133.                              * 4th parameter is optional
  134.  
  135.    IconSrc       - source for icon image, if used
  136.  
  137.    StripAngles - (0 - corners with right angles; 1 and greater - stripped)
  138.  
  139.   Notes : This class splits into 4 derivative classes depending
  140.                 on the usage of above mentioned parameters, particularly :
  141.  
  142.      1) "Untitled button" (blank) - Font and IconSrc are omitted;
  143.      2) "Button with a text"          - IconSrc is not used;
  144.      3) "Button with an icon"       - Font quotation is omitted;
  145.      4) "Combined button"          - Font and IconSrc are quoted;
  146.                                     * Text follows the Icon on the right.
  147.  
  148.       Auto-trimming for the text is performed, if it's width exceeds
  149.       the button width.
  150.  
  151.       Parameter StripAngles =1 if used for emulation such OSes as Apple Macintosh.
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.      - StaticText -
  166.  
  167.  Class type "tVCStaticText".
  168.  
  169.  Data section :
  170.  
  171.   Example :
  172.  
  173.   Data {
  174.     Font={"FONTS\sys16.fnt", (0, 0, 1, 1)}
  175.     RGBColor=(200, 100, 150, 0)
  176.   }
  177.  
  178.   Parameters :
  179.  
  180.     Font           - see component "Button";
  181.     RGBColor - RGB color for drawing
  182.                Example: (20, 240, 200, 0) - Red   = 20
  183.                                                         Green = 240
  184.                                           Blue  = 200
  185.                         * Last zero is optional.
  186.  
  187.   Notes : If RGBColor is not defined, text is drawn in BLACK.
  188.                Auto-trimming for the text is performed, if it's width exceeds
  189.                the width gived in metrics.
  190.  
  191.  
  192.  
  193.      - Icon -
  194.  
  195.  Class type "tVCIcon".
  196.  
  197.  Data section :
  198.  
  199.   Example :
  200.  
  201.   Data {
  202.     IconSrc="IMAGES\rivets.bmp"
  203.   }
  204.  
  205.   Parameters :
  206.  
  207.    IconSrc     - source for icon image
  208.  
  209.   Notes: none.
  210.  
  211.  
  212.  
  213.  
  214.  
  215.  
  216.  
  217.  
  218.  
  219.  
  220.  
  221.      - Palette -
  222.  
  223.  Class type "tVCPalette".
  224.  
  225.  Data section :
  226.  
  227.   Example :
  228.  
  229.   Data {
  230.     TopLeftRGB=(100, 100, 100, 0)
  231.     BottomRightRGB=(200, 200, 200, 0)
  232.     ExcludeColor=3
  233.   }
  234.  
  235.   Parameters :
  236.  
  237.     TopLeftRGB          - start RGB value, refered to top-left corner
  238.     BottomRightRGB  - ending RGB value, refered to bottom-right corner
  239.     ExcludeColor         - color, which is not used for color conversion
  240.  
  241.   Notes : Component is auto-adustible, that is scales self to "fit"
  242.               in the size. It provides 2-colors conversion ONLY.
  243.  
  244.  
  245.  
  246.      - Gradient -
  247.  
  248.  Class type "tVCGradient".
  249.  
  250.  Data section :
  251.  
  252.   Example :
  253.  
  254.   Data {
  255.     TopLeftRGB=(100, 100, 100, 0)
  256.     BottomRightRGB=(200, 200, 200, 0)
  257.   }
  258.  
  259.  
  260.   Parameters :
  261.  
  262.     TopLeftRGB         - start RGB value, refered to top-left corner
  263.     BottomRightRGB - ending RGB value, refered to bottom-right corner
  264.  
  265.   Notes : Component is auto-adustible, that is scales self to "fit"
  266.                 in the size. It provides 3-colors gradient.
  267.  
  268.  
  269.  
  270.  
  271.  
  272.  
  273.  
  274.  
  275.      - Bevel -
  276.  
  277.  Class type "tVCBevel".
  278.  
  279.  Data section :
  280.  
  281.   Example :
  282.  
  283.   Data {
  284.     Font={"FONTS\sys16.fnt", (0, 0, 1, 1)}
  285.   }
  286.  
  287.   Parameters :
  288.  
  289.    Font     - see component "Button";
  290.  
  291.   Notes : This class splits into 2 derivative classes depending
  292.                 on the usage of above mentioned parameter, particularly :
  293.  
  294.      1) "Rectangle bevel" - Font is omitted;
  295.      2) "Named bevel"       - Font is used.
  296.  
  297.           * Bevel is drawn in black and shaded in white color.
  298.  
  299.  
  300.  
  301.  
  302.      - Editbox -
  303.  
  304.  Class type "tVCEditbox".
  305.  
  306.  Data section :
  307.  
  308.   Example :
  309.  
  310.   Data {
  311.     Font={"FONTS\sys16.fnt", (0, 0, 0, 1)}
  312.     RGBColor=(50, 60, 50, 0)
  313.  
  314.     ValueType=1
  315.     Value="some string"
  316.     ValueFont={"FONTS\sys8.fnt", (0, 0, 0, 1)}
  317.  
  318.     HighLightedRGB=(50, 50, 200, 0)
  319.  
  320.     IsTicker=1
  321.     Width=15
  322.     Capture=2
  323.   }
  324.  
  325.   Parameters :
  326.  
  327.     Font             - see component "Button";
  328.     RGBColor   - RGB color for drawing a name;
  329.  
  330.     ValueType   - type of the value (1 - string; 2 - integer; 3 - unsigned real);
  331.     Value            - value properly
  332.     ValueFont    - font for drawing a value in the box;
  333.  
  334.     HighLightedRGB - RGB color for highlighting a value (when focused);
  335.  
  336.     IsTicker       - whether to use a spinner (ticker) - 2 buttons "up" and "down";
  337.     Width           - width of spinner in pixels;
  338.     Capture       - type of drowing a capture (name)
  339.                            (1 - on the left; 2 - over the box; 3 - on the right)
  340.  
  341.   Notes: Auto-trimming for the value of any type is performed,
  342.                if it's text length exceeds the width of the editbox.
  343.  
  344.  
  345.  
  346.      - ScrollBar -
  347.  
  348.  Class type "tVCScrollBar".
  349.  
  350.  Data section :
  351.  
  352.   Example :
  353.  
  354.   Data {
  355.     LTImgSrc="IMAGES\w95_u.bmp"
  356.     RBImgSrc="IMAGES\w95_d.bmp"
  357.  
  358.     ImgSrc="IMAGES\pattern1.bmp"
  359.     Items=200
  360.   }
  361.  
  362.   Parameters :
  363.  
  364.     LTImgSrc  - source for either left or top image drawn on the button (arrow);
  365.     RBImgSrc - source for either right or bottom image drawn on the button (arrow);
  366.  
  367.     ImgSrc      - source for background image for scrollbar
  368.                          * If not quoted, there is used a color of the "ScrollLine"
  369.                            building component.
  370.     Items         - number of items (text- or pixel- lines) served by the scrollbar,
  371.                          when event-handling is provided.
  372.  
  373.   Notes : This class splits into 2 derivative classes depending
  374.                 on the metrics given, particularly :
  375.  
  376.      1) "Vertix bar"      - height exceeds width;
  377.      2) "Horizon bar"  - width exceeds height;
  378.  
  379.           * Auto-adustible component.
  380.  
  381.  
  382.  
  383.  
  384.  
  385.      - ScaleLine -
  386.  
  387.  Class type "tVCScaleLine".
  388.  
  389.  Data section :
  390.  
  391.   Example :
  392.  
  393.   Data {
  394.     Items=20
  395.     Type=1
  396.   }
  397.  
  398.   Parameters :
  399.  
  400.     Items - number of pixels between large touches
  401.     Type  -  type of drawing the touches
  402.          (1 - centered; 2 - over the line/on the left; 3 - under the line/on the right)
  403.  
  404.  
  405.   Notes : This class splits into 2 derivative classes depending
  406.                on the metrics given, particularly :
  407.  
  408.      1) "Vertix line"      - height exceeds width;
  409.      2) "Horizon line"  - width exceeds height;
  410.  
  411.           * Auto-adustible component.
  412.           * There are 5 small touches drawn between large touches
  413.             (in case number of pixels between large touches at least 5).
  414.  
  415.  
  416.  
  417.  - Area -
  418.  
  419.  Class type "tVCArea".
  420.  
  421.  Data section :
  422.  
  423.   Example :
  424.  
  425.   Data {
  426.      Scrollable=4
  427.      Width=20
  428.   }
  429.  
  430.   Parameters :
  431.  
  432.     Scrollable       - whether an area has the scrollbars
  433.                                0 (or not quoted) - has no scrollbars,
  434.              1 - has a vertix scrollbar,
  435.              2 - has a horizon scrollbar,
  436.              4 - has both vertix and horizon scrollbars
  437.  
  438.      Width         - width of the scrollbars (if used), slider-button and scroll-buttons
  439.                (Up, Down, Left, Right) in pixels
  440.  
  441.  
  442.   Notes : Depending on parameter “Scrollable”  area can turn oneself into listbox
  443.       and text area.
  444.  
  445.  
  446.  
  447.  - Checkbox -
  448.  
  449.  Class type "tVCCheckbox".
  450.  
  451.  Data section :
  452.  
  453.   Example :
  454.  
  455.   Data {
  456.      Checked=1
  457.   }
  458.  
  459.  Parameters :
  460.  
  461.     Checked      - is box checked with a cross (0 - not checked; 1 - checked)
  462.  
  463.  Notes : None.
  464.  
  465.  
  466.  
  467.  - Slider -
  468.  
  469.  Class type "tVCSlider".
  470.  
  471.  Data section :
  472.  
  473.   Example :
  474.  
  475.   Data {
  476.      Type=1
  477.   }
  478.  
  479.   Parameters :
  480.  
  481.     Type      - type of the slider
  482.         1 - thin line with centered button
  483.         2 - thin line with triangle pointer on the left/over the line
  484.         3 - thin line with triangle pointer on the right/under the line
  485.         4 - thick bar with button (like a scrollbar)
  486.  
  487. Notes : This class splits into 2 derivative classes depending
  488.                on the metrics given, particularly :
  489.  
  490.      1) "Vertix slider"      - height exceeds width;
  491.      2) "Horizon slider"  - width exceeds height;
  492.           * Auto-adustible component.
  493.  
  494.  
  495.  - Popup Menu -
  496.  
  497.  Class type "tVCPopupMenu".
  498.  
  499.  Data section :
  500.  
  501.   Example :
  502.  
  503.   Data {
  504.        Font={"FONTS\courier.fnt", (0, 0, 0, 1)}
  505.        RGBColor=(20, 10, 50, 0)
  506.  
  507.        MenuSrc=example.rc
  508.        MenuName=Id_ExampleMenu
  509.   }
  510.  
  511.  
  512.   Parameters :
  513.  
  514.     Font                  - *see font-records explanation in other VC’s
  515.         RGBColor    - *see color definition in other VC’s
  516.     MenuSrc    - name of file/stream whare popup menu is to be loaded from
  517.     MenuName    - proper unique name of popup forwarded with keyword “Menu”
  518.                (case-insensitive)
  519.  
  520. Notes : Format of resource for popup menu is fully compatible with Microsoft Windows (R).
  521.     Open bracket is “{“ or keyword “Begin”; close bracket is “}” or keyword “End”.
  522.  
  523.  
  524.  
  525.  - Listbox -
  526.  
  527.  Class type "tVCListbox".
  528.  
  529.  Data section :
  530.  
  531.   Example :
  532.  
  533. Data {
  534.   Width=20
  535.   Source="example.txt"
  536.   DirInfo=0
  537.   StartupLoad=1
  538.   Font={"FONTS\varswisl.fnt", (0, 0, 0, 1)}
  539.  }
  540.  
  541.  
  542.  
  543.  
  544.   Parameters :
  545.  
  546.     Width              - width of the scrollbars (if used), slider-button and scroll-buttons
  547.                    (Up, Down, Left, Right) in pixels
  548.  
  549.  
  550.     Source         -  name of source (file/stream or directory) depending on
  551.             parameters DirInfo
  552.     DirInfo          -  0 - source is a file/stream;
  553.             1 - source is a directory, wherein the files according to predefined
  554.                   pattern (eg “*.PAS”) are located;
  555.             2 - source is a directory, wherein sub-directories according to predefined
  556.                   pattern (eg “DIR???”) are located.
  557.        
  558.     StartupLoad - type of loading a source (1 - source is immediately loaded
  559.                    after creating a component; 0 - source is defered for being loaded later)
  560.     Font              - *see font-records explanation in other VC’s
  561.  
  562. Notes : Listbox automatically fits a text (list) in box (using metrics and linear size of  a font)
  563.     and dynamically defines whether to use vertix and/or horizon scrollbars or not.
  564.     Manipulating with parameter DirInfo (values 1, 2) enables user to scan in directory
  565.     either sub-directories or ordinary archieve files and arrange them as a linear scrollable
  566.     list.
  567.     Could be used for simple viewers for plain text.
  568.  
  569.  
  570.  
  571.  - IconList -
  572.  
  573.  Class type "tVCIconList".
  574.  
  575.  Data section :
  576.  
  577.   Example :
  578.  
  579. Data {
  580.   Width=20
  581.   Source="example.txt"
  582.   DirInfo=0
  583.   StartupLoad=1
  584.  }
  585.  
  586.  
  587.  
  588.   Parameters :
  589.  
  590.     Width              - width of the scrollbars (if used), slider-button and scroll-buttons
  591.                     (Up, Down, Left, Right) in pixels
  592.     Source         -  name of source (file/stream name with full path)
  593.     DirInfo          - is not used (provisional)
  594.        
  595.     StartupLoad - type of loading a source (1 - source is immediately loaded
  596.                    after creating a component; 0 - source is defered for being loaded later)
  597.  
  598. Notes : IconList automatically fits a list of Icons in box (using metrics and linear size of standard
  599.     icon (32x32 pixel).
  600.     IconList dynamically defines whether to use vertix and/or horizon scrollbars or not.
  601.     Possible graphic formats for icon are : [*.ICO],  [*.BMP], [*.CUR].
  602.  
  603.  
  604.  
  605. - Picture -
  606.  
  607.  Class type "tVCPicture".
  608.  
  609.  Data section :
  610.  
  611.   Example :
  612.  
  613. Data {
  614.    Width=15
  615.    Source="c:\look\bmps\mirri3.bmp"
  616.    StartupLoad=1
  617.  }
  618.  
  619.  
  620.   Parameters :
  621.  
  622.     Width              - width of the scrollbars (if used), slider-button and scroll-buttons
  623.                     (Up, Down, Left, Right) in pixels
  624.     Source         -  name of source for picture (file/stream name with full path)
  625.  
  626.     StartupLoad - type of loading a picture (1 - picture is immediately loaded
  627.                    after creating a component; 0 - picture is defered for being loaded later)
  628.  
  629. Notes : Picture automatically fits in the box (using metrics and linear size of spreaded image
  630.     (Width x Height).
  631.     Picture dynamically defines whether to use vertix and/or horizon scrollbars or not.
  632.     Graphic format accepted by the component is Bitmap [*.BMP] ; color depth is ranged of 4-, 8-    and 24-bits /pixel.
  633.  
  634.  
  635.  
  636.  
  637.  
  638.  - HtmlText -
  639.  
  640.  Class type "tVCHtmlText".
  641.  
  642.  Data section :
  643.  
  644.  
  645.   Example :
  646.  
  647. Data {
  648.    Width=15
  649.    Source="c:\iexplore\eflib.htm"
  650.    DirInfo=0
  651.    StartupLoad=1
  652.    Font={"FONTS\marriage.fnt", (0, 0, 0, 1)}
  653.  }
  654.  
  655.  
  656.  
  657.  
  658.   Parameters :
  659.  
  660.     Width              - width of the scrollbars (if used), slider-button and scroll-buttons
  661.                    (Up, Down, Left, Right) in pixels
  662.  
  663.     Source         -  name of source (file/stream)
  664.  
  665.     DirInfo          -  0 - source is a file/stream;
  666.             1, 2 - not processed; see also tVCListBox
  667.  
  668.     StartupLoad - type of loading a source (1 - source is immediately loaded
  669.                    after creating a component; 0 - source is defered for being loaded later)
  670.  
  671.     Font              - *see font-records explanation in other VC’s
  672.  
  673.  
  674.  
  675. Notes : HtmlText automatically fits a text (list) in box (using metrics and linear size of  a font)
  676.     and dynamically defines whether to use vertix and/or horizon scrollbars or not.
  677.     Could be used for simple viewers for markuped text from HTML documents.
  678.     Acts as an interpretator for markuped text, arranging dinamically the colored tags.
  679.     HtmlText parses some additional hyper markups like list items (<UL>, <LI>) and rulers.

Paste is for source code and general debugging text.

Login or Register to edit, delete and keep track of your pastes and more.

Raw Paste

Login or Register to edit or fork this paste. It's free.