[solved]A couple of question on example eNotepad

General help with the Ecere Cross Platform GUI toolkit: Window, common controls, events, etc.
Help with the 2D Graphics library: Surface, Display, Bitmap, Font and others.
Post Reply
samsam598
Posts: 212
Joined: Thu Apr 14, 2011 9:44 pm

[solved]A couple of question on example eNotepad

Post by samsam598 »

Given below code in example ../eNotepad:

Code: Select all

 
 FileDialog fileSaveDialog
   {
      master = this, type = save, text = "Save File...",
      types = txtTypes, sizeTypes = sizeof(txtTypes), filters = txtFilters, sizeFilters = sizeof(txtFilters)
   };
   FileDialog openDialog
   {
      master = this, type = open, text = "Load File...",
      types = txtTypes, sizeTypes = sizeof(txtTypes), filters = txtFilters, sizeFilters = sizeof(txtFilters)
   };
   saveDialog = fileSaveDialog;
 
 
I have no clue where 'saveDialog' came from ,could you please clarify?
Another amazing thing in the example is that the Edit menu is fully functioinal but I did not find a piece of code to implement such.How could this be done? :)
Thanks a lot.
Last edited by samsam598 on Wed Sep 07, 2011 7:43 pm, edited 1 time in total.
jerome
Site Admin
Posts: 608
Joined: Sat Jan 16, 2010 11:16 pm

Re: A question on example eNotepad

Post by jerome »

Sam,

saveDialog is a built-in property of the Window class, that is used in conjunction with the isDocument property, and the OnSaveFile virtual method. It lets you specify a FileDialog dialog instance to be used when saving your document.

It is meant for quickly turning a Window class into a document editor. Of course you don't have to make use of all that built-in functionality, you could implement the saving aspect your own way.

Regards,

Jerome
samsam598
Posts: 212
Joined: Thu Apr 14, 2011 9:44 pm

Re: A couple of question on example eNotepad

Post by samsam598 »

Thanks Jerome,how about the menu Edit I,there is no code but it is fully functional.how?
jerome
Site Admin
Posts: 608
Joined: Sat Jan 16, 2010 11:16 pm

Re: A couple of question on example eNotepad

Post by jerome »

As I mentioned in this post, Ecere supports menu merging of child windows. The EditBox class implements that Edit menu. All we have to do is to include a MenuPlacement to say that we want it after the File menu.
Post Reply