New Class: TSelex

Post Reply
User avatar
Daniel Garcia-Gil
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 pm
Location: Isla de Margarita
Contact:

New Class: TSelex

Post by Daniel Garcia-Gil »

New Class in development to fivewin

Image

Download Sample HERE
our best documentation is the source code
Isla de Margarita Venezuela.
danielgarciagil@gmail.com
http://tdolphin.blogspot.com/
https://www.dropbox.com/referrals/NTI5N ... rc=global9
User avatar
Daniel Garcia-Gil
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 pm
Location: Isla de Margarita
Contact:

Re: New Class: TSelex

Post by Daniel Garcia-Gil »

made xcommand and added use from resources

Image

DownloadSample HERE

PRG Sample

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   
      
 
our best documentation is the source code
Isla de Margarita Venezuela.
danielgarciagil@gmail.com
http://tdolphin.blogspot.com/
https://www.dropbox.com/referrals/NTI5N ... rc=global9
User avatar
ukoenig
Posts: 3981
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany
Contact:

Re: New Class: TSelex

Post by ukoenig »

Daniel,

that looks very nice !!!

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

Image

Image

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.
User avatar
Daniel Garcia-Gil
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 pm
Location: Isla de Margarita
Contact:

Re: New Class: TSelex

Post by Daniel Garcia-Gil »

Uwe..

sure it's possible

second selector is dynamic

Image

Download Sample HERE

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
our best documentation is the source code
Isla de Margarita Venezuela.
danielgarciagil@gmail.com
http://tdolphin.blogspot.com/
https://www.dropbox.com/referrals/NTI5N ... rc=global9
User avatar
Daniel Garcia-Gil
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 pm
Location: Isla de Margarita
Contact:

Re: New Class: TSelex

Post by Daniel Garcia-Gil »

We can do

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

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 )  

 
our best documentation is the source code
Isla de Margarita Venezuela.
danielgarciagil@gmail.com
http://tdolphin.blogspot.com/
https://www.dropbox.com/referrals/NTI5N ... rc=global9
User avatar
ukoenig
Posts: 3981
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany
Contact:

Re: New Class: TSelex

Post by ukoenig »

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 ?

Image

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.
User avatar
Daniel Garcia-Gil
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 pm
Location: Isla de Margarita
Contact:

Re: New Class: TSelex

Post by Daniel Garcia-Gil »

Uwe

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

For title i hope have time to this release
our best documentation is the source code
Isla de Margarita Venezuela.
danielgarciagil@gmail.com
http://tdolphin.blogspot.com/
https://www.dropbox.com/referrals/NTI5N ... rc=global9
User avatar
ukoenig
Posts: 3981
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany
Contact:

Re: New Class: TSelex

Post by ukoenig »

Daniel,

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

Image

Best regards
Uwe :lol:
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.
User avatar
Daniel Garcia-Gil
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 pm
Location: Isla de Margarita
Contact:

Re: New Class: TSelex

Post by Daniel Garcia-Gil »

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 :)
our best documentation is the source code
Isla de Margarita Venezuela.
danielgarciagil@gmail.com
http://tdolphin.blogspot.com/
https://www.dropbox.com/referrals/NTI5N ... rc=global9
User avatar
Daniel Garcia-Gil
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 pm
Location: Isla de Margarita
Contact:

Re: New Class: TSelex

Post by Daniel Garcia-Gil »

Uwe

now we can set title with custom position and color

Image

Download Sample HERE

added to command TITLE cTitle [ TOP ] COLORTITLE nColor

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
 
our best documentation is the source code
Isla de Margarita Venezuela.
danielgarciagil@gmail.com
http://tdolphin.blogspot.com/
https://www.dropbox.com/referrals/NTI5N ... rc=global9
mlaffont
Posts: 6
Joined: Wed Nov 20, 2013 1:15 pm

Re: New Class: TSelex

Post by mlaffont »

Daniel donde puedo descargar el archivo tselec.ch?
Gracias de antemano
User avatar
Daniel Garcia-Gil
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 pm
Location: Isla de Margarita
Contact:

Re: New Class: TSelex

Post by Daniel Garcia-Gil »

Hola

viene con la version de fivewin, es una clase que tiene ya tres años en FWH
our best documentation is the source code
Isla de Margarita Venezuela.
danielgarciagil@gmail.com
http://tdolphin.blogspot.com/
https://www.dropbox.com/referrals/NTI5N ... rc=global9
Post Reply