home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.lang.pascal.borland      Borland Pascal was actually pretty neat      2,978 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 1,007 of 2,978   
   Jason Burgon to Markus Humm   
   Re: TVision problem with some sort of en   
   29 Sep 04 14:06:50   
   
   From: gvision@ntlworld.com   
      
   "Markus Humm"  wrote in message   
   news:415ab968$0$25764$9b622d9e@news.freenet.de...   
   > I want to do the following with TP/BP 7.0 TVision, but   
   > it doesn't work:   
   >   
   > - write a separate unit   
   > - this unit contains a simple dialog with some text and 3 buttons   
   > - this dialog should be callable via this simple function:   
   >    function mydialog(dtext:STRING):BYTE; all calls necessary for   
   >    handling the dialog should be inside this function.   
      
   > How do I get this dialog into this function WITHOUT tieing it to the   
   > main program?   
   > Or how would I pass the reference to TProgram of   
   > the main program to this function so that I could execute the   
   > ExecuteDialog method of it?   
      
   There is a global variable called 'Application' in APP.PAS that is a pointer   
   to the TProgram/TApplication object. So if "D" is a pointer to your dialog   
   box then inside your MyFunction dialog you would have:   
      
   unit MyUnit;   
      
   uses Views, App,....;   
   ...   
     function mydialog(DText: string): Byte;   
     var   
       D: PMyDialog;   
     begin   
       ...   
       if Application^.ExecuteDialog(D, @DialogData) = cmOk then   
      ....   
      
   Where '@DialogData' is either nil if your dialog initialises its data itself   
   and doesn't return anything other than its end condition. Otherwise   
   DialogData should be a pointer to user-defined record that contains one   
   field for each data-transfering-control in your dialog box - See the help   
   for the SetData and GetData methods of the view types that your dialog box   
   contains.   
      
   --   
   Jay   
      
   Author of Graphic Vision   
   http://homepage.ntlworld.com/gvision/   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca