COCKOS
CONFEDERATED FORUMS
Cockos : REAPER : NINJAM : Forums
Forum Home : Register : FAQ : Members List : Search :
Old 12-27-2012, 10:57 AM   #1
Grag38
Human being with feelings
 
Join Date: Jun 2010
Posts: 57
Default WDL-OL TEXT ENTRY

I try since few days of using an text entry with WDL-OL without success...

I tried to modify a lot the IPLUGMultiTarget example. It works with values, but no succes to modify an existing text.

My goal is to have un text entry with an default value, and be able to modify it. I plan to use it to enter an IPV4 address.

So from the default address would be : 127.0.0.1 and I would like to modify it to 192.168.11.34

Any help would be nice from some of you.

Best regards.
Grag38 is offline   Reply With Quote
Old 12-27-2012, 05:31 PM   #2
olilarkin
Human being with feelings
 
Join Date: Apr 2009
Location: UK
Posts: 1,213
Default

post your code
__________________
VirtualCZ | pMix | Endless Series | iPlug2 | Linkedin | Facebook
Available for Audio Dev tuition via Skype (IPlug/JUCE/C++)
olilarkin is offline   Reply With Quote
Old 01-04-2013, 04:11 AM   #3
Grag38
Human being with feelings
 
Join Date: Jun 2010
Posts: 57
Default

the question is simple...

Is there into the classes of wdl-ol a simple way of using an entry text ?

My code will be open source when I will decide it runs well.

Thanks.
Grag38 is offline   Reply With Quote
Old 01-04-2013, 05:59 AM   #4
olilarkin
Human being with feelings
 
Join Date: Apr 2009
Location: UK
Posts: 1,213
Default

you need to create a custom IControl to do this. There is one in the IPlugEEL example that does what you want.

Code:
class AlgDisplay : public IControl
{
public:
  AlgDisplay(IPlugBase* pPlug, IRECT pR, IText* pText, const char* str = "127.0.0.1")
  : IControl(pPlug, pR)
  {
    mDisablePrompt = true;
    mText = *pText;
    mStr.Set(str);
  }
  
  ~AlgDisplay() {}

  bool Draw(IGraphics* pGraphics)
  {  
    return pGraphics->DrawIText(&mText, mStr.Get(), &mRECT);
  }
  
  void OnMouseDown(int x, int y, IMouseMod* pMod)
  {
    mPlug->GetGUI()->CreateTextEntry(this, &mText, &mRECT, mStr.Get());
  }
  
  void TextFromTextEntry(const char* txt)
  {
    mStr.Set(txt, MAX_ALG_LENGTH);
    
    //TODO: update alg
    
    SetDirty(false);
  }
  
protected:
  WDL_String mStr;
};
__________________
VirtualCZ | pMix | Endless Series | iPlug2 | Linkedin | Facebook
Available for Audio Dev tuition via Skype (IPlug/JUCE/C++)
olilarkin is offline   Reply With Quote
Old 01-05-2013, 09:58 AM   #5
Grag38
Human being with feelings
 
Join Date: Jun 2010
Posts: 57
Default

Nice.

Thank you very much. I have to spend more time with the understanding of the WDL-OL classes.

Best Regards
Grag38 is offline   Reply With Quote
Old 04-29-2017, 04:59 PM   #6
clau_ste
Human being with feelings
 
Join Date: Apr 2017
Posts: 1
Default

I implemented this control and i found two problems

1. The text is not centered vertically and i can't figure out how to put it at the left of the IRECT

2. How can i get the text of this control if i have a pointer to it? Which function should i call?
clau_ste 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 02:30 PM.


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