New Class: TSelex
Posted: Sat Dec 04, 2010 1:59 am
www.FiveTechSoft.com
https://fivetechsoft.com/forums/
Code: Select all
#include "fivewin.ch"
#include "tselex.ch"
function Main()
local oWnd
local oSelex
local nOption1 := 1
local nOption2 := 3
local nOption3 := 2
define window oWnd
@ 10, 10 SELEX oSelex VAR nOption1 SIZE 350, 50 PIXEL;
ON CHANGE MsgInfo( "Current: " + StrTran( oSelex:aOptions[ nOption ], "&", "" ) + CRLF + ;
"Last : " + StrTran( oSelex:aOptions[ nOldOption ], "&", "" ))
@ 70, 10 SELEX nOption2 SIZE 250, 50 PIXEL;
ITEMS "Launch &Dialog", "Option &2", "Option &3";
GRADIENT OUTTRACK { { 1/2, nRGB( 219, 230, 244 ), nRGB( 207-50, 221-25, 255 ) }, ;
{ 1/2, nRGB( 201-50, 217-25, 255 ), nRGB( 231, 242, 255 ) } };
GRADIENT INTRACK { { 1/3, nRGB( 255, 253, 222 ), nRGB( 255, 231, 151 ) }, ;
{ 2/3, nRGB( 255, 215, 84 ), nRGB( 255, 233, 162 ) } };
LINECOLORS nRGB( 237, 242, 248 ), nRGB( 141, 178, 227 );
COLORTEXT CLR_BLACK, CLR_RED ;
THUMBSIZE 40 ROUNDSIZE 20;
ACTION( If( nOption == 1, LaunchDialog(), ) )
@ 130, 10 SELEX nOption3 SIZE 450, 50 PIXEL;
ITEMS "&FiveWin", "&Power", "&Amazing", "&IPhone";
THUMBSIZE 40, 30 ROUNDSIZE 0
activate window oWnd
return nil
function LaunchDialog()
local oDlg, nOption3 := 1
define dialog oDlg resource "selex"
REDEFINE SELEX nOption3 OF oDlg ID 100;
ITEMS "&FiveWin", "&Power", "&Amazing", "&Exit";
THUMBSIZE 40, 30 ROUNDSIZE 5 ;
ACTION( If( nOption == 4, oDlg:End(), ) );
COLOR THUMB CLR_WHITE
activate dialog oDlg
return nil
Code: Select all
#include "fivewin.ch"
#include "tselex.ch"
function Main()
local oWnd
local oSelex, oFont
local nOption1 := 1
local nOption2 := 1
local nOption3 := 6
define window oWnd
define font oFont Name "Arial Black" size 8, 14
@ 20, 10 SELEX nOption1 OF oWnd PIXEL SIZE 500, 50;
GRADIENT INTRACK { { 1, nRGB( 0, 255, 0 ), nRGB( 255, 0, 0 ) } };
ITEMS "0", "10", "20", "30", "40", "50", "60", "70", "80", "90", "100";
THUMBSIZE 30, 30 ROUNDSIZE 5 ;
COLOR THUMB CLR_WHITE FONT oFont
@ 100, 10 SELEX oSelex VAR nOption2 OF oWnd PIXEL SIZE 500, 50;
GRADIENT INTRACK { { 1, nRGB( 0, 255, 0 ), nRGB( 0, 255, 0 ) } };
ITEMS "0", "10", "20", "30", "40", "50", "60", "70", "80", "90", "100";
THUMBSIZE 30, 30 ROUNDSIZE 5 ;
FONT oFont;
ACTION ChangeColor( oSelex )
@ 180, 10 SELEX nOption3 OF oWnd PIXEL SIZE 500, 50;
GRADIENT INTRACK { { 1/2, nRGB( 0, 0, 255 ), nRGB( 0, 255, 0 ) }, ;
{ 1/2, nRGB( 0, 255, 0 ), nRGB( 255, 0, 0 ) } };
ITEMS "-50", "-40", "-30", "-20", "-10", "0", "10", "20", "30", "40", "50";
THUMBSIZE 30, 30 ROUNDSIZE 5 ;
FONT oFont
activate window oWnd
oFont:End()
return nil
FUNCTION ChangeColor( oSelex )
local nStep := 255 / Len( oSelex:aOptions )
local nColor := nStep * oSelex:nOption
oSelex:aGradIn = { { 1, nRGB( 0, 255, 0 ), nRGB( nColor, 255 - nColor, 0 ) } }
return nil
Code: Select all
local aItems := { "0", "10", "20", "30", "40", "50", "60", "70", "80", "90", "100" }
...
@ 100, 10 SELEX oSelex VAR nOption2 OF oWnd PIXEL SIZE 500, 50;
GRADIENT INTRACK { { 1, nRGB( 0, 255, 0 ), nRGB( 0, 255, 0 ) } };
ITEMS aItems;
THUMBSIZE 30, 30 ROUNDSIZE 5 ;
FONT oFont;
ACTION ChangeColor( oSelex )
customizableukoenig wrote:the vertical-display is just a Idea ( more time needed ).
I think for the Title-display, a top-position looks maybe better ?.
Code: Select all
#include "fivewin.ch"
#include "tselex.ch"
function Main()
local oWnd
local oSelex, oFont
local nOption1 := 1
local nOption2 := 1
local nOption3 := 6
local aItems := { "-50", "-40", "-30", "-20", "-10", "0", "10", "20", "30", "40", "50"}
define window oWnd
define font oFont Name "Arial Black" size 8, 16
@ 10, 10 SELEX oSelex VAR nOption2 OF oWnd PIXEL SIZE 500, 65;
GRADIENT INTRACK { { 1, nRGB( 0, 255, 0 ), nRGB( 0, 255, 0 ) } };
ITEMS aItems;
THUMBSIZE 30, 30 ROUNDSIZE 5 ;
FONT oFont;
ACTION ChangeColor( oSelex );
TITLE "- Values <> + Values"
@ 120, 10 SELEX nOption3 OF oWnd PIXEL SIZE 500, 65;
GRADIENT INTRACK { { 1/2, nRGB( 0, 0, 255 ), nRGB( 0, 255, 0 ) }, ;
{ 1/2, nRGB( 0, 255, 0 ), nRGB( 255, 0, 0 ) } };
ITEMS aItems;
THUMBSIZE 30, 30 ROUNDSIZE 5 ;
FONT oFont;
TITLE "- Values <> + Values" TOP;
COLORTITLE CLR_HCYAN
activate window oWnd
oFont:End()
return nil
FUNCTION ChangeColor( oSelex )
local nStep := 255 / Len( oSelex:aOptions )
local nColor := nStep * oSelex:nOption
oSelex:aGradIn = { { 1, nRGB( 0, 255, 0 ), nRGB( nColor, 255 - nColor, 0 ) } }
return nil