Cockos : REAPER : NINJAM : Forums
Forum Home : Register : FAQ : Members List : Search :
Old 04-08-2018, 02:52 PM   #1
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:

IGraphics* pGraphics = MakeGraphics(this, kWidth, kHeight);

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

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

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

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

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

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

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


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
Human being with feelings
olilarkin's Avatar
Join Date: Apr 2009
Location: Huddersfield, UK
Posts: 1,126

IAutoGUI was designed to be used like this...

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

controls on other tabs than are hidden by default here

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

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

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 03:51 PM.

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