View Single Post
Old 01-04-2013, 05:59 AM   #4
olilarkin
Human being with feelings
 
Join Date: Apr 2009
Location: Berlin, Germany
Posts: 1,248
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 | Endless Series | iPlug2 | Linkedin | Facebook
olilarkin is offline   Reply With Quote