COCKOS
CONFEDERATED FORUMS
Cockos : REAPER : NINJAM : Forums
Forum Home : Register : FAQ : Members List : Search :

Go Back   Cockos Incorporated Forums > Other Software Discussion > WDL users forum

Reply
 
Thread Tools Display Modes
Old 11-15-2015, 11:15 AM   #1
Andi!
Human being with feelings
 
Andi!'s Avatar
 
Join Date: Nov 2015
Location: Germany
Posts: 82
Default GUI Resizing and parameter values loss

When resizing the gui like it is shown in the IPlugGUIResize example, attached controls are automatically deleted. So after resizing you have to attach all the controls again. But the values and default values stored in the controls are also lost during deletion. When attaching the controls again, the true parameter values don't match the values stored in the control (mValue / mDefaultValue) resulting in a strange behaviour in the gui. I solved it by adding the below code to the IControl constructor. Maybe it would be helpful to add this to the "wdl-ol" ?

Thanks.

Code:
  IControl(IPlugBase* pPlug, IRECT pR, int paramIdx = -1, IChannelBlend blendMethod = IChannelBlend::kBlendNone)
    : mPlug(pPlug), mRECT(pR), mTargetRECT(pR), mParamIdx(paramIdx), mValue(0.0), mDefaultValue(-1.0),
      mBlend(blendMethod), mDirty(true), mHide(false), mGrayed(false), mDisablePrompt(true), mDblAsSingleClick(false),
      mClampLo(0.0), mClampHi(1.0), mMOWhenGreyed(false), mTextEntryLength(DEFAULT_TEXT_ENTRY_LEN), 
      mValDisplayControl(0), mNameDisplayControl(0), mTooltip("")
  {
	  if (paramIdx > -1) {
		  IParam *par = GetParam();
		  if (par) {
			  mValue = par->GetNormalized();
			  mDefaultValue = par->GetDefaultNormalized();
		  }
	  }
  }
Andi! is offline   Reply With Quote
Old 12-01-2015, 05:54 AM   #2
jack461
Human being with feelings
 
jack461's Avatar
 
Join Date: Nov 2013
Location: France
Posts: 181
Default Why are controls deleted ?

Is there a reason why controls are deleted when resizing the plugin window ? It takes a lot of work to save and restore all the stuff associated to the controls...
jack461 is offline   Reply With Quote
Old 01-28-2016, 01:30 PM   #3
Andi!
Human being with feelings
 
Andi!'s Avatar
 
Join Date: Nov 2015
Location: Germany
Posts: 82
Default

Good question. I know that the drawing bitmaps are deleted and reallocated during resizing. I tried to deactivate the new allocation but that resulted in undefined dumps when the Thread is in a drawing method for a WM_PAINT-Message, but it worked for some time... :-)
Andi! 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 12:04 AM.


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