Ecere SDK/eC Forums
http://ecere.org/community/
Print view

[solved]A couple of question on example eNotepad
http://ecere.org/community/viewtopic.php?f=5&t=179
Page 1 of 1
Author:  samsam598 [ Mon Sep 05, 2011 7:57 pm ]
Post subject:  [solved]A couple of question on example eNotepad

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.
Author:  jerome [ Mon Sep 05, 2011 8:10 pm ]
Post subject:  Re: A question on example eNotepad

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
Author:  samsam598 [ Mon Sep 05, 2011 8:32 pm ]
Post subject:  Re: A couple of question on example eNotepad

Thanks Jerome,how about the menu Edit I,there is no code but it is fully functional.how?
Author:  jerome [ Mon Sep 05, 2011 8:48 pm ]
Post subject:  Re: A couple of question on example eNotepad

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.
All times are UTC-05:00 Page 1 of 1