PlanetSquires Forums

Support Forums => Other Software and Code => Topic started by: Israel Vega Alvarez on August 02, 2012, 04:51:07 PM

Title: COMBOBOX with Array
Post by: Israel Vega Alvarez on August 02, 2012, 04:51:07 PM
In DDT is possible add a string array for fill a combox (when control is created)

Is possible do with Firefly or SDK ?

DIM a() AS STRING
a(1)="item1"
a(2)="item2"
a(3)="item3"

CONTROL ADD COMBOBOX, hDlg, id&,a(), x, y, xx, yy [, [style&] [, [exstyle&]]] [[,] CALL callback]


Is this process more fast or efficient that FF_Combobox_AddString  or COMBOBOX ADD STRING (DDT)  ?

FF_COMBOBOX_ADDSTRING or COMBOBOX ADD STRING  add each item one by one
but do not know if there is another way.

Israel

Title: Re: COMBOBOX with Array
Post by: José Roca on August 02, 2012, 05:33:27 PM
No, there is not other way, and DDT does not any magic: it just creates the control and then adds the strings of the array one by one.
Title: Re: COMBOBOX with Array
Post by: Paul Squires on August 02, 2012, 05:50:57 PM
If you already know what items you want to add, you can use the "(Custom)" property of the ComboBox control and enter them at design time rather than at run time.
Title: Re: COMBOBOX with Array
Post by: Israel Vega Alvarez on August 02, 2012, 06:16:44 PM
Thanks for quick reply and great information...

Israel
Title: Re: COMBOBOX with Array
Post by: Israel Vega Alvarez on August 02, 2012, 10:04:57 PM
Also found it interesting that Borje Hagsten posted  in PB Forum an example which helps to reduce the time
deactivating the %WM_SETREDRAW before of loop with:

SendMessage HWND_RELEMP_COMBO2,%WM_SETREDRAW, 0, 0

and activating after of loop.

SendMessage HWND_RELEMP_COMBO2,%WM_SETREDRAW, 1, 0

http://www.powerbasic.com/support/pbforums/showthread.php?t=23612&highlight=%25WM_SETREDRAW (http://www.powerbasic.com/support/pbforums/showthread.php?t=23612&highlight=%25WM_SETREDRAW)


I was testing and with a array of 33453 elements I reduce time from 7 seconds to 4 seconds.


Israel