COMBOBOX Y CHECKBOX

COMBOBOX Y CHECKBOX

Postby jbrita » Fri Jun 10, 2022 5:00 pm

Hola Amigos.. como se podria hacer esto:
Image

con xbrowse se podria... pero otra forma

saludos
jbrita
 
Posts: 486
Joined: Mon Jan 16, 2006 3:42 pm

Re: COMBOBOX Y CHECKBOX

Postby JoseAlvarez » Fri Jun 10, 2022 5: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.
User avatar
JoseAlvarez
 
Posts: 753
Joined: Sun Nov 09, 2014 5:01 pm

Re: COMBOBOX Y CHECKBOX

Postby Antonio Linares » Sat Jun 11, 2022 4:51 pm

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

Image

Vamos a ir mejorándolo :-)

Code: Select all  Expand view
#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
Antonio Linares
Site Admin
 
Posts: 41414
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: COMBOBOX Y CHECKBOX

Postby richard-service » Sun Jun 12, 2022 3:30 am

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

Image

Vamos a ir mejorándolo :-)

Code: Select all  Expand view
#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 v5.7 /ADS v10
Harbour 3.2.0dev (r2011030937) => Borland C++ v7.4 64bit
User avatar
richard-service
 
Posts: 772
Joined: Tue Oct 16, 2007 8:57 am
Location: New Taipei City, Taiwan

Re: COMBOBOX Y CHECKBOX

Postby Antonio Linares » Sun Jun 12, 2022 6: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
User avatar
Antonio Linares
Site Admin
 
Posts: 41414
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: COMBOBOX Y CHECKBOX

Postby richard-service » 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 (r2402101027) => Borland C++ v7.7 32bit
MySQL v5.7 /ADS v10
Harbour 3.2.0dev (r2011030937) => Borland C++ v7.4 64bit
User avatar
richard-service
 
Posts: 772
Joined: Tue Oct 16, 2007 8:57 am
Location: New Taipei City, Taiwan


Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 36 guests