GUI Messages
#1
I noticed that their are different ways to set values in a control ? One is to use messages and the other to set it directly via class:

controlradiobutton.cpp:- all values are set directly

Code:
PyGUILock();
    if (self->pGUIControl)
    {
      ((CGUIRadioButtonControl*)self->pGUIControl)->PythonSetLabel(
        self->strFont, self->strText, self->dwTextColor, self->dwShadowColor, self->dwFocusedColor );
      ((CGUIRadioButtonControl*)self->pGUIControl)->PythonSetDisabledColor(self->dwDisabledColor);
    }
    PyGUIUnlock();


controltextbox.cpp:- all values are set using messages

Code:
// create message
    ControlTextBox *pControl = (ControlTextBox*)self;
    CGUIMessage msg(GUI_MSG_LABEL_SET, pControl->iParentId, pControl->iControlId);
    msg.SetLabel(strText);

    // send message
    PyGUILock();
    if (pControl->pGUIControl) pControl->pGUIControl->OnMessage(msg);

Which way do you guys recommend ?

I am trying to update TextControl so that it can display passwords with *. I plan to modify GuiTextBox::Render to check for flag and display text as * if set.
Reply

Logout Mark Read Team Forum Stats Members Help
GUI Messages0