View Full Version : Fast method to show a "settings window"
onqel
01-01-2011, 01:43 PM
Hi
I would like to make a hideable settings window for my plugin, with separate controls(knobs etc) which is spawned/hidden by a button .. I'm not sure where to begin yet so if anyone has a tips please help ;)
RRokkenAudio
01-01-2011, 04:50 PM
Hide everything in your current editor, and SHOW everything in your panel editor. Or if its not the same size, Just show bitmap overlay, and show the knobs that are on your settings editor. I'd prob hide the controls that are behind the ibitmap overlay just for safety... Also, i'd remove any "onmousedown" method from your custom ibitmap overlay control.. and just use the switch to hide/show it. That's how I do it anyway. Good luck
~Rob.
Yes, I also do it that way. Initially hide all controls that are part of the settings window, and add a bitmap to serve as a background for the settings window. Then unide this background as well as all controls to make the settings window appear.
onqel
01-02-2011, 04:55 AM
thanks I will try that!
onqel
01-02-2011, 09:05 PM
Everything is working great except a custom control I've made for drawing a curve.. It disappears when I touch any of the other controls..
I've tried SetDirty() / IsDirty() etc with no luck .. it appears for a split second when touching a knob using this->GetGUI()->SetAllControlsDirty(); ...
It DOES work in my dummy project.. but not now (I've double checked everything and no luck)
RRokkenAudio
01-03-2011, 02:02 AM
try isHit()
Yeah, thats for real iShit lol That will grab focus for whatever is clicked... maybe worth a look..
~Rob.
onqel
01-03-2011, 06:09 AM
my control is 100% "passive", it draws a plot and a vertical line :P what does the IsHit() function do for my control if i implement it? i haven't got home to test it out yet..
what does the IsHit() function do for my control if i implement it?
isHit() is called to see if the mouse cursor is "inside" your control. By default isHit() will return true for the entire rectangle specified by mTargetRECT, but you could override isHit() to return true only for whatever shape you want.
BTW, I don't think isHit() has anything to do with (re)drawing the control.
onqel
01-03-2011, 12:31 PM
No luck here :\
This is my drawing routine (yeah I know it has some potentional rounding errors, and table[] is initialized)
bool IBiasPlot::Draw(IGraphics* pGraphics)
{
IColor color(255, 255, 255, 255);
IColor color2(255, 200, 0, 0);
SetDirty();
for (int i=0; i<m_width; i++)
{
double volt = table[400+(i*8)];
pGraphics->DrawPoint(&color, m_xpos+i, (m_ypos+68)-(volt/7.35), 2, true);
}
double biaspoint = fabs(bias);
pGraphics->DrawLine(&color2,m_xpos+biaspoint, m_ypos, m_xpos+biaspoint, m_ypos+64, 0, true);
return true;
}
the IBiasPlot control pointer is created in the main plugin class to gain access to the control's variables at runtime..
private:
TSE::Amp_X50 * X50;
IBiasPlot *pBiasPlot;
// Attach the BIAS PLOT control
param.fBias = -50.0;
param.fTubeType = 0;
pBiasPlot = new IBiasPlot(this, 198, 21, 100, 68, sPlot);
pBiasPlot->setNewBiasPoint(param.fBias);
pBiasPlot->setTubeType(param.fTubeType);
pGraphics->AttachControl(pBiasPlot);
AttachGraphics(pGraphics);
onqel
01-03-2011, 02:27 PM
fixed by putting "pGraphics->SetAllControlsDirty();" in the Draw method ... :p
vBulletin® v3.8.11, Copyright ©2000-2025, vBulletin Solutions Inc.