<?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 Re: How to use ModalDialog ???? in Archicad C++ API</title>
    <link>https://community.graphisoft.com/t5/Archicad-C-API/How-to-use-ModalDialog/m-p/169677#M6587</link>
    <description>Hi Atila,&lt;BR /&gt;
&lt;BR /&gt;
Currently I use DG:: classes and I dont remember about this callback exactly, so guessing. &lt;BR /&gt;
&lt;BR /&gt;
I think you need to try "return 0;" instead "return 1" in your exampe.&lt;BR /&gt;
I dont think you need handle FILTERCHAR at all.&lt;BR /&gt;
&lt;BR /&gt;
Except DialogManager documentation you can look in DG_Test example.&lt;BR /&gt;
&lt;BR /&gt;
Oleg.</description>
    <pubDate>Tue, 17 Feb 2009 14:27:37 GMT</pubDate>
    <dc:creator>Oleg</dc:creator>
    <dc:date>2009-02-17T14:27:37Z</dc:date>
    <item>
      <title>How to use ModalDialog ????</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/How-to-use-ModalDialog/m-p/169670#M6580</link>
      <description>&lt;DIV class="actalk-migrated-content"&gt;Hello,&lt;BR /&gt;&lt;BR /&gt;i'm trying to use modalDialog class so as to have a window with a textEdit, a label and two button( cancel and ok).&lt;BR /&gt;&lt;BR /&gt;I tried this : &lt;BR /&gt;&lt;BR /&gt;- In GRC file : &lt;BR /&gt;
&lt;PRE&gt;'GDLG'  4000  Modal   100  100  100  100  "Test Window" {
TextEdit   20  20  60  20  SmallPlain   255
}&lt;/PRE&gt;
- In cpp file :&lt;BR /&gt;
&lt;PRE&gt;DG::ModalDialog* modalWindow = new DG::ModalDialog(4000);
if(!modalWindow-&amp;gt;Invoke())
    ACAPI_WriteReport("Invoke failed",true);
&lt;/PRE&gt;
But the invoke always failed.&lt;BR /&gt;May be my grc file is not correctly written, i don't know.&lt;BR /&gt;If somebody already used Modaldialog and could help me, i would thank him a lot.&lt;BR /&gt;&lt;BR /&gt;Thank you.&lt;BR /&gt;&lt;BR /&gt;Sébastien&lt;/DIV&gt;</description>
      <pubDate>Thu, 03 Aug 2023 15:24:00 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/How-to-use-ModalDialog/m-p/169670#M6580</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-08-03T15:24:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to use ModalDialog ????</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/How-to-use-ModalDialog/m-p/169671#M6581</link>
      <description>&lt;BLOCKQUOTE&gt;atila-diffusion wrote:&lt;BR /&gt;i'm trying to use modalDialog class so as to have a window with a textEdit, a label and two button( cancel and ok).&lt;BR /&gt;
But the invoke always failed.&lt;BR /&gt;
May be my grc file is not correctly written, i don't know.&lt;/BLOCKQUOTE&gt;
Your resource IDs should start from 32500 (except for palettes and modeless dialogs, which start from 32400).</description>
      <pubDate>Mon, 09 Feb 2009 12:20:23 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/How-to-use-ModalDialog/m-p/169671#M6581</guid>
      <dc:creator>Ralph Wessel</dc:creator>
      <dc:date>2009-02-09T12:20:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to use ModalDialog ????</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/How-to-use-ModalDialog/m-p/169672#M6582</link>
      <description>I changed my ressourceId to 32520 but the invoke failed again.&lt;BR /&gt;
&lt;BR /&gt;
Is it better to use this fonction : 
&lt;PRE&gt;DG::ModalDialog* modalWindow = new DG::ModalDialog(32520);
modalWindow-&amp;gt;Invoke();&lt;/PRE&gt; &lt;BR /&gt;
or this fonction : 
&lt;PRE&gt;DGModalDialog (Fill_GDLGID, Fill_Handler, (DGUserData) &amp;amp;prefsData)&lt;/PRE&gt; like in the exemple ???&lt;BR /&gt;
&lt;BR /&gt;
Thank you</description>
      <pubDate>Mon, 09 Feb 2009 13:08:00 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/How-to-use-ModalDialog/m-p/169672#M6582</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-02-09T13:08:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to use ModalDialog ????</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/How-to-use-ModalDialog/m-p/169673#M6583</link>
      <description>&lt;BLOCKQUOTE&gt;atila-diffusion wrote:&lt;BR /&gt;I changed my ressourceId to 32520 but the invoke failed again.&lt;BR /&gt;
Is it better to use this fonction : &lt;BR /&gt;
ModalDialog&lt;BR /&gt;
or this fonction : &lt;BR /&gt;
DGModalDialog&lt;BR /&gt;
like in the exemple ???&lt;/BLOCKQUOTE&gt;
Check that your resources compiled with the new ID too.&lt;BR /&gt;
I use DGModalDialog for several reasons:&lt;UL&gt;&lt;LI&gt;- All the DG functions have better documentation;&lt;BR /&gt;
- It works across more versions of ArchiCAD;&lt;BR /&gt;
- I have my own dialog class anyway (wrapping the DG functions) so I can write: &lt;PRE&gt;Dialog about(aboutResID);
about.show();&lt;/PRE&gt;&lt;/LI&gt;&lt;/UL&gt;</description>
      <pubDate>Mon, 09 Feb 2009 13:41:21 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/How-to-use-ModalDialog/m-p/169673#M6583</guid>
      <dc:creator>Ralph Wessel</dc:creator>
      <dc:date>2009-02-09T13:41:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to use ModalDialog ????</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/How-to-use-ModalDialog/m-p/169674#M6584</link>
      <description>I suppose you would not want to give me your class ? &lt;IMG src="https://community.graphisoft.com/legacyfs/online/emojis/icon_smile.gif" style="display : inline;" /&gt;&lt;BR /&gt;
&lt;BR /&gt;
Or may be a simple exemple of using which make me able to get back data from textedit.&lt;BR /&gt;
&lt;BR /&gt;
Thank you</description>
      <pubDate>Mon, 09 Feb 2009 13:52:15 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/How-to-use-ModalDialog/m-p/169674#M6584</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-02-09T13:52:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to use ModalDialog ????</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/How-to-use-ModalDialog/m-p/169675#M6585</link>
      <description>I succeeded to create a modalDialog with two buttons ok and cancel and with a textedit with the DGModalDialog.&lt;BR /&gt;
&lt;BR /&gt;
But I can't write into my textedit, do you know where could be the problem?&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;

&lt;PRE&gt;'GDLG'  32500    Modal    0    0  420  460  "Window test"  {
/* [  1] */ Button             340  425   70   20  LargePlain     "OK"
/* [  2] */ Button             260  425   70   20  LargePlain     "Cancel"
/* [  3] */ TextEdit			8    4  250   20  SmallPlain		30
}&lt;/PRE&gt;


&lt;PRE&gt;static short DGCALLBACK myWindow_Handler (short				message,
									  short				dialogID,
									  short				item,
									  DGUserData		userData,
									  DGMessageData		msgData)
{

	msgData = msgData;
	userData = userData;
	item = item;
	dialogID = dialogID;
		
	switch (message) 
	{
		case DG_MSG_INIT:
			
			break;

		case DG_MSG_CLICK:
			
			if(item == 1) 
				ACAPI_WriteReport("OK",true);

			break;

		case DG_MSG_CLOSE:
							
			break;
	}

	return 1;

}		// Fill_Handler



static void Do_myWindow (void)
{
	GSResModule 	filNum;

	// Get the dialog from our resource file
	filNum = ACAPI_UseOwnResModule ();
	DGModalDialog (32500, myWindow_Handler,0);
	ACAPI_ResetResModule (filNum);
	


}		// Do_FillSettings&lt;/PRE&gt;

Thanks</description>
      <pubDate>Tue, 10 Feb 2009 14:33:01 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/How-to-use-ModalDialog/m-p/169675#M6585</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-02-10T14:33:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to use ModalDialog ????</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/How-to-use-ModalDialog/m-p/169676#M6586</link>
      <description>hello, It's me again,&lt;BR /&gt;
&lt;BR /&gt;
I found how to et retrieve text data from the textEdit (DGGetItemText for them who are looking for it), but I do not succeed to write into this one since my keyboard, i only can fill it by Copy/Paste.&lt;BR /&gt;
&lt;BR /&gt;
If somebody knows why I can't write with my keyboard in my TextEdit , Thank you in advance&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
 ::::::::::::::::::::::EDIT ::::::::::::::::::::::&lt;BR /&gt;
I found the solution,&lt;BR /&gt;
&lt;BR /&gt;
in the callback function I had to add this in the switch(message) :&lt;BR /&gt;

&lt;PRE&gt;case DG_MSG_FILTERCHAR:
				 test[0] = char(msgData);
				 test[1] = '\0';
				 strcat(contentKeyValidation,test);
				DGSetItemText (32509, 2, contentKeyValidation);
			break;&lt;/PRE&gt;

 :::::::::::::::::::END EDIT :::::::::::::::::::</description>
      <pubDate>Mon, 16 Feb 2009 10:11:37 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/How-to-use-ModalDialog/m-p/169676#M6586</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-02-16T10:11:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to use ModalDialog ????</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/How-to-use-ModalDialog/m-p/169677#M6587</link>
      <description>Hi Atila,&lt;BR /&gt;
&lt;BR /&gt;
Currently I use DG:: classes and I dont remember about this callback exactly, so guessing. &lt;BR /&gt;
&lt;BR /&gt;
I think you need to try "return 0;" instead "return 1" in your exampe.&lt;BR /&gt;
I dont think you need handle FILTERCHAR at all.&lt;BR /&gt;
&lt;BR /&gt;
Except DialogManager documentation you can look in DG_Test example.&lt;BR /&gt;
&lt;BR /&gt;
Oleg.</description>
      <pubDate>Tue, 17 Feb 2009 14:27:37 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/How-to-use-ModalDialog/m-p/169677#M6587</guid>
      <dc:creator>Oleg</dc:creator>
      <dc:date>2009-02-17T14:27:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to use ModalDialog ????</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/How-to-use-ModalDialog/m-p/169678#M6588</link>
      <description>Hi,&lt;BR /&gt;
&lt;BR /&gt;
you're right, the "return 0 is a mistake, but I do not find how to write in the editbox, the FILTERCHAR is the only way i found to enter any text.&lt;BR /&gt;
All caracters seems to be filtered.</description>
      <pubDate>Tue, 17 Feb 2009 20:11:12 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/How-to-use-ModalDialog/m-p/169678#M6588</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-02-17T20:11:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to use ModalDialog ????</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/How-to-use-ModalDialog/m-p/169679#M6589</link>
      <description>Hmm, may be I am wrong,&lt;BR /&gt;
but I think "return 1" was the reason why EditBox didnt work, as it mean all chars were filtered out.&lt;BR /&gt;
Are you tried "return 0" and remove FILTERCHAR handler ?&lt;BR /&gt;
If it dont work, then I dont know what is a reason.&lt;BR /&gt;
&lt;BR /&gt;
Oleg</description>
      <pubDate>Wed, 18 Feb 2009 05:05:15 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/How-to-use-ModalDialog/m-p/169679#M6589</guid>
      <dc:creator>Oleg</dc:creator>
      <dc:date>2009-02-18T05:05:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to use ModalDialog ????</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/How-to-use-ModalDialog/m-p/169680#M6590</link>
      <description>Hi,&lt;BR /&gt;
&lt;BR /&gt;
Thank you very much,&lt;BR /&gt;
&lt;BR /&gt;
you were right, i changed the "return 0" to "return 1" and everything work.&lt;BR /&gt;
&lt;BR /&gt;
thank you.</description>
      <pubDate>Wed, 18 Feb 2009 08:24:28 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/How-to-use-ModalDialog/m-p/169680#M6590</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-02-18T08:24:28Z</dc:date>
    </item>
  </channel>
</rss>

