BIM Coordinator Program (INT) April 22, 2024

Find the next step in your career as a Graphisoft Certified BIM Coordinator!

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

whether palette dialog can add other item types dynamically?

Anonymous
Not applicable
Hi.
I create a palette dialog class.
And I want to add some items dynamically. eg. button.

Are there some methods?
Thanks.
1 ACCEPTED SOLUTION

Accepted Solutions
Solution
Akos Somorjai
Graphisoft
Graphisoft
Hi,

Please find below some sample code (it uses a Dialog, not a Palette).

Best, Akos

View solution in original post

7 REPLIES 7
Akos Somorjai
Graphisoft
Graphisoft
Hi,

DG::Button has such a constructor is you do not want to load it from a resource file (see DGButton.hpp):

Button (const Panel& panel, const Rect& rect, ButtonType type = Normal, FrameType frameType = Frame);

Pass the palette as the first param, and the desired rect in the second.

Best, Akos
Anonymous
Not applicable
Akos wrote:
Hi,

DG::Button has such a constructor is you do not want to load it from a resource file (see DGButton.hpp):

Button (const Panel& panel, const Rect& rect, ButtonType type = Normal, FrameType frameType = Frame);

Pass the palette as the first param, and the desired rect in the second.

Best, Akos
Thanks.
Besides, I want to add a tabpage.TabPage constructor need TabControl. How can add it?
Thanks.
Anonymous
Not applicable
Hi.
Besides, I want to add a tabpage in the palette dialog.
TabPage constructor need TabControl.

How can add it?
Thanks.
Solution
Akos Somorjai
Graphisoft
Graphisoft
Hi,

Please find below some sample code (it uses a Dialog, not a Palette).

Best, Akos
Anonymous
Not applicable
Akos wrote:
Hi,

Please find below some sample code (it uses a Dialog, not a Palette).

Best, Akos
Thanks.
I can't find 'GS::Owner' and 'GS::NewOwned' in your code.
Whether I need to import other header files?
Akos Somorjai
Graphisoft
Graphisoft
Hi,

Please include "Owner.hpp"; it is in the GSRoot module.

Best, Akos
Anonymous
Not applicable
Akos wrote:
Hi,

Please include "Owner.hpp"; it is in the GSRoot module.

Best, Akos
Thank you very much.
Now I can add 'TabPage' dynamically.
Learn and get certified!