Well, I found a third solution:
I use my own custom color box to display colors. I fill the values (255) for
it from the AcCmEntityColor.
As for the other approaches:
1. Does not seem possible to have "invisible" Document open. Though possible
with DB, but DB!=Doc, and as Tony T. said that's what is needed for the
color box to work.
2. I could not create the fully functional CAcUiColorComboBox, using new
operator. Although my code(below) actually creates an operational
CAcUiColorComboBox, it visually consists of separate Edit and ListBox.
Probably smth. to du with subclassing and SetListBox() methods, but I drop
it for now.
CAcUiColorComboBox* m_DynamicCombo;
CRect r = CRect(100,100,200,200);
BOOL res = m_DynamicCombo->Create(
CBS_DROPDOWNLIST || CBS_OWNERDRAWFIXED || CBS_HASSTRINGS , r, this, 10055);
m_DynamicCombo->ShowWindow(SW_SHOW);
m_DynamicCombo->SetStyleMask(CBS_DROPDOWNLIST || CBS_OWNERDRAWFIXED ||
CBS_HASSTRINGS);
"andru123"
schreef in bericht
news:[email protected]...
> Thanks for the input.
> hmm. what can I do?
>
> I am going to experiment a bit, then:
>
> 1. Have some dwg open "in the background" especially for such case? Will
it
> help? Will try.
> 2. Detect if any dwg is open, and accordingly create CAcUiColorComboBox or
> its replacement (manual creation). This requires using new/delete
operators,
> and seems to be not easy with CAcUiColorComboBox. My code creates it, but
> shows as separate Edit and ListBox controls right beneath each other (!).
>
> Will try more tomorrow.
>
> Tony Tanzillo wrote in message
> news:[email protected]...
> > This is probably due to the fact that the control shows
> > the 'meta' colors for the active document.
> >
> > For example, set the current layer's color to something
> > other than the default, and the Color combo displays that
> > same color next to the "ByLayer" item.
> >
> >
> > "andru123" wrote in message
> news:[email protected]...
> > > CAcUi... does not seem to work when no drawing is open. Is it by
design?
> > >
> > > I created a simple CAcUiDialog with CAcUiColorComboBox.
> > > Works fine when any dwg is open. When I close all dwg and call the
> dialog
> > > (through the menu), it raises an exception. (Though exception does not
> occur
> > > if I remove CAcUiColorComboBox from dialog)
> > >
> > > Any way to overcome this?
> > >
> > >
> >
> >
>
>