;Draws items in owner-draw listbox or combobox control. ;Items can have multiple lines. ;Call this function from a dialog function, like in dlg_listbox_multiline. ;Returns 1 if draws, 0 if not.
;hDlg message wParam lParam - hDlg message wParam lParam. ;ctrlId - control id. If 0, draws all owner-draw listbox and combobox controls.
Hi Gintaras, this is really fantastic, especially the ability to wrap - I can't believe this works perfectly with the Splitters!!!
Anyway, it seems to prevent CB_ItemColor from adding any colors to the new listbox. Is this an easy fix?
Thanks!!!
Stuart
Hi Gintaras,
Thanks so much for this update. I am trouble getting it to work from outside the dialog...i.e. separate functions that fill the LB at various times. I think it has to do with passing
Quote:message wParam lParam
i've tried to pass this on as well but not successfully.
Any advice?
Thanks,
Stuart
From other threads? Can use LB_RESETCONTENT and LB_Add from other thread. May need to use lock. More difficult would be with colors, because need to recreate the arrays.
I managed to color items with which begin with a square bracket: "["
But is it also possible to style it differently regarding it's font size and style (bold)?
In other words, items that begin with a square bracket also get styled: bold.
I assume the function must have an array added like "t_act" but called "t_style" or something like that?
But it would also mean you have to modifying the function "DT_LbCbOwnerDraw" would take to much time.
,,;; ITEMS THAT WILL POPULATE LISTBOX ,,str lb_text="[ test 1 ][][ test 2 ][]test 3[]test 4" ,, ,,;; SET THE COLOR STYLE FOR THE DESIRED ITEMS ,,;; JUST SET IT'S CORRESPONDING 't_act[]' TO THE DESIRED COLOR ,,foreach _s lb_text ,,,str regx="^\[" ,,,if(findrx(_s regx)>=0) ,,,,t_act[]=dark_orange ,,,else ,,,,t_act[]=dark_grey
,,;; FILL THE LISTBOX ,,ARRAY(str) a.create(1) ,,a=lb_text ,,int i ,,for(i 0 a.len)LB_Add lb a[i]
,caseWM_DESTROY ,caseWM_COMMANDgoto messages2 ret ;messages2 sel wParam ,caseIDOK ,caseIDCANCEL ret1
;Draws items in owner-draw listbox or combobox control. ;Items can have multiple lines. ;Call this function from a dialog procedure, like in dlg_listbox_multiline. ;Returns 1 if draws, 0 if not.
;hDlg message wParam lParam - hDlg message wParam lParam. ;ctrlId - control id. If 0, draws all owner-draw listbox and combobox controls. ;aColorText, aColorBack - arrays containing colors of item text and background. The variables should have thread scope. If omitted or 0, uses default colors. ;selColorText, selColorBack - colors of selected item text and background. If omitted or 0, uses default selection colors. ;aFont - array containing font handles of item text. The variable should have thread scope. Can be set only some elements, others can be 0 (default font).
02-02-2019, 03:56 AM (This post was last modified: 02-02-2019, 04:04 AM by r0n.)
I seem to have the following problem:
When the DT_LbCbOwnerDraw has tooltip text, the tooltip does not dissapear after the user moves out of DT_Lb control area.
(I have set max time of 32seconds in dialog settings tooltip (time, s), it seems to dissapear after the 32 seconds are run out)
Is this an issue within DT_LbCbOwnerDraw?
(Maybe it is not an issue within DT_LbCbOwnerDraw, I do not know for sure).
EDIT:
It seems to happen when you sometimes move slow out of LB area or when moving fast out of LB area.
(Sorry, can not give more input on this).
Is there something I can add in the DT_Lb function to force kill tooltips if user mouse is out of LB area?
Maybe this issue may take to much time to solver properly, as I understand you are very busy with next "QM" so if this "issue" takes to long to resolve then by all means skip it.
It seems it is a bug of tooltip controls. Not related to DT_LbCbOwnerDraw.
In this example, tooltip of listbox, edit and richedit has this bug.
Function Dialog3