Page 1 of 1

[solved]A couple of question on example eNotepad

PostPosted: Mon Sep 05, 2011 7:57 pm
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.

Re: A question on example eNotepad

PostPosted: Mon Sep 05, 2011 8:10 pm
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

Re: A couple of question on example eNotepad

PostPosted: Mon Sep 05, 2011 8:32 pm
by samsam598
Thanks Jerome,how about the menu Edit I,there is no code but it is fully functional.how?

Re: A couple of question on example eNotepad

PostPosted: Mon Sep 05, 2011 8:48 pm
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.