Ecere SDK/eC Forums • View topic - [solved]A couple of question on example eNotepad




Ecere SDK/eC Forums

Ecere Developers Community

[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.

[solved]A couple of question on example eNotepad

Postby samsam598 » Mon Sep 05, 2011 7:57 pm

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.
samsam598
 
Posts: 208
Joined: Thu Apr 14, 2011 9:44 pm

Re: A question on example eNotepad

Postby jerome » Mon Sep 05, 2011 8:10 pm

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
jerome
Site Admin
 
Posts: 623
Joined: Sat Jan 16, 2010 11:16 pm

Re: A couple of question on example eNotepad

Postby samsam598 » Mon Sep 05, 2011 8:32 pm

Thanks Jerome,how about the menu Edit I,there is no code but it is fully functional.how?
samsam598
 
Posts: 208
Joined: Thu Apr 14, 2011 9:44 pm

Re: A couple of question on example eNotepad

Postby jerome » Mon Sep 05, 2011 8:48 pm

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.
jerome
Site Admin
 
Posts: 623
Joined: Sat Jan 16, 2010 11:16 pm


Return to GUI Toolkit & 2D Graphics

Who is online

Users browsing this forum: No registered users and 6 guests

cron