ATVO by Appgineering
Download
Read-only

INPUT Label

5 posts 3,172 views Started 02 Jun 2020, 08:35
Showing 1–5 of 5 posts
Emmanuel S.
Original poster

Just to say if you want to use INPUT label to do something with a script.
When you create a INPUT Label, there is no text inside and if you check with script if text label = "" it doesn't work.
It is only because the information in XML no exist before you write anything in INPUT label. Then if you clear your label you can check if INPUT Label = "" and it is ok.
Perhaps Nick could add this empty information in Input Label definition at the begining.
;)

Nick Thissen Appgineering
Reply #1

Sorry, not clear what you mean. You're saying you cannot check the Text of an Input before you put any text in it? That doesn't seem right.

Emmanuel S.
Reply #2
· edited

Just impossible to check on a new widget if the text is empty, but on control you see it empty.
Only because not exist in XML, first you can control, second get text, and third just create and not possible to check.
3 differnt exemple below

<Inputs>
    <ControlInput _TypeName="ATVO.ThemeEditor.ThemeModels.ControlInput" BorderColor="#FFCCCCCC" BorderThickness="1,1,1,1" IsLocked="False" Left="225" Top="60" Width="165" Height="30" ZIndex="0" FontColor="#FFFFFFFF" Name="I_serie_name">
      <Text></Text>
      <BackgroundColor>#FF252525</BackgroundColor>
    </ControlInput>
    <ControlInput _TypeName="ATVO.ThemeEditor.ThemeModels.ControlInput" BorderColor="#FFCCCCCC" BorderThickness="1,1,1,1" IsLocked="False" Left="450" Top="30" Width="120" Height="30" ZIndex="0" FontColor="#FFFFFFFF" Name="I_entete_#">
      <Text>#lamotors</Text>
      <BackgroundColor>#FF252525</BackgroundColor>
    </ControlInput>
    <ControlInput _TypeName="ATVO.ThemeEditor.ThemeModels.ControlInput" BorderColor="#FFCCCCCC" BorderThickness="1,1,1,1" IsLocked="False" Left="0" Top="0" Width="120" Height="30" ZIndex="0" FontColor="#FFFFFFFF" Name="Input1">
      <BackgroundColor>#FF252525</BackgroundColor>
    </ControlInput>
  </Inputs>
Nick Thissen Appgineering
Reply #3

Whether the XML element exists or not should not matter. If it does not exist the text will remain empty, but you can still compare with the regular check, such as:

var input = item.Theme.ControlInputs.Find("Input1");
if (string.IsNullOrWhiteSpace(input.Text))
{
    // empty
}
Archive · Read-only

New replies have moved to Discord.