Quantcast
Channel: Library Questions - Processing 2.x and 3.x Forum
Viewing all articles
Browse latest Browse all 2896

How do you enable Mouse Wheel Events on "G4P-GUI Designer" controls

$
0
0

I am using G4P GUI Designer creating a PID Controller Screen to interface serially with a custom designed Arduino PID Controller. I created many Custom Sliders using the GUI Designer, but I do not get Mouse Wheel events through the G4P Slider Control Event Method. I want to use mouseWheel Events since it provides greater control of value settings than with mouseDragged Events, when considering my old shaky hands. I DO GET the G4P Control mouseWheel Events in my "Main Window", but how do I translate the mouseWheel(Event) to spSliderChange(Object, Event)? Or better yet, how do I get the mouseWheel Events to occur in the GUI slider event handlers?

Example Slider generated by GUI Designer (I have 10 of them total in GUI) which do not get mouseWheel Events, however the G4P controls do get mouse drag and steady events:

public void spSliderChange(GCustomSlider source, GEvent event) { //_CODE_:spSlider:950263:
  println("custom_slider1 - GCustomSlider >> GEvent." + event + " @ " + millis());
} //_CODE_:spSlider:950263:

public void createGUI() {
    G4P.messagesEnabled(false);
    G4P.setGlobalColorScheme(GCScheme.BLUE_SCHEME);
    G4P.setCursor(ARROW);
    surface.setTitle("Sketch Window");
    spSlider = new GCustomSlider(this, 120, 410, 300, 80, "blue18px");
    spSlider.setShowValue(true);
    spSlider.setShowLimits(true);
    spSlider.setRotation(PI/2, GControlMode.CORNER);
    spSlider.setLimits(0.5, 1.0, -1.0);
    spSlider.setShowTicks(true);
    spSlider.setNumberFormat(G4P.DECIMAL, 2);
    spSlider.setOpaque(false);
    spSlider.addEventHandler(this, "spSliderChange");
}

GCustomSlider spSlider;

And this in my "Main Window" which does get mouseWheel Events on slider:

void mouseWheel(MouseEvent event) {
    println(" - mouseWheel >> GEvent." + event + " @ " + millis());
}

I appreciate your input, who ever responds. I am not a GUI designer, but rather a low level 'C' and 'C++' coder. Your help is appreciated!

Thank you!


Viewing all articles
Browse latest Browse all 2896

Trending Articles