We value your input!
Please participate in Archicad 28 Home Screen and Tooltips/Quick Tutorials survey

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

How can I put a button onto an IRollPanel?

Anonymous
Not applicable
I created a window with 2 rolldownpanels with the following code but I could not put any control onto the panels.
How can I put for example a DG::Button on one of the panels?
// Dlg_Alma.h
#pragma once
#include "UDRollDownDialogs.hpp"

class Dlg_Alma : public UD::RollDownModalDialog
{
public:
      Dlg_Alma();
private:
      void CreateRollPanel(UD::IRollDownPanelSet& rdps, GS::String title);
};

// Dlg_Alma.cpp
#include ".\dlg_alma.h"

Dlg_Alma::Dlg_Alma() : UD::RollDownModalDialog("OK", 80, "Cancel", 80)
{
      SetTitle("alma");
      UD::IRollDownSurface* rds = GetRollDownSurface();
      UD::IRollDownPanelSet* rdps = rds->CreateRollDownPanelSet();
      CreateRollPanel(*rdps, "alma");
      CreateRollPanel(*rdps, "korte");
}

void Dlg_Alma::CreateRollPanel(UD::IRollDownPanelSet& rdps, GS::String title)
{
      UD::IRollPanel* rp = rdps.CreateRollDownPanel();
      rp->SetTitle(title);
      const DG::SimpleTab& st = rp->GetTabControl();
      DG::SimpleTab& nc_st = const_cast<DG::SimpleTab&>(st);
      nc_st.SetClientSize(500, 300);      
}

// Main.cpp
GSResModule oldResModule = ACAPI_UseOwnResModule();
DGResetDialogRectangles();
Dlg_Alma dlg_Alma;
dlg_Alma.Invoke();
ACAPI_ResetResModule(oldResModule);
1 REPLY 1
Oleg
Expert
You need to create DG::TabPage(s) and pass this tabControl(s) reference to the TabPage's constructor. Buttons and other controls may be placed (GRC or dynamically) in a TabPage but not TabContlol.