LBGUI Window question

Posted By: Ceryni

LBGUI Window question - 04/13/11 18:31

hi,

i want to make my own frame and because i like lbgui very much(thx to lukas) i tried to use the lbgui window.

Now i want to move the engine window(not the lbgui window)
when i click at the titlebar of the lbgui window.

anybody knows how i get the coordinates of the titlebar?
So that i can make a mouselistener?

mfg Nils
Posted By: Lukas

Re: LBGUI Window question - 04/13/11 19:56

Actually the easiest way to do this is using the Moving() event of the window, as documented in the Window members page in the LBGUI manual. I can still explain how to get the coordinates of the titlebar if you want.


The topleft corner of the titlebar is has of course the same position as the window. Its width equals the width of the window.

To get the height of the titlebar, there are 4 functions LBGUI uses internally which you could use for that.
var LBG_window_titlebarheight (LBG_WINDOW* win)
var LBG_window_leftborderwidth (LBG_WINDOW* win)
var LBG_window_rightborderwidth (LBG_WINDOW* win)
var LBG_window_bottomborderheight (LBG_WINDOW* win)

But of course the height depends on the bitmaps you use, and those functions just basically look up their height (but they also check if the window has a titlebar or borders).

But with that information you'd still not exclude the buttons on the titlebar. That's why I recommend using the Moving() event.
Posted By: Ceryni

Re: LBGUI Window question - 04/15/11 13:57

Code:
function move_window()
{
	VECTOR* window_position;
	vec_set(window_position,window_pos);
	vec_add(window_position,vector(main_window->pos_x,main_window->pos_y,0));	
	video_window(window_position,NULL,NULL,NULL);
	main_window->pos_x = 0;
	main_window->pos_y = 0;
	ptr_remove(window_position);
}



that my Moving function but i always get an error called faulure in LBG_window_execute SYS

so where is my fault
Posted By: Lukas

Re: LBGUI Window question - 04/15/11 14:25

In this line
VECTOR* window_position;
you merely create a pointer to a vector and NOT a vector!

You have to create it like this:
VECTOR window_position;
Posted By: Ceryni

Re: LBGUI Window question - 04/15/11 14:56

oh thx
© 2024 lite-C Forums