Archicad C++ API
About Archicad add-on development using the C++ API.

DG Items Class (Separator, EditSpin, MultiSelListBox)

ReignBough
Enthusiast

I created a palette dialog and use some of the dialog item classes. But these three seems to not work for me.

Palette declaration

 

class MyPalette : public DG::Palette,
  // observers
  public DG::CompoundItemObserver
{
  // dialog items
  DG::Separator       m_separatorV;
  DG::Separator       m_separatorH;
  DG::IntEdit         m_intEdit;
  DG::EditSpin        m_editSpin;
  //.. more codes ..

 


Palette constructor (initial size and position)

 

AtdDoorSignCounterPlt::AtdDoorSignCounterPlt() :
  DG::Palette(DG::NativePoint(), 125, 100, m_guid, VGrow, Close, TopCaption),
  m_separatorV(GetReference(), DG::Rect(1, 1, 2, 2)),
  m_separatorH(GetReference(), DG::Rect(1, 1, 2, 2)),
  m_intEdit(GetReference(), DG::Rect()),
  m_editSpin(GetReference(), DG::Rect(0, 0, 10, 25), m_intEdit),
  //.. more codes (including actual size and position of items and Show() functions are called)..

 



ERR: m_editInt should be m_intEdit in this image

Separator (SOLVED, see comment below)

It seems that DG::Separator only caters vertical separator. As seen on the image above, m_separatorV is okay. But m_separatorH (highlighted by white color) only has left "border". Do I have to do or set values to make it a horizontal line?

Currently, I am using GroupBox as horizontal separator.

EditSpin

The created EditSpin (up/down buttons) does not show. Only the IntEdit is visible.

Currently, I am using SingleSpin and IntEdit. Whenever SingleSpin changes (clicked), IntEdit will be updated; and vice versa.

MultiSelListBox

When a multiple item is selected then SetOnTabItem() is called, the item will only be place on the first selected item in the list. If you are on the last of the list, you will not notice that the item is already set to the tab index. Is there a way to let it be placed on any of the selected items? Like, instead of SetOnTabItem(tabIndex, item) we'll be using SetOnTabItem(listItem, tabIndex, item).

Currently, whenever I call SetOnTabItem() I will also call SetScrollPosition() so that the first selected item will be visible.

~ReignBough~
ARCHICAD 26 INT (from AC18)
Windows 11 Pro, AMD Ryzen 7, 3.20GHz, 32.0GB RAM, 64-bit OS
2 REPLIES 2
ReignBough
Enthusiast
Separator

I changed the Rect(1, 1, 2, 2) to Rect(1, 1, 5, 2) and the horizontal separator is now okay.
m_separatorH(GetReference(), DG::Rect(1, 1, 5, 2)),
~ReignBough~
ARCHICAD 26 INT (from AC18)
Windows 11 Pro, AMD Ryzen 7, 3.20GHz, 32.0GB RAM, 64-bit OS
Miklos Vegh
Graphisoft
Graphisoft

Hi,

1. The dialog Manager decides the type of the separator by comparing the horizontal and vertical sizes of the control.

2. The order of the edit and the editspin control is important. The edit control should be preceeding the spin control which follows it in the resource. In the sample code above the edit control was created with an empty rect.

3. Currently multisel listboxes can have the ontab item only on the first selected row.

Didn't find the answer?

Check other topics in this Forum

Back to Forum

Read the latest accepted solutions!

Accepted Solutions

Start a new conversation!