<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic How To Get Control Address By DGModelessInit in GDL</title>
    <link>https://community.graphisoft.com/t5/GDL/How-To-Get-Control-Address-By-DGModelessInit/m-p/221226#M3519</link>
    <description>&lt;DIV class="actalk-migrated-content"&gt;I make Modeless Dialog &lt;BR /&gt;&lt;BR /&gt;
&lt;PRE&gt;MyDialog::Init(){
  diagId=DGModelessInit(
    ACAPI_GetOwnResModule()
    , ID_DIALOG
    , ACAPI_GetOwnResModule()
    , GroupSheetDlgCallBack
    , (DGUserData)&amp;amp;dlgData
    , 1);
}&lt;/PRE&gt;
&lt;BR /&gt;But I can't change Control Width By DG Commands.&lt;BR /&gt;&lt;BR /&gt;So I try Control Address.&lt;BR /&gt;&lt;BR /&gt;
&lt;PRE&gt;const DG::Panel &amp;amp;panel = GetReference();
DG::PopUp *p = new DG::PopUp(panel, ID_POPUP);
p-&amp;gt;SetWidth(10);
delete(p);&lt;/PRE&gt;
&lt;BR /&gt;But MyDialogClass have no GetReference();&lt;BR /&gt;&lt;BR /&gt;So MyDialog Class based by Palette&lt;BR /&gt;&lt;BR /&gt;
&lt;PRE&gt;//Constructor
MyDialog::MyDialog(
) :DG::Palette(
	ACAPI_GetOwnResModule()
	, ID_DIALOG
	, ACAPI_GetOwnResModule()
	, ODLBPaletteGuid()
)
{
}&lt;/PRE&gt;
&lt;BR /&gt;But DGModelessInit() don't use consutructor.&lt;BR /&gt;&lt;BR /&gt;Please Teach Me &lt;BR /&gt;How to get Control Address By DGModelessInit()&lt;BR /&gt;DG::PopUp *p = new DG::PopUp(panel, ID_POPUP);&lt;/DIV&gt;</description>
    <pubDate>Tue, 14 Sep 2021 07:21:55 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2021-09-14T07:21:55Z</dc:date>
    <item>
      <title>How To Get Control Address By DGModelessInit</title>
      <link>https://community.graphisoft.com/t5/GDL/How-To-Get-Control-Address-By-DGModelessInit/m-p/221226#M3519</link>
      <description>&lt;DIV class="actalk-migrated-content"&gt;I make Modeless Dialog &lt;BR /&gt;&lt;BR /&gt;
&lt;PRE&gt;MyDialog::Init(){
  diagId=DGModelessInit(
    ACAPI_GetOwnResModule()
    , ID_DIALOG
    , ACAPI_GetOwnResModule()
    , GroupSheetDlgCallBack
    , (DGUserData)&amp;amp;dlgData
    , 1);
}&lt;/PRE&gt;
&lt;BR /&gt;But I can't change Control Width By DG Commands.&lt;BR /&gt;&lt;BR /&gt;So I try Control Address.&lt;BR /&gt;&lt;BR /&gt;
&lt;PRE&gt;const DG::Panel &amp;amp;panel = GetReference();
DG::PopUp *p = new DG::PopUp(panel, ID_POPUP);
p-&amp;gt;SetWidth(10);
delete(p);&lt;/PRE&gt;
&lt;BR /&gt;But MyDialogClass have no GetReference();&lt;BR /&gt;&lt;BR /&gt;So MyDialog Class based by Palette&lt;BR /&gt;&lt;BR /&gt;
&lt;PRE&gt;//Constructor
MyDialog::MyDialog(
) :DG::Palette(
	ACAPI_GetOwnResModule()
	, ID_DIALOG
	, ACAPI_GetOwnResModule()
	, ODLBPaletteGuid()
)
{
}&lt;/PRE&gt;
&lt;BR /&gt;But DGModelessInit() don't use consutructor.&lt;BR /&gt;&lt;BR /&gt;Please Teach Me &lt;BR /&gt;How to get Control Address By DGModelessInit()&lt;BR /&gt;DG::PopUp *p = new DG::PopUp(panel, ID_POPUP);&lt;/DIV&gt;</description>
      <pubDate>Tue, 14 Sep 2021 07:21:55 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/How-To-Get-Control-Address-By-DGModelessInit/m-p/221226#M3519</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-09-14T07:21:55Z</dc:date>
    </item>
    <item>
      <title>Re: How To Get Control Address By DGModelessInit</title>
      <link>https://community.graphisoft.com/t5/GDL/How-To-Get-Control-Address-By-DGModelessInit/m-p/221227#M3520</link>
      <description>Thank you for Reply.&lt;BR /&gt;
But I Can't Popup Control Address from DGModelessInit.&lt;BR /&gt;
&lt;BR /&gt;
I anser myself.&lt;BR /&gt;
I can change Popup Width without Popup Control Address.&lt;BR /&gt;
I used DG Command.&lt;BR /&gt;
&lt;BR /&gt;
//Change Item Width&lt;BR /&gt;
void DGSetItemWidth(short dialId, short item, short width) {&lt;BR /&gt;
	//muinus return&lt;BR /&gt;
	if (width &amp;lt; 0)return;&lt;BR /&gt;
&lt;BR /&gt;
	short left;&lt;BR /&gt;
	short top;&lt;BR /&gt;
	short right;&lt;BR /&gt;
	short bottom;&lt;BR /&gt;
	//Get Current Rect&lt;BR /&gt;
	DGGetItemRect(dialId, item, &amp;amp;left, &amp;amp;top, &amp;amp;right, &amp;amp;bottom);&lt;BR /&gt;
	//Calc Grow&lt;BR /&gt;
	short right2 = left + width;//new right&lt;BR /&gt;
	short hGrow = right2 - right;//grow&lt;BR /&gt;
	short vGrow = 0;&lt;BR /&gt;
	//set&lt;BR /&gt;
	DGGrowItem(dialId, item, hGrow, vGrow);&lt;BR /&gt;
}&lt;BR /&gt;
//Change Item Height&lt;BR /&gt;
void DGSetItemHeight(short dialId, short item, short height) {&lt;BR /&gt;
	//minus  return&lt;BR /&gt;
	if (height &amp;lt; 0)return;&lt;BR /&gt;
&lt;BR /&gt;
	short left;&lt;BR /&gt;
	short top;&lt;BR /&gt;
	short right;&lt;BR /&gt;
	short bottom;&lt;BR /&gt;
	//Get Current Rect&lt;BR /&gt;
	DGGetItemRect(dialId, item, &amp;amp;left, &amp;amp;top, &amp;amp;right, &amp;amp;bottom);&lt;BR /&gt;
	//Get Grow&lt;BR /&gt;
	short bottom2 = top + height;//new bottom&lt;BR /&gt;
	short hGrow = 0;&lt;BR /&gt;
	short vGrow = bottom2 - bottom;//grow&lt;BR /&gt;
	//set&lt;BR /&gt;
	DGGrowItem(dialId, item, hGrow, vGrow);&lt;BR /&gt;
&lt;BR /&gt;
}&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
So Use...&lt;BR /&gt;
&lt;BR /&gt;
DGSetItemWidth(dialId, ID_POPUP_01, 100);//Set Width=100px</description>
      <pubDate>Mon, 16 Aug 2021 01:55:20 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/How-To-Get-Control-Address-By-DGModelessInit/m-p/221227#M3520</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-08-16T01:55:20Z</dc:date>
    </item>
  </channel>
</rss>

