FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour New Class: TSelex
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 PM
New Class: TSelex
Posted: Sat Dec 04, 2010 01:59 AM
New Class in development to fivewin



Download Sample HERE
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 PM
Re: New Class: TSelex
Posted: Sat Dec 04, 2010 12:30 PM
made xcommand and added use from resources



DownloadSample HERE

PRG Sample

Code (fw): Select all Collapse
#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
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: New Class: TSelex
Posted: Sat Dec 04, 2010 01:02 PM
Daniel,

that looks very nice !!!

Just a Idea ( I don't know, if it is possible )





Best Regards
Uwe :-)
Since 1995 ( the first release of FW 1.9 )

i work with FW.

If you have any questions about special functions, maybe i can help.
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 PM
Re: New Class: TSelex
Posted: Sat Dec 04, 2010 03:29 PM
Uwe..

sure it's possible

second selector is dynamic



Download Sample HERE

Code (fw): Select all Collapse
#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
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 PM
Re: New Class: TSelex
Posted: Sat Dec 04, 2010 03:32 PM
We can do

local aItems := { "0", "10", "20", "30", "40", "50", "60", "70", "80", "90", "100" }

Code (fw): Select all Collapse
   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 )
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: New Class: TSelex
Posted: Sat Dec 04, 2010 04:43 PM
Daniel,
It will be a nice Solution, replacing Radios.
I still have 2 Questions.

1. Maybe also Vertical-direction like used with Sliders ?
2. Adding a Say ( Title ) to the Body ?



Best regards
Uwe :-)
Since 1995 ( the first release of FW 1.9 )

i work with FW.

If you have any questions about special functions, maybe i can help.
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 PM
Re: New Class: TSelex
Posted: Sat Dec 04, 2010 04:53 PM

Uwe

Vertical mode need more time to developer, maybe to next fivewin version (10.12)

For title i hope have time to this release

Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: New Class: TSelex
Posted: Sat Dec 04, 2010 05:12 PM
Daniel,

the vertical-display is just a Idea ( more time needed ).
I think for the Title-display, a top-position looks maybe better ?.



Best regards
Uwe :-)
Since 1995 ( the first release of FW 1.9 )

i work with FW.

If you have any questions about special functions, maybe i can help.
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 PM
Re: New Class: TSelex
Posted: Sat Dec 04, 2010 05:45 PM
ukoenig wrote:the vertical-display is just a Idea ( more time needed ).
I think for the Title-display, a top-position looks maybe better ?.


customizable :-)
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 PM
Re: New Class: TSelex
Posted: Sat Dec 04, 2010 09:02 PM
Uwe

now we can set title with custom position and color



Download Sample HERE

added to command TITLE cTitle [ TOP ] COLORTITLE nColor

Code (fw): Select all Collapse
#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
Posts: 6
Joined: Wed Nov 20, 2013 01:15 PM
Re: New Class: TSelex
Posted: Wed Nov 27, 2013 03:51 PM

Daniel donde puedo descargar el archivo tselec.ch?
Gracias de antemano

Posts: 2365
Joined: Wed Nov 02, 2005 11:46 PM
Re: New Class: TSelex
Posted: Wed Nov 27, 2013 04:47 PM

Hola

viene con la version de fivewin, es una clase que tiene ya tres años en FWH

Continue the discussion