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 » Help needed.
Re: Help needed. [message #27337 is a reply to message #27331] Tue, 13 July 2010 00:21 Go to previous messageGo to previous message
koldo is currently offline  koldo
Messages: 3361
Registered: August 2008
Senior Veteran
281264 wrote on Mon, 12 July 2010 18:28

Hi,

I am struggling with this dummy application I am creating. The objective is to draw lines in the application’s screen after the user has selected “line” by clicking in its corresponding button.

Allow me to explain what I have done:

1.- I have created a struct containing a menu with three buttons-only button “line” does something.
2.- I have added a SplitterFrame and put the previous struct in its left. This allows me to have the application’s window for drawing.
3.- Functionality: once the user has selected “line” from the menu the screen shows mouse coordinates. Then the user clicks again and anchors one point of the line; after a second click the line is drawn on the screen; so far so good.
4.- However, in the next steps, I am finding some problems:
a.- the last coordinates remains in the screen after line creation process; how to get rid off it?
b.- My intention is to store all the lines in a container, so they can be redraw every time is needed. So far, I am using C++ vectors. I have created a struct –line- for contain lines (with four variables). The first problem arises when I try to create a line in my application: it does not compile. Second is the usage of vectors or U++ vectors. What to use? In general, is it allow to use the STL in U++?.

Many thanks,

Javier


Hello Javier

1. I have renamed "line" struct to "myline". line name seems not to be good for a struct.

4.a I have added this to handle mouse up:

void ejemplo_splitter::LeftUp(Point p,dword d) {
	if(!ended) {
		ended = 1;
		Refresh();
	}
}


And Paint begin like this:
void ejemplo_splitter::Paint(Draw& draw)
{
	draw.DrawRect(GetSize(),White());


now it works.

4.b About vectors or other containers I use U++ ones. Read for example this http://www.ultimatepp.org/srcdoc$Core$NTLvsSTL$en-us.html or this http://www.ultimatepp.org/srcdoc$Core$Tutorial$en-us.html



Best regards
Iñaki
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: U ++ Vector vs STL vector
Next Topic: Usage of Date and Time
Goto Forum:
  


Current Time: Thu May 16 21:10:11 CEST 2024

Total time taken to generate the page: 0.02363 seconds