Selectbutton bug (1 Viewer)

GannTrader

Portal Member
January 31, 2007
29
0
Home Country
Sweden Sweden
Hi

Im writing a plugin.
In it im using a selectbutton that i have to change posx and posy during runtime.
But when changing the posx or posy to move the selectbutton at runtime the arrows are left in the old position.
The position they hade at design.
Im changing the position by calling SetPosition for the selectbutton.


/GannTrader
 

GannTrader

Portal Member
January 31, 2007
29
0
Home Country
Sweden Sweden
Hi

This bug isnt fixed yet and since its a bug in the core someone should correct it.
It quite easy to correct the function SetPosition, se below.
The code is copied from another part of the GUISelectButtonControl.cs
But somone shoult take a look at the properties posx and posy so they funktion as well.

public override void SetPosition(int dwPosX, int dwPosY)
{
if (dwPosX < 0) return;
if (dwPosY < 0) return;
base.SetPosition(dwPosX, dwPosY);
_imageFocused.SetPosition(dwPosX, dwPosY);
_imageNonFocused.SetPosition(dwPosX, dwPosY);

// position right arrow
int x1 = 8;
int x2 = 16;
GUIGraphicsContext.ScaleHorizontal(ref x1);
GUIGraphicsContext.ScaleHorizontal(ref x2);
int dwX = (dwPosX + _width - x1) - x2;

int y1 = 16;
GUIGraphicsContext.ScaleVertical(ref y1);
int dwY = dwPosY + (_height - y1) / 2;
_imageRight.SetPosition(dwX, dwY);
_imageRightFocus.SetPosition(dwX, dwY);

// Position left arrow
dwX = dwPosX + x1;
_imageLeft.SetPosition(dwX, dwY);
_imageLeftFocus.SetPosition(dwX, dwY);
}
 

Users who are viewing this thread

Top Bottom