Spinner
Previous topic  First topic  Next topic





Define and Properties


Properties
Status
Default
Planned
Started
Ready
Comments
CREATE SPINNER 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.
      [ AUTOSIZE .T. | .F. ]
.F.
  
Auto adjust control size to text
      [ ALIGN nAlign ]
Qt_AlignLeft
  
Align text, most common value are Qt_AlignLeft , Qt_AlignCenter and Qt_AlignRight
      [ 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
      [ INCREMENT nIncrement ]
1
  
This property holds the step value. When the user uses the arrows the value will be incremented or decremented by this amount.
      [ TOOLTIP cToolTip ]
NIL
  
Text for display into tooltip
      [ 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.
      [ 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.
      [ FORCEACTION .T. | .F. ]
.F.
  
It force the execution of the actions defined by methods like ACTION, ONENTER, ONCLICK, ONDBLCLICK, etc. when NOTABSTOP property was set '.T.'. This property is useful when application focus is over a control when a VALID clause and it doesn't permit lostfocus.
      [ 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.
      [ ONCHANGE cOnChange | {BOnChange} ]
NIL
  
An action to be performed while slider is moved
      [ ONENTER cOnEnter | {BOnEnter} ]
NIL
 
 An action to be performed when user press ENTER or RETURN keys. You can interrupt the ENTER key propagate to the control returning the __MG_KEY_NO_PROPAGATE constant, e.g. to disable ENTERTAB behavior.
      [ 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 SPINNER 

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
    ONENTER
n/a
 
 Execute ONENTER 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_spinner.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 Spinner Control"
      ICON "../resource/d_test.ico"
      BACKCOLOR {216,237,236}
      MAIN .T.

      d_spinner_def()

   END WINDOW

   mg_Do( "d_window" , "center" )

   mg_Do( "d_window" , "activate" )

Return .T.


File: d_spinner_def.prg

#include "marinas-gui.ch"

Function d_spinner_def()

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

     CREATE SPINNER Spinner_1
            ROW    70
            COL    130
            WIDTH  40
            HEIGHT 300
            RANGEMIN 0
            RANGEMAX 100
            VALUE 20
            FONTCOLOR {255,0,0}
            BACKCOLOR {254,216,211}
            TOOLTIP "Spinner with BACKCOLOR and FONTCOLOR"
            ONCHANGE mg_Set( "d_window" , "SP_Button_1" , "caption" , alltrim( str( mg_Get( "d_window" , "Spinner_1" , "value" ) ) ) )
            ONGOTFOCUS mg_Set( "d_window" , "Spinner_1Image" , "picture" , "../resource/d_focus_on.png" )
            ONLOSTFOCUS mg_Set( "d_window" , "Spinner_1Image" , "picture" , "../resource/d_null.png" )

            CREATE CONTEXT MENU

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

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

            END MENU

     END SPINNER

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

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

     CREATE SPINNER Spinner_2
            ROW    30
            COL    280
            WIDTH  265
            HEIGHT 40
            RANGEMIN 0
            RANGEMAX 1000
            VALUE 80
            INCREMENT 50
            BACKCOLOR {204,199,254}
            FONTCOLOR {0,200,0}
            FONTSIZE 20
            FONTUNDERLINE .T.
            TOOLTIP "Spinner with INCREMENT 50, and FONTUNDERLINE"
            ONCHANGE mg_Set( "d_window" , "SP_Button_2" , "caption" , alltrim( str( mg_Get( "d_window" , "Spinner_2" , "value" ) ) ) )
            ONGOTFOCUS mg_Set( "d_window" , "Spinner_2Image" , "picture" , "../resource/d_focus_on.png" )
            ONLOSTFOCUS mg_Set( "d_window" , "Spinner_2Image" , "picture" , "../resource/d_null.png" )
     END SPINNER

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

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

     CREATE SPINNER Spinner_3
            ROW    70
            COL    650
            WIDTH  40
            HEIGHT 300
            RANGEMIN 0
            RANGEMAX 100
            VALUE 60
            BACKCOLOR {252,254,180}
            TOOLTIP "Spinner"
            ONCHANGE mg_Set( "d_window" , "SP_Button_3" , "caption" , alltrim( str( mg_Get( "d_window" , "Spinner_3" , "value" ) ) ) )
            ONGOTFOCUS mg_Set( "d_window" , "Spinner_3Image" , "picture" , "../resource/d_focus_on.png" )
            ONLOSTFOCUS mg_Set( "d_window" , "Spinner_3Image" , "picture" , "../resource/d_null.png" )
     END SPINNER

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

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

     CREATE SPINNER Spinner_4
            ROW    120
            COL    230
            WIDTH  120
            HEIGHT 40
            RANGEMIN 0
            TOOLTIP "Standard Spinner"
            RANGEMAX 100
            VALUE 30
            ONCHANGE mg_Set( "d_window" , "SP_Button_4" , "caption" , alltrim( str( mg_Get( "d_window" , "Spinner_4" , "value" ) ) ) )
            ONGOTFOCUS mg_Set( "d_window" , "Spinner_4Image" , "picture" , "../resource/d_focus_on.png" )
            ONLOSTFOCUS mg_Set( "d_window" , "Spinner_4Image" , "picture" , "../resource/d_null.png" )
     END SPINNER

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

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

     CREATE SPINNER Spinner_5
            ROW    220
            COL    470
            WIDTH  120
            HEIGHT 40
            RANGEMIN 0
            VALUE 20
            BACKCOLOR {0,255,0}
            ALIGN Qt_AlignCenter
            FONTITALIC .T.
            FONTSIZE 12
            RANGEMAX 100
            TOOLTIP "Spinner with BACKCOLOR, ALIGN center and FONTITALIC"
            ONCHANGE mg_Set( "d_window" , "SP_Button_5" , "caption" , alltrim( str( mg_Get( "d_window" , "Spinner_5" , "value" ) ) ) )
            ONGOTFOCUS mg_Set( "d_window" , "Spinner_5Image" , "picture" , "../resource/d_focus_on.png" )
            ONLOSTFOCUS mg_Set( "d_window" , "Spinner_5Image" , "picture" , "../resource/d_null.png" )
     END SPINNER

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

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

     CREATE SPINNER Spinner_6
            ROW    300
            COL    270
            TOOLTIP "Spinner with BACKCOLOR and ALIGN right"
            WIDTH  250
            VALUE 0
            HEIGHT 40
            RANGEMIN 0
            RANGEMAX 100
            FONTNAME "mg_monospace"
            ALIGN Qt_AlignRight
            FONTSIZE 15
            BACKCOLOR {208,253,198}
            ONCHANGE mg_Set( "d_window" , "SP_Button_6" , "caption" , alltrim( str( mg_Get( "d_window" , "Spinner_6" , "value" ) ) ) )
            ONGOTFOCUS mg_Set( "d_window" , "Spinner_6Image" , "picture" , "../resource/d_focus_on.png" )
            ONLOSTFOCUS mg_Set( "d_window" , "Spinner_6Image" , "picture" , "../resource/d_null.png" )
     END SPINNER

    CREATE BUTTON SP_Button_6
           ROW    300
           COL    540
           WIDTH  30
           HEIGHT 30
           CAPTION alltrim( str( mg_Get( "d_window" , "Spinner_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: March 09
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

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


Jump to Donation Topic


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

www.marinas-gui.org


www.marinas-gui.org  

Previous topic  First topic  Next topic