Slider
Previous topic  First topic  Next topic





Define and Properties


Properties
Status
Default
Planned
Started
Ready
Comments
CREATE SLIDER cName | (cVarName) | &(cExpression) 
      [ ; OF cWindow | (cVarName) | &(cExpression) ]
Parent.Name
  
A reference to the Parent Window
      [ ROW nRow ]
0
  
Row position on container window in pixels coordinates
      [ COL nCol ]
0
  
Col position on container window in pixels coordinates
      [ WIDTH nWidth ]
?
  
The desired width size of the Control in pixels
      [ HEIGHT nHeight ]
?
  
The desired height size of the Control in pixels
      [ ROWBOTTOM nRow ]
n/a
  
Bottom Row position on container window in pixels coordinates. This property adjust the HEIGHT property according the ROW property.
      [ COLRIGHT nCol ]
n/a
  
Right Col position on container window in pixels coordinates. This property adjust the WIDTH property according the COL property.
      [ ENABLED .T. | .F. ]
.T.
  
Enable or Disable control
      [ RANGEMIN nValue ]
0
  
Minimum chunk value
      [ RANGEMAX nValue ]
?
  
Maximum chunk value
      [ VALUE nValue ]
0
  
Control initial position
      [ BACKCOLOR {aBackColor} | aVarBackColor ]
OS.BackColor
  
Set background color
      [ FONTCOLOR {aFontColor} | aVarFontColor ]
OS.FontColor
  
Set foreground color (text color)
      [ FONTNAME "cFontName" ]
Parent.Fontname
  
Font family for control text
      [ FONTSIZE nPoints ]
Parent.FontSize
  
Font size for control text
      [ FONTBOLD .T. | .F. ]
.F.
  
Set Bold attribute to control text
      [ FONTITALIC .T. | .F. ]
.F.
  
Set Italic attribute to control text
      [ FONTUNDERLINE .T. | .F. ]
.F.
  
Set Underline attribute to control text
      [ FONTSTRIKEOUT .T. | .F. ]
.F.
  
Set Strikeout attribute to control text
      [ BOTH .T. | .F. ]
.F.
  
Draw tick marks on both sides of the groove.
      [ TOP .T. | .F. ]
.F.
  
Draw tick marks above the (horizontal) slider or to the left of the (vertical) slider
      [ NOTICKS .T. | .F. ]
.F.
  
Do not draw any tick marks.
      [ TICKSINTERVAL nInterval ]
0
  
This property holds the interval between tickmarks.
      [ TOOLTIP cToolTip ]
NIL
  
Text for display into tooltip
      [ VERTICAL .T. | .F. ]
.F.
  
Display control in Vertical mode (not horizontaly)
      [ NOTABSTOP .T. | .F. ]
.F.
  
This property force that TAB key doesn't stop in this control
      [ VISIBLE .T. | .F. ]
.T.
  
Show or hide control (like methods SHOW and HIDE)
      [ PERMANENT .T. | .F. ]
.F.
  
Only for controls defined into STATUSBAR. This property force this control as permanent statusbar message. Control will be placed at right corner of statusbar and it is never hidden. Used for important mode indications, for example, some applications put a Caps Lock indicator in the status bar.
      [ PARENT cParentName ]
NIL
  
Parent window for this widget
      [ PARENTTYPE n/a ]   
Only for mg_get() function, this property returns the PARENT control type or "" if the parent was not set.
      [ HASFOCUS ]   
Only for mg_Get() function. This property returns .T. if control has the application focus
      [ CURSOR ]
Qt_ArrowCursor
  
Change the cursor pointer shape for the control. Go to to learn more about it.
      [ ONCHANGE cOnChange | {BOnChange} ]
NIL
  
An action to be performed while slider is moved
      [ ONGOTFOCUS cOnGotFocus | {BOnGotFocus} ]
NIL
  
An action to be performed when control is focused
      [ ONLOSTFOCUS cOnLostFocus | {BOnLostFocus} ]
NIL
  
An action to be performed when control is lost focused
      [ CONTEXTMENUSUPRESSED .T. | .F. ]
.F.
  
Disable the display of the Context Menu of control.
      [ CREATE CONTEXT MENU [ cName ] ]   
CONTEXT MENU for control
            [ ......... ]   
You can see properties for this menu in CONTEXT MENU topic
      [ END MENU ]   
 
END SLIDER 

Jump to Context Menu topic



Methods


Methods
Status
Default
Planned
Started
Ready
Comments
    HIDE
n/a
  
This method HIDE the control
    SHOW
n/a
  
This method SHOW the control
    UNSETCURSOR
n/a
  
Reset the cursor pointer shape for the control to default (Qt_ArrowCursor). Go to to learn more about it.
    RELEASE
n/a
  
This method is used to destroy the control.
    SETFOCUS
n/a
  
This method put the program focus into control
    ONCHANGE
n/a
  
Execute ONCHANGE block coded in CREATE or seted by mg_Set
    ONGOTFOCUS
n/a
  
Execute ONGOTFOCUS block coded in CREATE or seted by mg_Set
    ONLOSTFOCUS
n/a
  
Execute ONLOSTFOCUS block coded in CREATE or seted by mg_Set



Example:

File: d_slider.prg


#include "marinas-gui.ch"

Function main()

   SET APPLSTYLE TO "MarinasLooks"

   CREATE WINDOW d_window
      ROW 0 ; COL 0
      WIDTH 820 ; HEIGHT 480
      CAPTION "Marinas-GUI Sample for Slider Control"
      ICON "../resource/d_test.ico"
      BACKCOLOR {216,237,236}
      MAIN .T.

      d_slider_def()

   END WINDOW

   mg_Do( "d_window" , "center" )

   mg_Do( "d_window" , "activate" )

Return .T.


File: d_slider_def.prg

#include "marinas-gui.ch"

Function d_slider_def()

     CREATE IMAGE Slider_1Image
        ROW       30
        COL       134
        WIDTH     32
        HEIGHT    32
        PICTURE   "../resource/d_null.png"
        TOOLTIP   "Slider Focus"
     END IMAGE

     CREATE SLIDER Slider_1
            ROW    70
            COL    130
            WIDTH  40
            HEIGHT 300
            RANGEMIN 0
            RANGEMAX 100
            VALUE 20
            VERTICAL .T.
            BACKCOLOR {254,216,211}
            TOOLTIP "Slider with BACKCOLOR"
            ONCHANGE mg_Set( "d_window" , "SL_Button_1" , "caption" , alltrim( str( mg_Get( "d_window" , "Slider_1" , "value" ) ) ) )
            ONGOTFOCUS mg_Set( "d_window" , "Slider_1Image" , "picture" , "../resource/d_focus_on.png" )
            ONLOSTFOCUS mg_Set( "d_window" , "Slider_1Image" , "picture" , "../resource/d_null.png" )

            CREATE CONTEXT MENU

               CREATE ITEM "Item 1 from Slider"
                  ONCLICK { || mg_MsgInfo( "Item 1 from Slider" ) }
                  PICTURE "../resource/d_test.png"
               END ITEM

               CREATE ITEM "Item 2 from Slider"
                  ONCLICK { || mg_MsgInfo( "Item 2 from Slider" ) }
                  PICTURE "../resource/d_test.png"
               END ITEM

            END MENU

     END SLIDER

    CREATE BUTTON SL_Button_1
           ROW    380
           COL    130
           WIDTH  30
           HEIGHT 30
           CAPTION alltrim( str( mg_Get( "d_window" , "Slider_1" , "value" ) ) )
     END BUTTON

     CREATE IMAGE Slider_2Image
        ROW       34
        COL       550
        WIDTH     32
        HEIGHT    32
        PICTURE   "../resource/d_null.png"
        TOOLTIP   "Slider Focus"
     END IMAGE

     CREATE SLIDER Slider_2
            ROW    30
            COL    280
            WIDTH  265
            HEIGHT 40
            RANGEMIN 0
            RANGEMAX 100
            VALUE 80
            BOTH .T.
            BACKCOLOR {204,199,254}
            TOOLTIP "Slider with BOTH property"
            ONCHANGE mg_Set( "d_window" , "SL_Button_2" , "caption" , alltrim( str( mg_Get( "d_window" , "Slider_2" , "value" ) ) ) )
            ONGOTFOCUS mg_Set( "d_window" , "Slider_2Image" , "picture" , "../resource/d_focus_on.png" )
            ONLOSTFOCUS mg_Set( "d_window" , "Slider_2Image" , "picture" , "../resource/d_null.png" )
     END SLIDER

    CREATE BUTTON SL_Button_2
           ROW    30
           COL    230
           WIDTH  30
           HEIGHT 30
           CAPTION alltrim( str( mg_Get( "d_window" , "Slider_2" , "value" ) ) )
     END BUTTON

     CREATE IMAGE Slider_3Image
        ROW       30
        COL       654
        WIDTH     32
        HEIGHT    32
        PICTURE   "../resource/d_null.png"
        TOOLTIP   "Slider Focus"
     END IMAGE

     CREATE SLIDER Slider_3
            ROW    70
            COL    650
            WIDTH  40
            HEIGHT 300
            RANGEMIN 0
            RANGEMAX 100
            VALUE 60
            NOTICKS .T.
            VERTICAL .T.
            BACKCOLOR {252,254,180}
            TOOLTIP "Slider without TICKS"
            ONCHANGE mg_Set( "d_window" , "SL_Button_3" , "caption" , alltrim( str( mg_Get( "d_window" , "Slider_3" , "value" ) ) ) )
            ONGOTFOCUS mg_Set( "d_window" , "Slider_3Image" , "picture" , "../resource/d_focus_on.png" )
            ONLOSTFOCUS mg_Set( "d_window" , "Slider_3Image" , "picture" , "../resource/d_null.png" )
     END SLIDER

    CREATE BUTTON SL_Button_3
           ROW    380
           COL    650
           WIDTH  30
           HEIGHT 30
           CAPTION alltrim( str( mg_Get( "d_window" , "Slider_3" , "value" ) ) )
     END BUTTON

     CREATE IMAGE Slider_4Image
        ROW       120
        COL       410
        WIDTH     32
        HEIGHT    32
        PICTURE   "../resource/d_null.png"
        TOOLTIP   "Slider Focus"
     END IMAGE

     CREATE SLIDER Slider_4
            ROW    120
            COL    230
            WIDTH  120
            HEIGHT 40
            RANGEMIN 0
            TOOLTIP "Standard Slider"
            RANGEMAX 100
            VALUE 30
            ONCHANGE mg_Set( "d_window" , "SL_Button_4" , "caption" , alltrim( str( mg_Get( "d_window" , "Slider_4" , "value" ) ) ) )
            ONGOTFOCUS mg_Set( "d_window" , "Slider_4Image" , "picture" , "../resource/d_focus_on.png" )
            ONLOSTFOCUS mg_Set( "d_window" , "Slider_4Image" , "picture" , "../resource/d_null.png" )
     END SLIDER

    CREATE BUTTON SL_Button_4
           ROW    120
           COL    370
           WIDTH  30
           HEIGHT 30
           CAPTION alltrim( str( mg_Get( "d_window" , "Slider_4" , "value" ) ) )
     END BUTTON

     CREATE IMAGE Slider_5Image
        ROW       220
        COL       380
        WIDTH     32
        HEIGHT    32
        PICTURE   "../resource/d_null.png"
        TOOLTIP   "Slider Focus"
     END IMAGE

     CREATE SLIDER Slider_5
            ROW    220
            COL    470
            WIDTH  120
            HEIGHT 40
            RANGEMIN 0
            VALUE 20
            TOP .T.
            BACKCOLOR {0,255,0}
            RANGEMAX 100
            TOOLTIP "Slider with Backcolor and TICKS at TOP"
            ONCHANGE mg_Set( "d_window" , "SL_Button_5" , "caption" , alltrim( str( mg_Get( "d_window" , "Slider_5" , "value" ) ) ) )
            ONGOTFOCUS mg_Set( "d_window" , "Slider_5Image" , "picture" , "../resource/d_focus_on.png" )
            ONLOSTFOCUS mg_Set( "d_window" , "Slider_5Image" , "picture" , "../resource/d_null.png" )
     END SLIDER

    CREATE BUTTON SL_Button_5
           ROW    220
           COL    420
           WIDTH  30
           HEIGHT 30
           CAPTION alltrim( str( mg_Get( "d_window" , "Slider_5" , "value" ) ) )
     END BUTTON

     CREATE IMAGE Slider_6Image
        ROW       300
        COL       230
        WIDTH     32
        HEIGHT    32
        PICTURE   "../resource/d_null.png"
        TOOLTIP   "Slider Focus"
     END IMAGE

     CREATE SLIDER Slider_6
            ROW    300
            COL    270
            TOOLTIP "Slider with BACKCOLOR"
            WIDTH  250
            VALUE 0
            HEIGHT 40
            RANGEMIN 1
            RANGEMAX 5
            BOTH .T.
            TICKSINTERVAL 1
            BACKCOLOR {208,253,198}
            ONCHANGE mg_Set( "d_window" , "SL_Button_6" , "caption" , alltrim( str( mg_Get( "d_window" , "Slider_6" , "value" ) ) ) )
            ONGOTFOCUS mg_Set( "d_window" , "Slider_6Image" , "picture" , "../resource/d_focus_on.png" )
            ONLOSTFOCUS mg_Set( "d_window" , "Slider_6Image" , "picture" , "../resource/d_null.png" )
     END SLIDER

    CREATE BUTTON SL_Button_6
           ROW    300
           COL    540
           WIDTH  30
           HEIGHT 30
           CAPTION alltrim( str( mg_Get( "d_window" , "Slider_6" , "value" ) ) )
     END BUTTON

Return .T.



Marinas-GUI Version 03.06 and
Marinas-IDE Version 05.06 and
LEX Files Version 02.06


---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
last update: April 27
2017
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------




A Harbour/QT framework to make multiplatform programs

(©) Copyright 2009-2017 by Fernando Santolin (aka CarozoDeQuilmes)
CarozoDeQuilmes@gmail.com

2009-2017 Beta tester and full English translator: Bruno Luciani
Bruno.Luciani@gmail.com

2014-2015 Final English corrector: David Worboys
DavidWorboys@hotmail.com

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

www.marinas-gui.org


www.marinas-gui.org  

Previous topic  First topic  Next topic