Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (TipmyPip, AndrewAMD), 1,151 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
LBGUI Window question #367463
04/13/11 18:31
04/13/11 18:31
Joined: Dec 2010
Posts: 63
C
Ceryni Offline OP
Junior Member
Ceryni  Offline OP
Junior Member
C

Joined: Dec 2010
Posts: 63
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

Re: LBGUI Window question [Re: Ceryni] #367468
04/13/11 19:56
04/13/11 19:56
Joined: May 2007
Posts: 2,043
Germany
Lukas Offline

Programmer
Lukas  Offline

Programmer

Joined: May 2007
Posts: 2,043
Germany
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.

Re: LBGUI Window question [Re: Lukas] #367615
04/15/11 13:57
04/15/11 13:57
Joined: Dec 2010
Posts: 63
C
Ceryni Offline OP
Junior Member
Ceryni  Offline OP
Junior Member
C

Joined: Dec 2010
Posts: 63
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

Re: LBGUI Window question [Re: Ceryni] #367617
04/15/11 14:25
04/15/11 14:25
Joined: May 2007
Posts: 2,043
Germany
Lukas Offline

Programmer
Lukas  Offline

Programmer

Joined: May 2007
Posts: 2,043
Germany
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;

Re: LBGUI Window question [Re: Lukas] #367620
04/15/11 14:56
04/15/11 14:56
Joined: Dec 2010
Posts: 63
C
Ceryni Offline OP
Junior Member
Ceryni  Offline OP
Junior Member
C

Joined: Dec 2010
Posts: 63
oh thx


Moderated by  aztec, Blink, HeelX 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1