@@ -329,7 +329,7 @@ BangComponent::BangComponent(const pd::Gui& pdGui, Box* parent) : GUIComponent(p
329329 };
330330
331331 initParameters (); // !! FIXME: virtual call from constructor!!
332- box->restrainer .setSizeLimits (38 , 38 , 200 , 200 );
332+ box->restrainer .setSizeLimits (38 , 38 , 1200 , 1200 );
333333 box->restrainer .checkComponentBounds (box);
334334}
335335
@@ -366,7 +366,7 @@ ToggleComponent::ToggleComponent(const pd::Gui& pdGui, Box* parent) : GUICompone
366366
367367 initParameters ();
368368
369- box->restrainer .setSizeLimits (38 , 38 , 200 , 200 );
369+ box->restrainer .setSizeLimits (38 , 38 , 1200 , 1200 );
370370 box->restrainer .checkComponentBounds (box);
371371}
372372
@@ -1088,10 +1088,7 @@ void GraphOnParent::updateCanvas()
10881088 canvas->setBounds (-x, -y, w + x, h + y);
10891089
10901090 auto parentBounds = box->getBounds ();
1091- if (parentBounds.getWidth () != w - 8 || parentBounds.getHeight () != h - 29 )
1092- {
1093- box->setSize (w + 8 , h + 29 );
1094- }
1091+ box->setSize (w, h);
10951092 }
10961093}
10971094
@@ -1131,9 +1128,6 @@ void Subpatch::updateValue()
11311128 if (static_cast <t_canvas*>(gui.getPointer ())->gl_isgraph )
11321129 {
11331130 box->setType (box->textLabel .getText (), true );
1134-
1135- // Makes sure it has the correct size
1136- box->graphics ->updateValue ();
11371131 }
11381132};
11391133
@@ -1157,10 +1151,13 @@ MousePad::MousePad(const pd::Gui& gui, Box* box) : GUIComponent(gui, box)
11571151{
11581152 Desktop::getInstance ().addGlobalMouseListener (this );
11591153 // setInterceptsMouseClicks(false, true);
1154+
1155+ box->textLabel .setVisible (false );
11601156}
11611157
11621158MousePad::~MousePad ()
11631159{
1160+ box->textLabel .setVisible (true );
11641161 Desktop::getInstance ().removeGlobalMouseListener (this );
11651162}
11661163
@@ -1174,7 +1171,7 @@ void MousePad::updateValue(){
11741171
11751172void MousePad::mouseDown (const MouseEvent& e)
11761173{
1177- if (!getScreenBounds ().contains (e.getScreenPosition ())) return ;
1174+ if (!getScreenBounds ().contains (e.getScreenPosition ()) || !isLocked ) return ;
11781175
11791176 auto * x = static_cast <t_pad*>(gui.getPointer ());
11801177 t_atom at[3 ];
@@ -1200,7 +1197,7 @@ void MousePad::mouseDrag(const MouseEvent& e)
12001197
12011198void MousePad::mouseMove (const MouseEvent& e)
12021199{
1203- if (!getScreenBounds ().contains (e.getScreenPosition ())) return ;
1200+ if (!getScreenBounds ().contains (e.getScreenPosition ()) || !isLocked ) return ;
12041201
12051202 auto * x = static_cast <t_pad*>(gui.getPointer ());
12061203 t_atom at[3 ];
@@ -1229,6 +1226,10 @@ void MousePad::mouseUp(const MouseEvent& e)
12291226 outlet_anything (x->x_obj .ob_outlet , gensym (" click" ), 1 , at);
12301227}
12311228
1229+ void MousePad::lock (bool locked) {
1230+ isLocked = locked;
1231+ }
1232+
12321233MouseComponent::MouseComponent (const pd::Gui& gui, Box* box) : GUIComponent(gui, box)
12331234{
12341235 Desktop::getInstance ().addGlobalMouseListener (this );
@@ -1286,6 +1287,8 @@ KeyboardComponent::KeyboardComponent(const pd::Gui& gui, Box* box) : GUIComponen
12861287
12871288 state.addListener (this );
12881289 addAndMakeVisible (keyboard);
1290+
1291+ box->restrainer .setSizeLimits (50 , 150 , 1200 , 1200 );
12891292}
12901293
12911294void KeyboardComponent::resized ()
0 commit comments