FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour COMBOBOX Y CHECKBOX
Posts: 537
Joined: Mon Jan 16, 2006 03:42 PM
COMBOBOX Y CHECKBOX
Posted: Fri Jun 10, 2022 05:00 PM
Hola Amigos.. como se podria hacer esto:


con xbrowse se podria... pero otra forma

saludos
Posts: 851
Joined: Sun Nov 09, 2014 05:01 PM
Re: COMBOBOX Y CHECKBOX
Posted: Fri Jun 10, 2022 05:56 PM

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.
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: COMBOBOX Y CHECKBOX
Posted: Sat Jun 11, 2022 04:51 PM
Esta es una posible forma, aunque sin usar un combobox:



Vamos a ir mejorándolo :-)

Code (fw): Select all Collapse
#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
Posts: 866
Joined: Tue Oct 16, 2007 08:57 AM
Re: COMBOBOX Y CHECKBOX
Posted: Sun Jun 12, 2022 03:30 AM
Antonio Linares wrote:Esta es una posible forma, aunque sin usar un combobox:



Vamos a ir mejorándolo :-)

Code (fw): Select all Collapse
#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 (r2503251254) => Borland C++ v7.7 32bit

MySQL v8.0

Harbour 3.2.0dev (r2503251254) => Borland C++ v7.7 64bit
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: COMBOBOX Y CHECKBOX
Posted: Sun Jun 12, 2022 06:48 AM

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
Posts: 866
Joined: Tue Oct 16, 2007 08:57 AM
Re: COMBOBOX Y CHECKBOX
Posted: Sun Jun 12, 2022 12:03 PM
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 (r2503251254) => Borland C++ v7.7 32bit

MySQL v8.0

Harbour 3.2.0dev (r2503251254) => Borland C++ v7.7 64bit

Continue the discussion