COCKOS
CONFEDERATED FORUMS
Cockos : REAPER : NINJAM : Forums
Forum Home : Register : FAQ : Members List : Search :
Prev Previous Post   Next Post Next
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
 

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 06:52 PM.


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