ET++: A sample application: iconedit

Every ET++ application which uses the document metaphore must subclass the Document class. IconDocument is the iconedit document class.

IconDocument::DoMakeMenuBar() generates the menu bar. Each menu item has an integer key associated with it, which is used in IconDocument::DoMenuCommand() to determine which menu item was selected.


MenuBar *IconDocument::DoMakeMenuBar()
{
	Menu *m;
	MenuBar *mb= Document::DoMakeMenuBar();

	//---- view menu
	m= new Menu(cVIEWMENU, "View");
	m->AppendItems(
		"Zoom In",  IconEditRange()+cZOOMIN,
		"Zoom Out", IconEditRange()+cZOOMOUT,
		"100 %",    IconEditRange()+cZOOM100,
		"-",
		"View As Pattern", IconEditRange()+cPATTERN,
		0);
	mb->AddMenu(m);

	[ ... make color menu ... ]
	return mb;
}

Back to the top of the IconEdit description

Back to the top of the ET++ pages