Page 1 of 1

More than 128 object on a dialog

PostPosted: Thu Dec 22, 2005 12:16 pm
by Piscicelli Zingoni
Hi,
I need to create a single dialog with more than 128 object, i CANNOT use folders.

Is it a limit of FWH ?

Tks

PostPosted: Thu Dec 22, 2005 12:29 pm
by Antonio Linares
Piscicelli,

Do you create it from source code or from resources ?

PostPosted: Thu Dec 22, 2005 12:30 pm
by Piscicelli Zingoni
From source

PostPosted: Thu Dec 22, 2005 1:06 pm
by Antonio Linares
Piscicelli,

Here you have a working sample using 150 controls:

Code: Select all  Expand view
#include "FiveWin.ch"

function Main()

   local oDlg, n, aValues := Array( 150 )
   local nRow, nCol
   
   for n = 1 to Len( aValues )
      aValues[ n ] = Str( n, 3 )
   next   

   DEFINE DIALOG oDlg TITLE "More than 128 controls" FROM 2, 2 TO 30, 48

   n = 1
   for nRow = 1 to 15
      for nCol = 1 to 10
          TGet():New( nRow - 0.5, nCol * 2 - 0.7, GenBlock( aValues, n++ ) )
      next
   next   

   ACTIVATE DIALOG oDlg CENTERED

return nil

function GenBlock( aValues, n )

return bSETGET( aValues[ n ] )


This is how it looks:

Image

PostPosted: Fri Dec 23, 2005 2:21 am
by Piscicelli Zingoni
Great !
So there is no limit ?
I can put on a single dialog 500 BUTTON to indicate the rooms of an hotel ?

I will try.

Many tks
Hi

PostPosted: Fri Dec 23, 2005 5:48 am
by Antonio Linares
Pisicelli,

Yes, no limit. You can put 500 controls or more. As much as you need :)

PostPosted: Fri Dec 23, 2005 11:47 am
by Piscicelli Zingoni
Try this:
Code:
#include "FiveWin.ch"

function Main()

local oDlg, n, aValues := Array( 150 )
local nRow, nCol

for n = 1 to Len( aValues )
aValues[ n ] = Str( n, 3 )
next

DEFINE DIALOG oDlg TITLE "More than 128 controls" FROM 0, 2 TO 35, 90

n = 1
for nRow = 1 to 20
for nCol = 1 to 15
bsave := ERRORBLOCK( { |x| BREAK(x)} )
BEGIN SEQUENCE
TGet():New( nRow - 0.5, nCol * 2 - 0.7, GenBlock( aValues, n++ ) )
RECOVER USING objError
msginfo("This is my Limit: "+str(n))
quit
END
ERRORBLOCK(bsave) // Restore handler
next
next

ACTIVATE DIALOG oDlg CENTERED

return nil

function GenBlock( aValues, n )

return bSETGET( aValues[ n ] )


I Got a messare of 152 max limit (under W98se /XP)

Hi

PostPosted: Fri Dec 23, 2005 12:37 pm
by Antonio Linares
Piscicelli,

You have to increase the aValues size, thats all:

local oDlg, n, aValues := Array( 300 )

It works ok :)

PostPosted: Fri Dec 23, 2005 8:21 pm
by Piscicelli Zingoni
Ops!
It is time i go on holiday.
Sorry
Tks

PostPosted: Fri Dec 23, 2005 8:42 pm
by Antonio Linares
You are welcome, no problem :)