|
1 registered members (Grant),
999
guests, and 2
spiders. |
|
Key:
Admin,
Global Mod,
Mod
|
|
|
Popup menu on wrong position
#245592
01/10/09 20:18
01/10/09 20:18
|
Joined: Apr 2007
Posts: 3,751 Canada
WretchedSid
OP
Expert
|
OP
Expert
Joined: Apr 2007
Posts: 3,751
Canada
|
Hey @all, in my program i use a Popup Menu with this 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: 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
Serious User
|
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
OP
Expert
|
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: 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
flits
User
|
User
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
OP
Expert
|
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: Quad]
#245693
01/11/09 11:07
01/11/09 11:07
|
Joined: Jul 2007
Posts: 959 nl
flits
User
|
User
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"
|
|
|
|