COCKOS
CONFEDERATED FORUMS
Cockos : REAPER : NINJAM : Forums
Forum Home : Register : FAQ : Members List : Search :
Old 04-08-2018, 02:52 PM   #1
DJR-DSP
Human being with feelings
 
Join Date: Apr 2018
Location: England
Posts: 2
Default IAutoGUI

Hi, I'm new to this forum, but I've been playing around with WDL for a few years now. Thought I'd join up to ask a few questions that have been bugging me for a while, see how different users tackle similar situations.

First off, I've been trying to build a GUI with some tab panels, with each panel having a unique set of controls. I've tried to implement this using the IAutoGUI class, but when the plugin instantiates, even though the first panel is active, all of the controls for every panel are visible until an OnMouseDown call is received for panel one. Means the GUI is an absolute mess of controls until the panel is clicked...

As an example, I use something like this in my plugin's constructor:

Code:
IGraphics* pGraphics = MakeGraphics(this, kWidth, kHeight);
	pGraphics->AttachPanelBackground(&COLOR_WHITE);

	AGPanelTabs* pPanel = new AGPanelTabs(this, IRECT(10, 10, 300, 300), &mText, &mBGColor, &mFGColor, &mOnColor);
	pGraphics->AttachControl(pPanel);

	const char* pLabel1 = "Tab 1";
	AGTab* pTab1 = new AGTab(IRECT(10, 10, 40, 30), pLabel1);
	pPanel->AddTab(pTab1);

	const char* pLabel2 = "Tab 2";
	AGTab* pTab2 = new AGTab(IRECT(40, 10, 70, 30), pLabel2);
	pPanel->AddTab(pTab2);

	GetParam(kGain1)->InitDouble("Gain 1", 50., 0., 100.0, 0.01, "%");
	GetParam(kGain1)->SetShape(2.);

	GetParam(kGain2)->InitDouble("Gain 2", 50., 0., 100.0, 0.01, "%");
	GetParam(kGain2)->SetShape(2.);

	AGKnobControl* AGKnob1 = new AGKnobControl(this, IRECT(10, 50, 50, 100), kGain1, &mText, &mBGColor, &mFGColor, 15);
	pGraphics->AttachControl(AGKnob1);

	AGKnobControl* AGKnob2 = new AGKnobControl(this, IRECT(50, 50, 90, 100), kGain2, &mText, &mBGColor, &mFGColor, 15);
	pGraphics->AttachControl(AGKnob2);

	pTab1->mParamsToMux.Add(kGain1);
	pTab2->mParamsToMux.Add(kGain2);

	pGraphics->HandleMouseOver(true);
What am I doing wrong?

I have also tried writing a custom OnMouseOut method within IAutoGUI to initialise the first tab as active with controls hidden when first instantiated, but no joy. Maybe I'm just doing something wrong or I just don't get what IAutoGUI is for at all.

I could probably get the task done quicker by adding radio buttons as panels and then hiding the controls individually in OnParamChange, but it doesn't look as neat and ends up being fragmented across the entire plugin .cpp file.

Anybody out there who can shed some light?
DJR-DSP is offline   Reply With Quote
Old 04-10-2018, 03:56 PM   #2
olilarkin
Human being with feelings
 
olilarkin's Avatar
 
Join Date: Apr 2009
Location: Huddersfield, UK
Posts: 1,095
Default

IAutoGUI was designed to be used like this...

https://github.com/olilarkin/wdl-ol/...ortion.cpp#L61

you can see what happens when you press a "tab" button here

https://github.com/olilarkin/wdl-ol/...IAutoGUI.h#L65

controls on other tabs than are hidden by default here

https://github.com/olilarkin/wdl-ol/...AutoGUI.h#L559

IAutoGUI is very old and crap and i will make a new better one soon
__________________
VirtualCZ | pMix | Endless Series | WDL-OL | Linkedin | Facebook
Available for Audio Dev tuition via Skype (IPlug/JUCE/C++)
olilarkin is offline   Reply With Quote
Old 04-15-2018, 10:22 AM   #3
DJR-DSP
Human being with feelings
 
Join Date: Apr 2018
Location: England
Posts: 2
Default

Thanks for the reply, Oli. I was already familiar with its use within the IPlugExamples projects. I just thought I could hack it up a little bit for my own uses, but I guess just hiding and showing params in OnParamChange is the way to go. Look forward to seeing an updated IAutoGUI in the future. I've been following your IPlugQuake branch and can't wait until it's all ready to go!
DJR-DSP is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 01:15 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2018, vBulletin Solutions Inc.