Removed/Added window controls based on if "showWindowControls" option

was on/off. Removed reliance on the overlay mode for this.
master
sigonasr2 6 years ago
parent bd7a76a06f
commit 3ebdd94951
  1. BIN
      sigIRCv2.jar
  2. 6
      src/sig/Module.java
  3. 5
      src/sig/modules/ControllerModule.java
  4. 2
      src/sig/sigIRC.java

Binary file not shown.

@ -53,7 +53,7 @@ public class Module {
}
private void enableWindowDrag(int mouseX, int mouseY) {
if (!sigIRC.overlayMode && !dragging && inDragBounds(mouseX,mouseY) && !DRAGGING) {
if (sigIRC.showWindowControls && !dragging && inDragBounds(mouseX,mouseY) && !DRAGGING) {
//Enable dragging.
dragOffset = new Point((int)position.getX() - mouseX,(int)position.getY()-mouseY);
dragging=DRAGGING=true;
@ -104,6 +104,7 @@ public class Module {
}
private void dragWindow() {
if (sigIRC.showWindowControls) {
if (dragging) {
//sigIRC.panel.repaint(getDrawBounds().getBounds());
int mouseX = sigIRC.panel.lastMouseX+(int)dragOffset.getX();
@ -118,6 +119,7 @@ public class Module {
inDragZone=true;
//System.out.println("In Drag Zone for Module "+name);
//sigIRC.panel.setCursor(new Cursor(Cursor.MOVE_CURSOR));
}
}/*else
if (sigIRC.panel.getCursor().getType()==Cursor.MOVE_CURSOR) {
sigIRC.panel.setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
@ -141,7 +143,7 @@ public class Module {
}
private void drawModuleHeader(Graphics g) {
if (!sigIRC.overlayMode) {
if (sigIRC.showWindowControls) {
g.drawImage(Module.IMG_DRAGBAR,
(int)position.getX()+2,
(int)position.getY()-Module.IMG_DRAGBAR.getHeight(),

@ -103,9 +103,12 @@ public class ControllerModule extends Module{
}
//buttons.add(new Button(0.1,0.05,0.1,0.05,controllers.get(0),Identifier.Button._3,Color.RED,this));
LoadButtonAndAxisData();
if (sigIRC.showWindowControls) {
click_buttons.add(new AddClickableButton(new Rectangle(
0,(int)position.getHeight()-21,96,20),"Add Button",this));
}
}
public List<Controller> getControllers() {
return controllers;
@ -382,6 +385,7 @@ public class ControllerModule extends Module{
public void run() {
Point mouse_position = new Point((int)(sigIRC.panel.lastMouseX-getPosition().getX()),(int)(sigIRC.panel.lastMouseY-getPosition().getY()));
if (sigIRC.showWindowControls) {
if (resizing) {
PerformResize(mouse_position);
setConstraints();
@ -484,6 +488,7 @@ public class ControllerModule extends Module{
}
}
}
}
for (Controller c : controllers) {
//System.out.println("Data for "+c.getName()+" ("+c.getType()+"):");
c.poll();

@ -100,7 +100,7 @@ public class sigIRC{
public static BackgroundColorButton button;
public static JFrame window;
static boolean overlayMode=false;
static boolean showWindowControls=false;
public static boolean showWindowControls=false;
static int windowX=0;
static int windowY=0;
static int windowWidth=0;

Loading…
Cancel
Save