COMBOBOX Y CHECKBOX

Post Reply
jbrita
Posts: 507
Joined: Mon Jan 16, 2006 3:42 pm

COMBOBOX Y CHECKBOX

Post by jbrita »

Hola Amigos.. como se podria hacer esto:
Image

con xbrowse se podria... pero otra forma

saludos
User avatar
JoseAlvarez
Posts: 810
Joined: Sun Nov 09, 2014 5:01 pm

Re: COMBOBOX Y CHECKBOX

Post by JoseAlvarez »

Interesante...

Me sumo a la inquietud +1
"Los errores en programación, siempre están entre la silla y el teclado..."

Fwh 19.06 32 bits + Harbour 3.2 + Borland 7.4 + MariaDB + TDolphin

Carora, Estado Lara, Venezuela.
User avatar
Antonio Linares
Site Admin
Posts: 42529
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 31 times
Been thanked: 77 times
Contact:

Re: COMBOBOX Y CHECKBOX

Post by Antonio Linares »

Esta es una posible forma, aunque sin usar un combobox:

Image

Vamos a ir mejorándolo :-)

Code: Select all | Expand

#include "fivewin.ch"
#include "constant.ch"

static oDlg, oPanel

function Main()

  local oBtn

  DEFINE DIALOG oDlg TITLE "Marca" ;
   SIZE 200, 250 PIXEL

  @ 100, 5 BTNBMP oBtn PROMPT "Aplicar" SIZE 90, 15 FLAT

   ACTIVATE DIALOG oDlg CENTERED ;
     ON INIT ( oBtn:SetColor( "W+/BG+" ), CreatePanel(), CreateCheckBoxes(), oPanel:SetRange() )

return nil

//--------------------------------------------------------------------------------------//

function CreatePanel()

  oPanel = TScrollPanel():New( 50, 11, oDlg:nBottom - 60, oDlg:nWidth - 20, oDlg )
  oPanel:WinStyle( WS_BORDER, .F. )

return nil

//--------------------------------------------------------------------------------------//

function CreateCheckBoxes()

  local aValues := Array( 12 ), nTop := 0

  AFill( aValues, .F. )

  @ nTop,        0.5 CHECKBOX aValues[ 1 ] SIZE oPanel:nRight, 20 OF oPanel  // SCROLL ADJUST
  @ nTop += 1.7, 0.5 CHECKBOX aValues[ 2 ] SIZE oPanel:nRight, 20 OF oPanel  // SCROLL ADJUST
  @ nTop += 1.7, 0.5 CHECKBOX aValues[ 3 ] SIZE oPanel:nRight, 20 OF oPanel  // SCROLL ADJUST
  @ nTop += 1.7, 0.5 CHECKBOX aValues[ 4 ] SIZE oPanel:nRight, 20 OF oPanel  // SCROLL ADJUST
  @ nTop += 1.7, 0.5 CHECKBOX aValues[ 5 ] SIZE oPanel:nRight, 20 OF oPanel  // SCROLL ADJUST
  @ nTop += 1.7, 0.5 CHECKBOX aValues[ 6 ] SIZE oPanel:nRight, 20 OF oPanel  // SCROLL ADJUST
  @ nTop += 1.7, 0.5 CHECKBOX aValues[ 7 ] SIZE oPanel:nRight, 20 OF oPanel  // SCROLL ADJUST
  @ nTop += 1.7, 0.5 CHECKBOX aValues[ 8 ] SIZE oPanel:nRight, 20 OF oPanel  // SCROLL ADJUST
  @ nTop += 1.7, 0.5 CHECKBOX aValues[ 9 ] SIZE oPanel:nRight, 20 OF oPanel  // SCROLL ADJUST
  @ nTop += 1.7, 0.5 CHECKBOX aValues[ 10 ] SIZE oPanel:nRight, 20 OF oPanel  // SCROLL ADJUST
  @ nTop += 1.7, 0.5 CHECKBOX aValues[ 11 ] SIZE oPanel:nRight, 20 OF oPanel  // SCROLL ADJUST
  @ nTop += 1.7, 0.5 CHECKBOX aValues[ 12 ] SIZE oPanel:nRight, 20 OF oPanel  // SCROLL ADJUST

return nil

//--------------------------------------------------------------------------------------//
 
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
richard-service
Posts: 807
Joined: Tue Oct 16, 2007 8:57 am
Location: New Taipei City, Taiwan
Has thanked: 1 time
Contact:

Re: COMBOBOX Y CHECKBOX

Post by richard-service »

Antonio Linares wrote:Esta es una posible forma, aunque sin usar un combobox:

Image

Vamos a ir mejorándolo :-)

Code: Select all | Expand

#include "fivewin.ch"
#include "constant.ch"

static oDlg, oPanel

function Main()

  local oBtn

  DEFINE DIALOG oDlg TITLE "Marca" ;
   SIZE 200, 250 PIXEL

  @ 100, 5 BTNBMP oBtn PROMPT "Aplicar" SIZE 90, 15 FLAT

   ACTIVATE DIALOG oDlg CENTERED ;
     ON INIT ( oBtn:SetColor( "W+/BG+" ), CreatePanel(), CreateCheckBoxes(), oPanel:SetRange() )

return nil

//--------------------------------------------------------------------------------------//

function CreatePanel()

  oPanel = TScrollPanel():New( 50, 11, oDlg:nBottom - 60, oDlg:nWidth - 20, oDlg )
  oPanel:WinStyle( WS_BORDER, .F. )

return nil

//--------------------------------------------------------------------------------------//

function CreateCheckBoxes()

  local aValues := Array( 12 ), nTop := 0

  AFill( aValues, .F. )

  @ nTop,        0.5 CHECKBOX aValues[ 1 ] SIZE oPanel:nRight, 20 OF oPanel  // SCROLL ADJUST
  @ nTop += 1.7, 0.5 CHECKBOX aValues[ 2 ] SIZE oPanel:nRight, 20 OF oPanel  // SCROLL ADJUST
  @ nTop += 1.7, 0.5 CHECKBOX aValues[ 3 ] SIZE oPanel:nRight, 20 OF oPanel  // SCROLL ADJUST
  @ nTop += 1.7, 0.5 CHECKBOX aValues[ 4 ] SIZE oPanel:nRight, 20 OF oPanel  // SCROLL ADJUST
  @ nTop += 1.7, 0.5 CHECKBOX aValues[ 5 ] SIZE oPanel:nRight, 20 OF oPanel  // SCROLL ADJUST
  @ nTop += 1.7, 0.5 CHECKBOX aValues[ 6 ] SIZE oPanel:nRight, 20 OF oPanel  // SCROLL ADJUST
  @ nTop += 1.7, 0.5 CHECKBOX aValues[ 7 ] SIZE oPanel:nRight, 20 OF oPanel  // SCROLL ADJUST
  @ nTop += 1.7, 0.5 CHECKBOX aValues[ 8 ] SIZE oPanel:nRight, 20 OF oPanel  // SCROLL ADJUST
  @ nTop += 1.7, 0.5 CHECKBOX aValues[ 9 ] SIZE oPanel:nRight, 20 OF oPanel  // SCROLL ADJUST
  @ nTop += 1.7, 0.5 CHECKBOX aValues[ 10 ] SIZE oPanel:nRight, 20 OF oPanel  // SCROLL ADJUST
  @ nTop += 1.7, 0.5 CHECKBOX aValues[ 11 ] SIZE oPanel:nRight, 20 OF oPanel  // SCROLL ADJUST
  @ nTop += 1.7, 0.5 CHECKBOX aValues[ 12 ] SIZE oPanel:nRight, 20 OF oPanel  // SCROLL ADJUST

return nil

//--------------------------------------------------------------------------------------//
 


Dear Antonio

How about use it when Resource Dialog
Best Regards,

Richard

Harbour 3.2.0dev (r2402101027) => Borland C++ v7.7 32bit
MySQL v8.0 /ADS v10
Harbour 3.2.0dev (r2011030937) => Borland C++ v7.4 64bit
User avatar
Antonio Linares
Site Admin
Posts: 42529
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 31 times
Been thanked: 77 times
Contact:

Re: COMBOBOX Y CHECKBOX

Post by Antonio Linares »

Dear Richard,

standard Windows resources (RC files) don't allow to define childs of childs (grandchilds ;-)

so you can only place a TScrollPanel on the resource and from the ON INIT of the dialog, place the checkboxes on the panel

I think it may be easier if we use the samples/ownerdra.prg way...
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
richard-service
Posts: 807
Joined: Tue Oct 16, 2007 8:57 am
Location: New Taipei City, Taiwan
Has thanked: 1 time
Contact:

Re: COMBOBOX Y CHECKBOX

Post by richard-service »

Antonio Linares wrote:Dear Richard,

standard Windows resources (RC files) don't allow to define childs of childs (grandchilds ;-)

so you can only place a TScrollPanel on the resource and from the ON INIT of the dialog, place the checkboxes on the panel

I think it may be easier if we use the samples/ownerdra.prg way...


Thanks a lot.
Best Regards,

Richard

Harbour 3.2.0dev (r2402101027) => Borland C++ v7.7 32bit
MySQL v8.0 /ADS v10
Harbour 3.2.0dev (r2011030937) => Borland C++ v7.4 64bit
Post Reply