Gamestudio Links
Zorro Links
Newest Posts
loading historical data 1st time
by AndrewAMD. 04/14/23 12:54
Trade at bar open
by juanex. 04/13/23 19:43
Bug in Highpass2 filter
by rki. 04/13/23 09:54
Adding Limit Orders For IB
by scatters. 04/11/23 16:16
FisherN
by rki. 04/11/23 08:38
AUM Magazine
Latest Screens
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Hecknex World
Who's Online Now
1 registered members (Grant), 999 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
rki, FranzIII, indonesiae, The_Judge, storrealba
18919 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Popup menu on wrong position #245592
01/10/09 20:18
01/10/09 20:18
Joined: Apr 2007
Posts: 3,751
Canada
WretchedSid Offline OP
Expert
WretchedSid  Offline OP
Expert

Joined: Apr 2007
Posts: 3,751
Canada
Hey @all,

in my program i use a Popup Menu with this code:
Code:
HMENU  hSubMenu2;

function set_sub_menus()
{
	long menu;
	long hSubMenu;
	
	menu=CreateMenu();
	hSubMenu=CreateMenu();
	hSubMenu2=CreatePopupMenu();

	InsertMenu(hSubMenu,1,MF_BYPOSITION|MF_STRING,1,"Neu");
	InsertMenu(hSubMenu,2,MF_BYPOSITION|MF_STRING,2,"Öffnen");
	InsertMenu(hSubMenu,3,MF_BYPOSITION|MF_STRING,3,"Speichern");
	InsertMenu(hSubMenu,5,MF_BYPOSITION|MF_STRING,4,"Beenden");

//Popupmenu!!
InsertMenu(hSubMenu2,1,MF_BYPOSITION|MF_STRING,5,"Test");

	InsertMenu(menu,0,MF_BYPOSITION|MF_STRING|MF_POPUP,hSubMenu,"Datei");

	SetMenu(hWnd,menu);
}


but if I want to open the Menu with:
Code:
	TrackPopupMenuEx(hSubMenu2, TPM_LEFTBUTTON,mouse_cursor.x,mouse_cursor.y,hWnd,NULL);

the menu will create on the wrong position (a few pixels above the mouse)


here is a screenshot of the problem.

Is it possible that gamestudio sets the mouse_coursor var wrong? And how I fix the problem?

sry for the bad english...


Shitlord by trade and passion. Graphics programmer at Laminar Research.
I write blog posts at feresignum.com
Re: Popup menu on wrong position [Re: WretchedSid] #245595
01/10/09 20:23
01/10/09 20:23
Joined: Jan 2008
Posts: 1,580
Blade280891 Offline
Serious User
Blade280891  Offline
Serious User

Joined: Jan 2008
Posts: 1,580
Do you not need to (in the main()) have mouse_mode = 4

then

while(1)
{
//something to do with the mouse, but i can't remember :S
}


My Avatar Randomness V2

"Someone get me to the doctor, and someone call the nurse
And someone buy me roses, and someone burned the church"
Re: Popup menu on wrong position [Re: Blade280891] #245596
01/10/09 20:26
01/10/09 20:26
Joined: Apr 2007
Posts: 3,751
Canada
WretchedSid Offline OP
Expert
WretchedSid  Offline OP
Expert

Joined: Apr 2007
Posts: 3,751
Canada
I have set mouse_mode = 2 (it still doesn´t work with 4) and I have a mouse funtion:
Code:
function mouse_on()
{
	mouse_map = arrow;
	mouse_mode = 2;
	while(mouse_mode > 0)
	{
		mouse_pos.x = mouse_cursor.x;
		mouse_pos.y = mouse_cursor.y;
		wait(1); 		     
	}
}




Last edited by Sylar; 01/10/09 20:27.

Shitlord by trade and passion. Graphics programmer at Laminar Research.
I write blog posts at feresignum.com
Re: Popup menu on wrong position [Re: WretchedSid] #245600
01/10/09 20:47
01/10/09 20:47
Joined: Jul 2007
Posts: 959
nl
F
flits Offline
User
flits  Offline
User
F

Joined: Jul 2007
Posts: 959
nl
i know how to fix it but it isns buildint by the engine

PhysicalToLogicalPoint
ore
LogicalToPhysicalPointthis functions are winapi and arent include by the engine

alternative is set the mouse_mode to 0


"empty"
Re: Popup menu on wrong position [Re: flits] #245682
01/11/09 10:14
01/11/09 10:14
Joined: Apr 2007
Posts: 3,751
Canada
WretchedSid Offline OP
Expert
WretchedSid  Offline OP
Expert

Joined: Apr 2007
Posts: 3,751
Canada
thanx flits, but it doesn´t helped to set mouse_mode to 0. I have fixed it, by set the popup menu 65 pixel under mouse_courser.y.

But now I have a new problem, I want to create a panel that repeats itself endless (the bmap is 100 Pixel wide).
So I have this in a function: object_bar_pan.size_x = screen_size.x; but there a black stripes every 100 pixel (the black stripes are 28 pixel wide).

How can I fix this?


Shitlord by trade and passion. Graphics programmer at Laminar Research.
I write blog posts at feresignum.com
Re: Popup menu on wrong position [Re: WretchedSid] #245690
01/11/09 10:58
01/11/09 10:58
Joined: Oct 2007
Posts: 5,209
İstanbul, Turkey
Quad Offline
Senior Expert
Quad  Offline
Senior Expert

Joined: Oct 2007
Posts: 5,209
İstanbul, Turkey
make dimensions power of 2


3333333333
Re: Popup menu on wrong position [Re: Quad] #245693
01/11/09 11:07
01/11/09 11:07
Joined: Jul 2007
Posts: 959
nl
F
flits Offline
User
flits  Offline
User
F

Joined: Jul 2007
Posts: 959
nl
adding 65 wont be correct all the time this is because if the resolution vs window inside window

because i need a preciesion pointer i made a realy differnt calution


"empty"

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

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