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 » EditField ctrl and StaticText ctrl in a StatusBar crtl
EditField ctrl and StaticText ctrl in a StatusBar crtl [message #27662] Wed, 28 July 2010 16:20 Go to next message
281264 is currently offline  281264
Messages: 270
Registered: June 2010
Location: Spain
Experienced Member
Hi,

Is it possible to add a StaticText ctrl and a EditField ctrl to a StatusBar, at the bottom of an application? The target is to allow user to input commands through the EditField ctrl.

Thanks,

Javier
Re: EditField ctrl and StaticText ctrl in a StatusBar crtl [message #27690 is a reply to message #27662] Thu, 29 July 2010 16:38 Go to previous messageGo to next message
ratah is currently offline  ratah
Messages: 107
Registered: July 2010
Experienced Member
Here is an example,
struct MyApp:TopWindow
{
  StatusBar status;
  EditString editcommand;

  MyApp()
  {
    AddFrame(status);
    editcommand.SetRect(1,1,200,18);
    status.Add(editcommand);
  }
  
}

GUI_APP_MAIN
{
  MyApp app;
  app.Run();
}

[Updated on: Thu, 29 July 2010 16:38]

Report message to a moderator

Re: EditField ctrl and StaticText ctrl in a StatusBar crtl [message #27694 is a reply to message #27690] Thu, 29 July 2010 17:09 Go to previous messageGo to next message
281264 is currently offline  281264
Messages: 270
Registered: June 2010
Location: Spain
Experienced Member
Many thanks.

Javier
Re: EditField ctrl and StaticText ctrl in a StatusBar crtl [message #27695 is a reply to message #27694] Thu, 29 July 2010 17:23 Go to previous messageGo to next message
ratah is currently offline  ratah
Messages: 107
Registered: July 2010
Experienced Member
Now the question is : how to add Separator to the StatusBar (like in menuBar)?

I use AddFrame but i dislike frame border!!
Re: EditField ctrl and StaticText ctrl in a StatusBar crtl [message #27701 is a reply to message #27695] Thu, 29 July 2010 22:41 Go to previous messageGo to next message
281264 is currently offline  281264
Messages: 270
Registered: June 2010
Location: Spain
Experienced Member
The separator can be added, as you mention, by AddFrame (or SetFrame)+LeftSeparatorFrame (or RightSeparatorFrame). It looks nice, IMO, and acts similar to Separator in MenuBar.

Javier.
Re: EditField ctrl and StaticText ctrl in a StatusBar crtl [message #27713 is a reply to message #27701] Fri, 30 July 2010 11:48 Go to previous messageGo to next message
ratah is currently offline  ratah
Messages: 107
Registered: July 2010
Experienced Member
Can you give me an example, i cant't do with my code
Re: EditField ctrl and StaticText ctrl in a StatusBar crtl [message #27715 is a reply to message #27713] Fri, 30 July 2010 12:35 Go to previous messageGo to next message
281264 is currently offline  281264
Messages: 270
Registered: June 2010
Location: Spain
Experienced Member
Here it goes:
//statusbar;
	label_com_editor.SetRect(150,4,60,22);
	label_com_editor.SetText("Command:").SetFrame(LeftSeparatorFrame());//<- This is what you need (I guess).
	.......


Code above places a StaticText (label_com_editor), displaying "Command:" and adds a LeftSeparatorFrame, which inserts a vertical separator at the left of the StaticText.

Let me know if this is what you are looking for.

Cheers,

Javier
Re: EditField ctrl and StaticText ctrl in a StatusBar crtl [message #27723 is a reply to message #27715] Fri, 30 July 2010 14:41 Go to previous messageGo to next message
ratah is currently offline  ratah
Messages: 107
Registered: July 2010
Experienced Member
That's great! thanks
Only I have the default message in my statusbar that I can't initialize Embarassed

Here is my code:

StaticText  infobar1, infobar2;

...

AddFrame(status);
infobar1.SetRect(0,2,200,15);
infobar1.SetFrame(RightSeparatorFrame());
infobar2.SetRect(0,2,200,15);
infobar2.SetFrame(RightSeparatorFrame());	
status.Add(infobar1.LeftPos(0,300));
status.Add(infobar2.LeftPos(300,300));
status.Add(editCommand);

...

infobar1.SetText(infos1);
infobar2.SetText(infos2);



Ratah
Re: EditField ctrl and StaticText ctrl in a StatusBar crtl [message #27729 is a reply to message #27723] Fri, 30 July 2010 16:11 Go to previous messageGo to next message
281264 is currently offline  281264
Messages: 270
Registered: June 2010
Location: Spain
Experienced Member
If what you pursue is to provide functionality to the messages in the StatusBar, check this out:

http://www.ultimatepp.org/srcdoc$CtrlLib$Tutorial$en-us.html

Section 12.

Cheers,

Javier
Re: EditField ctrl and StaticText ctrl in a StatusBar crtl [message #27731 is a reply to message #27729] Fri, 30 July 2010 16:26 Go to previous messageGo to next message
ratah is currently offline  ratah
Messages: 107
Registered: July 2010
Experienced Member
Yes, but I want to dynamically inform user about what happens in my program (every action the program do). Not only when user want an useful help about a menu or a button in a toolbar.

ratah

[Updated on: Fri, 30 July 2010 16:53]

Report message to a moderator

Re: EditField ctrl and StaticText ctrl in a StatusBar crtl [message #27733 is a reply to message #27731] Fri, 30 July 2010 17:20 Go to previous messageGo to next message
281264 is currently offline  281264
Messages: 270
Registered: June 2010
Location: Spain
Experienced Member
Then I guess what you need is an InfoCtrl (added to the statusbar). Please, read the Statusbar chapter in the manual.

Cheers,

Javier

Re: EditField ctrl and StaticText ctrl in a StatusBar crtl [message #27764 is a reply to message #27733] Mon, 02 August 2010 11:43 Go to previous messageGo to next message
ratah is currently offline  ratah
Messages: 107
Registered: July 2010
Experienced Member
Hi Javier,

Thank you, I will inform you for the sucess.

A+
Re: EditField ctrl and StaticText ctrl in a StatusBar crtl [message #27777 is a reply to message #27764] Tue, 03 August 2010 11:02 Go to previous message
ratah is currently offline  ratah
Messages: 107
Registered: July 2010
Experienced Member
Hello,

Here is the correct code:
StaticText  infobar1, infobar2;

...

status.Set(0, "", 0);

AddFrame(status);
infobar1.SetRect(0,2,200,15);
infobar1.SetFrame(RightSeparatorFrame());
infobar2.SetRect(0,2,200,15);
infobar2.SetFrame(RightSeparatorFrame());	
status.Add(infobar1.LeftPos(0,300));
status.Add(infobar2.LeftPos(300,300));
status.Add(editCommand);

...

infobar1.SetText(infos1);
infobar2.SetText(infos2);


I don't know why these codes do not work

status.Set("");
status.SetDefault("");

Thas 's all

[Updated on: Tue, 03 August 2010 11:03]

Report message to a moderator

Previous Topic: Hello, need a helping hand
Next Topic: Ctrl key pressed while LeftDown: detection.
Goto Forum:
  


Current Time: Thu Mar 28 09:54:05 CET 2024

Total time taken to generate the page: 0.01287 seconds