Board index » delphi » TFileWindow (descendant of TEdit in TPW 1.5)

TFileWindow (descendant of TEdit in TPW 1.5)

How do I change the font in a TFileWindow , a descendant of TEdit?  I looked
throughout the TPW 1.5 books and online help but coudn't find how.

Also, I'm having trouble closing a modal dialog box. I have a menuitem Help -->
About. It opens up the about dialog box just fine, but I can't get it to close.
 I have one button labeled "OK" it's the Default Push Button.  It's id value is
5001.  I've tried several things but can't get it to close.
Here's the code for my CMFileAbout procedure.

procedure RMEditWindow.CMHelpAbout(var Msg:TMessage);
var
   AboutDlg:PAboutDialog;
   ReturnValue:Word;

begin
     AboutDlg:=New(PAboutDialog,Init(@Self, 'ABOUT'));
     ReturnValue:=Application^.ExecDialog(AboutDlg);
     if ReturnValue=5001 then AboutDlg^.EndDlg(5001);
end;

Thanks for any help!!!

***Andrew Bishop
***AKBis...@usa.net [aol.com, also]
***Veggie Tales Fan
 ___
/     \
| 00 |      _____
|  o  |    /   00   \
|  U |    |     o     |
\     /    \   \_/   /
       

 

Re:TFileWindow (descendant of TEdit in TPW 1.5)


Re:TFileWindow (descendant of TEdit in TPW 1.5)


I have about 60 messages to process from my Menus in an Object Windows program.
 I gave them IDs from 501 to 561. I was wondering is there a way to process
them all in one procedure or do I have individual procedures for each item.

What's going to happen is whichever menu item you select, it'll paste the text
of that item into the window.  So all the items will be handled the same except
for the text that I'll paste.

Once again, thanks for any help I recieve.

***Andrew Bishop
***AKBis...@usa.net [aol.com, also]
***Veggie Tales Fan
 ___
/     \
| 00 |      _____
|  o  |    /   00   \
|  U |    |     o     |
\     /    \   \_/   /
       

Re:TFileWindow (descendant of TEdit in TPW 1.5)


Quote
> I have about 60 messages to process from my Menus in an Object Windows program.
>  I gave them IDs from 501 to 561. I was wondering is there a way to process
> them all in one procedure or do I have individual procedures for each item.

> What's going to happen is whichever menu item you select, it'll paste the text
> of that item into the window.  So all the items will be handled the same except
> for the text that I'll paste.

   It sounds like you can place the text of the messages in an array and
pull the specific data out via the message #.  You can define the array
subscripts 501..560, if that makes it any easier, too.  How you construct
the data in the array (read it in from some external file or create
constants in the program source) is up to you, as the size of the text
may be a factor here.

Re:TFileWindow (descendant of TEdit in TPW 1.5)


oops, mistaken again...

There's no such thing in TPW1.5 like 'Inherited', that's BP7,
just replace that with your windows-parent typename, in this case:

   TWindow.WMCommand(Msg);

sorry for that
-------------------------------------------
'base your joy not upon the deeds of others
for what is given can be taken away...'
-------------------------------------------
Double K, Martin.K...@t-online.de

Re:TFileWindow (descendant of TEdit in TPW 1.5)


AKBishop schrieb:

Quote

> I have about 60 messages to process from my Menus in an Object Windows program.
>  I gave them IDs from 501 to 561. I was wondering is there a way to process
> them all in one procedure or do I have individual procedures for each item.

> What's going to happen is whichever menu item you select, it'll paste the text
> of that item into the window.  So all the items will be handled the same except
> for the text that I'll paste.

> Once again, thanks for any help I recieve.

> ***Andrew Bishop
> ***AKBis...@usa.net [aol.com, also]
> ***Veggie Tales Fan
>  ___
> /     \
> | 00 |      _____
> |  o  |    /   00   \
> |  U |    |     o     |
> \     /    \   \_/   /
>        

--
hi Andrew

Every command for your window is assigned within the
'WM_COMMAND' msg. So declare this one in your window as well

   TAnyWindow = Object(TWindow)
      {...}
      procedure WMCommand(var Msg: TMessage);virtual wm_First + wm_Command;
      procedure CommandPerform(var Msg: TMessage); {maybe 'virtual' for descendants}
      {...}
   end;

and implement it as follows:

   procedure TAnyWindow.WMCommand(var Msg: TMessage);
      begin
         CommandPerform(Msg);
         if Msg.Result=0 then
            Inherited WMCommand(Msg);
      end;

where 'CommandPerform' is a procedure you should build:

   procedure TAnyWindow.CommandPerform(var Msg: TMessage);
      begin
         Msg.Result=1;
         case Msg.wParam of
            501: begin
               {...}
            end;
            {...}
            561: begin
               {...}
            end;
            else Msg.Result:=0;
         end;
      end;

Hope this will help, bye
-------------------------------------------
'base your joy not upon the deeds of others
for what is given can be taken away...'
-------------------------------------------
Double K, Martin.K...@t-online.de

Other Threads