Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Community » Newbie corner » edit field in sub menu
edit field in sub menu [message #37493] Thu, 11 October 2012 02:26 Go to next message
nlneilson is currently offline  nlneilson
Messages: 644
Registered: January 2010
Location: U.S. California. Mojave &...
Contributor
Can an edit field be added to a sub menu and if so how.

	void SettingsMenu(Bar& bar) {
		bar.Add("m meters", THISBACK(Setm)).Check(mX);
		bar.Add("km kilometers", THISBACK(Setkm)).Check(kmX);
		bar.Add("ft feet", THISBACK(Setft)).Check(ftX);

There are about a dozen more.


I would a user to be able to set a time zone relative to UTC.
I have it hard coded -7 for the Pacific TZ.

Rather than have a box pop up where a user types in his TZ relative to UTC just have an edit field it can be typed in.

If not then maybe just a scroll box where -11 to +11 can be picked.

[Updated on: Thu, 11 October 2012 02:27]

Report message to a moderator

Re: edit field in sub menu [message #37495 is a reply to message #37493] Thu, 11 October 2012 07:38 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Yes. Check docs for

void Bar::Add(Ctrl& ctrl, ..)

family.
Re: edit field in sub menu [message #37500 is a reply to message #37495] Thu, 11 October 2012 18:24 Go to previous messageGo to next message
nlneilson is currently offline  nlneilson
Messages: 644
Registered: January 2010
Location: U.S. California. Mojave &...
Contributor
Thanks Mirek but looking at the docs for CtrlCore, CtrlLib, MenuBar, Bar, EditField derived classes, etc and trying about 20 examples I did not find out how to put an edit field in the menu.

Widget placement, size, etc. yes.

No direct code or info on editfield in menu.

About 8 hours looking.

Could you point me to an example or give a few lines of code on how it can be done.
Re: edit field in sub menu [message #37501 is a reply to message #37500] Thu, 11 October 2012 20:00 Go to previous messageGo to next message
dolik.rce is currently offline  dolik.rce
Messages: 1789
Registered: August 2008
Location: Czech Republic
Ultimate Contributor

nlneilson wrote on Thu, 11 October 2012 18:24

Widget placement, size, etc. yes.

Something like this should work:
	EditString edit;
	void Menu(Bar& bar) {
		bar.Add(edit.SizePos(),50);
		bar.Add("Exit", THISBACK(Exit));
	}


Best regards,
Honza

EDIT: Added full source in attachment.
  • Attachment: main.cpp
    (Size: 0.52KB, Downloaded 181 times)

[Updated on: Thu, 11 October 2012 20:02]

Report message to a moderator

Re: edit field in sub menu (Solved) [message #37505 is a reply to message #37501] Fri, 12 October 2012 07:02 Go to previous message
nlneilson is currently offline  nlneilson
Messages: 644
Registered: January 2010
Location: U.S. California. Mojave &...
Contributor
Thanks Honza!

The main.cpp you attached was what I needed to see how it is done.

edit: Got something working, it helps to be pointed in the right direction.

[Updated on: Fri, 12 October 2012 07:55]

Report message to a moderator

Previous Topic: [HttpRequest] undefined identifier
Next Topic: Dont underline letters in buttons
Goto Forum:
  


Current Time: Thu Apr 18 17:40:06 CEST 2024

Total time taken to generate the page: 0.01309 seconds