Re-Initialize Layercombobox

Started by fred_tomke · 2010-07-23 13:16 UTC · 7 replies · SMF topic #1318

Hello,

I'm using a combobox using the layer style in a palette. Since the palette is modeless, the user can add another layer or purge existing layers. But unfortunately the combobox does not recognize this at runtime of the form, the palette must be closed and re-opened to get the current list and the current layerstates. Is there a way to update the list at runtime?

Fred
The Clear method should reset the content. In the pre-populated combos, that means it will clear and repopulate them.
So I guess a VLisp reactor is neaded?

We spoke breifly about this a while back: OpenDCL's inabilitity to detect changes in the drawing database.  Would be nice if there was a way to have an indicator in changes where modeless forms could "react" to changes in the drawing database.

Like: dcl_OnDocActivated

Maybe: dcl_OnDatabaseChanged
data passed would only need to be table or dictionary name that had been changed - then our code could react accordingly.

jb
Hello,

>> dcl_OnDatabaseChanged

Is it really a good idea? Because even zooming changes the database. Whenever new elements are created this event would fire, too.

Fred
author=owenwengerd link=topic=1318.msg7076#msg7076 date=1279892607 wrote:
The Clear method should reset the content. In the pre-populated combos, that means it will clear and repopulate them.


Thanks, Owen, that did the trick. Even the current selection will be kept. I'm overwhelmed.

I solved this using DropDown event. For the textstyle combobox style I solved that by assigning a new list:


(defun c:survey_sc_height_plan_cbb_layer_OnDropDown (/) (dcl_combobox_clear survey_sc_height_plan_cbb_layer))

(defun c:survey_sc_height_plan_cbb_style_OnDropDown (/)
  (dcl_control_setlist survey_sc_height_plan_cbb_style (GET_TEXTSTYLES_EX))
  (dcl_Combobox_selectstring survey_sc_height_plan_cbb_style (if (tblsearch "STYLE" (cdr (assoc "STYLE" lstData))) (cdr (assoc "STYLE" lstData)) (getvar "TEXTSTYLE")))
); c:survey_sc_height_plan_cbb_style_OnDropDown


Fred
author=owenwengerd link=topic=1318.msg7076#msg7076 date=1279892607 wrote:
The Clear method should reset the content. In the pre-populated combos, that means it will clear and repopulate them.


Owen, it doesn't belong at least to my initial post but why there is a gray selection in layer style combobo when focus is off from this control?

Fred
Attachments
author=jb link=topic=1318.msg7077#msg7077 date=1279896052 wrote:
We spoke breifly about this a while back: OpenDCL's inabilitity to detect changes in the drawing database.  Would be nice if there was a way to have an indicator in changes where modeless forms could "react" to changes in the drawing database.


I'm concerned about a performance penalty with this approach.
author=Fred Tomke link=topic=1318.msg7080#msg7080 date=1279901107 wrote:

Owen, it doesn't belong at least to my initial post but why there is a gray selection in layer style combobo when focus is off from this control?

I don't know. Is it consistent between Windows versions? If you think it's a bug, I'll have a closer look.