Jump to content


Photo

Button() and Label(), PLi opinion.


  • Please log in to reply
465 replies to this topic

Re: Button() and Label(), PLi opinion. #281 nautilus7

  • Senior Member
  • 229 posts

+6
Neutral

Posted 1 February 2018 - 01:51

And satdreamgr for sure!



Re: Button() and Label(), PLi opinion. #282 IanSav

  • PLi® Contributor
  • 1,491 posts

+51
Good

Posted 1 February 2018 - 02:28

Hi Nautilus,

 

No, they are not. Changes are required to a few screens that the button names changed. For example few screens used a button named "cancel" and this changed to "key_red".

 

 

 

If you want to automate your code and not have to think about buttons again, you can use the new feature. Look here how to use it: https://github.com/l...mplates.xml#L87

 

If you don't use png icons for your buttons, you can just put something like the following into your skin templates, and remove all buttons from each screen you have.

    <screen name="Buttons">
        <widget objectTypes="key_red,Button,Label" name="key_red" position="0,810" size="320,70" backgroundColor="transpBA" font="Button" halign="center" valign="center" zPosition="1" transparent="1"/>
        <widget objectTypes="key_green,Label,Button" name="key_green" position="320,810" size="320,70" backgroundColor="transpBA" font="Button" halign="center" valign="center" zPosition="1" transparent="1"/>
        <widget objectTypes="key_yellow,Label,Button" name="key_yellow" position="640,810" size="320,70" backgroundColor="transpBA" font="Button" halign="center" valign="center" zPosition="1" transparent="1"/>
        <widget objectTypes="key_blue,Label,Button" name="key_blue" position="960,810" size="320,70" backgroundColor="transpBA" font="Button" halign="center" valign="center" zPosition="1" transparent="1"/>

        <widget objectTypes="key_red,StaticText" source="key_red" render="Label" position="0,810" size="320,70" backgroundColor="transpBA" font="Button" halign="center" valign="center" zPosition="1" transparent="1"/>
        <widget objectTypes="key_green,StaticText" source="key_green" render="Label" position="320,810" size="320,70" backgroundColor="transpBA" font="Button" halign="center" valign="center" zPosition="1" transparent="1"/>
        <widget objectTypes="key_yellow,StaticText" source="key_yellow" render="Label" position="640,810" size="320,70" backgroundColor="transpBA" font="Button" halign="center" valign="center" zPosition="1" transparent="1"/>
        <widget objectTypes="key_blue,StaticText" source="key_blue" render="Label" position="960,810" size="320,70" backgroundColor="transpBA" font="Button" halign="center" valign="center" zPosition="1" transparent="1"/>
    </screen>

Are you sure that the "key_[red|green|yellow|blue]" items should be in the "objectTypes" list?  Is this a way of avoiding the use of the "conditional=" attribute?

 

Regards,

Ian.


Edited by IanSav, 1 February 2018 - 02:29.


Re: Button() and Label(), PLi opinion. #283 nautilus7

  • Senior Member
  • 229 posts

+6
Neutral

Posted 1 February 2018 - 02:39

If you want the png to disappear when the button text is empty you need StaticText(), i.e.

self["key_blue"] = StaticText(_("Select all"))

 

 

You've always been able to hide/show the PNG. Nothing new about this.

 

 

Label cannot do the same... as you need a source 'class' to couple the button with the text and Label is no source 'class'... 

 

 

I am again confused about whether both Label() and StaticText() can hide the button png automatically...  :unsure:

 


I tried the code from skin-PliHD

  <screen name="ButtonRed">
    <widget objectTypes="key_red,StaticText" source="key_red" render="Pixmap" pixmap="PLi-FullHD/buttons/red.png" position="192,1032" size="34,34" zPosition="1" alphatest="blend">
      <convert type="ConditionalShowHide"/>
    </widget>
    <ePixmap objectTypes="key_red,Button,Label" pixmap="PLi-FullHD/buttons/red.png" position="192,1032" size="34,34" zPosition="1" alphatest="blend"/>
  </screen>

And found that both Label() and StaticText() buttons are able to show and hide the png. Is this correct?



Re: Button() and Label(), PLi opinion. #284 nautilus7

  • Senior Member
  • 229 posts

+6
Neutral

Posted 1 February 2018 - 02:41

Hi Nautilus,

 

No, they are not. Changes are required to a few screens that the button names changed. For example few screens used a button named "cancel" and this changed to "key_red".

 

 

 

If you want to automate your code and not have to think about buttons again, you can use the new feature. Look here how to use it: https://github.com/l...mplates.xml#L87

 

If you don't use png icons for your buttons, you can just put something like the following into your skin templates, and remove all buttons from each screen you have.

    <screen name="Buttons">
        <widget objectTypes="key_red,Button,Label" name="key_red" position="0,810" size="320,70" backgroundColor="transpBA" font="Button" halign="center" valign="center" zPosition="1" transparent="1"/>
        <widget objectTypes="key_green,Label,Button" name="key_green" position="320,810" size="320,70" backgroundColor="transpBA" font="Button" halign="center" valign="center" zPosition="1" transparent="1"/>
        <widget objectTypes="key_yellow,Label,Button" name="key_yellow" position="640,810" size="320,70" backgroundColor="transpBA" font="Button" halign="center" valign="center" zPosition="1" transparent="1"/>
        <widget objectTypes="key_blue,Label,Button" name="key_blue" position="960,810" size="320,70" backgroundColor="transpBA" font="Button" halign="center" valign="center" zPosition="1" transparent="1"/>

        <widget objectTypes="key_red,StaticText" source="key_red" render="Label" position="0,810" size="320,70" backgroundColor="transpBA" font="Button" halign="center" valign="center" zPosition="1" transparent="1"/>
        <widget objectTypes="key_green,StaticText" source="key_green" render="Label" position="320,810" size="320,70" backgroundColor="transpBA" font="Button" halign="center" valign="center" zPosition="1" transparent="1"/>
        <widget objectTypes="key_yellow,StaticText" source="key_yellow" render="Label" position="640,810" size="320,70" backgroundColor="transpBA" font="Button" halign="center" valign="center" zPosition="1" transparent="1"/>
        <widget objectTypes="key_blue,StaticText" source="key_blue" render="Label" position="960,810" size="320,70" backgroundColor="transpBA" font="Button" halign="center" valign="center" zPosition="1" transparent="1"/>
    </screen>

Are you sure that the "key_[red|green|yellow|blue]" items should be in the "objectTypes" list?  Is this a way of avoiding the use of the "conditional=" attribute?

 

Regards,

Ian.

See here https://github.com/l...plates.xml#L117

 

The conditional is needed for the png only. The above code is only for the text part.


Edited by nautilus, 1 February 2018 - 02:42.


Re: Button() and Label(), PLi opinion. #285 IanSav

  • PLi® Contributor
  • 1,491 posts

+51
Good

Posted 1 February 2018 - 02:55

Hi Nautilus,

 

Thank you for the confirmation.  The code is changing so fast I sometimes miss some of the details.  :)

 

Regards,

Ian.



Re: Button() and Label(), PLi opinion. #286 Rob van der Does

  • Senior Member
  • 7,766 posts

+184
Excellent

Posted 1 February 2018 - 04:19

OK, got it! I am going to try it on my skin now, presumably only OpenPLI has these changes as of yet!

Naah, look who started this discussion......

Although ViX has a slightly different approach, the two might merge in the near future.



Re: Button() and Label(), PLi opinion. #287 littlesat

  • PLi® Core member
  • 56,951 posts

+695
Excellent

Posted 1 February 2018 - 07:44

Also the temperature plug-ins itself need to change. It Will not crash, you do not see the buttons (correctly). I recommend vix should merge (as I made it with the last change even more consequent and note that may take Some time).
Taken it from the action map for menu/info can be considered. It might be helpfull if someone helps me to invertigate if this might work. But for now I prefer to use a dictionary key, with a conditional check in the skin. (I’m stil doubting what might be better)

Edited by littlesat, 1 February 2018 - 07:50.

WaveFrontier 28.2E | 23.5E | 19.2E | 16E | 13E | 10/9E | 7E | 5E | 1W | 4/5W | 15W


Re: Button() and Label(), PLi opinion. #288 Huevos

  • PLi® Contributor
  • 4,593 posts

+160
Excellent

Posted 1 February 2018 - 14:30

Quick question! Are the new buttons changes incompatible with the classic skin format? Will the screens begin to crash now?

Any examples on how we can write the new template on a skin.xml?

No they won't crash. The whole point was finding something backwards compatible.

 

But if people rush into making changes here, there, and everywhere in the python codes the older skins will be broken anyway, which is why I recommended taking a pause before rushing into python changes like some people seem to want to do.



Re: Button() and Label(), PLi opinion. #289 Huevos

  • PLi® Contributor
  • 4,593 posts

+160
Excellent

Posted 1 February 2018 - 14:36

And if you are rushing to add a new name do it so it is backwards compatible. i.e.

self["new_name"] = self["old_name"] = StaticText(_("my label"))


Re: Button() and Label(), PLi opinion. #290 littlesat

  • PLi® Core member
  • 56,951 posts

+695
Excellent

Posted 1 February 2018 - 16:48

Can be done..(and it already exists in some places).... but not preferable


WaveFrontier 28.2E | 23.5E | 19.2E | 16E | 13E | 10/9E | 7E | 5E | 1W | 4/5W | 15W


Re: Button() and Label(), PLi opinion. #291 Rob van der Does

  • Senior Member
  • 7,766 posts

+184
Excellent

Posted 1 February 2018 - 17:40

Can be done..(and it already exists in some places).... but not preferable

If not 'preferable': who's going to change all the affected skins when you make a 'preferred' change? Should be done simultaneous........



Re: Button() and Label(), PLi opinion. #292 littlesat

  • PLi® Core member
  • 56,951 posts

+695
Excellent

Posted 1 February 2018 - 17:46

The skinners?’sounds you Touch the point that we somehow are stuck at the history.. Some screens now already need fixes for proper Display on Some screens

WaveFrontier 28.2E | 23.5E | 19.2E | 16E | 13E | 10/9E | 7E | 5E | 1W | 4/5W | 15W


Re: Button() and Label(), PLi opinion. #293 nautilus7

  • Senior Member
  • 229 posts

+6
Neutral

Posted 1 February 2018 - 19:17

Well, that's why there are versions. There was openpli 1, 2, 3, 4, 5, 6. There will be openpli 7 someday.

 

A skin or a plugin might be compatible with openpli 6, but this does NOT mean that it will compatible with openpli 7.


Edited by nautilus7, 1 February 2018 - 19:20.


Re: Button() and Label(), PLi opinion. #294 Huevos

  • PLi® Contributor
  • 4,593 posts

+160
Excellent

Posted 1 February 2018 - 19:38

Well, that's why there are versions. There was openpli 1, 2, 3, 4, 5, 6. There will be openpli 7 someday.

 

A skin or a plugin might be compatible with openpli 6, but this does NOT mean that it will compatible with openpli 7.

While I agree with this... who ever heard of backward compatibility being one week. Seriously.

 

My suggestion is leave the old names for a while and just add new names. After a couple of months remove the old names. This gives the skinners time to catch up. After that time delete the old names, and start switching some Button and Label objects to StaticText. But in my opinion it is not fair to just break everyone's skins, especially when some skins are shared between images.



Re: Button() and Label(), PLi opinion. #295 IanSav

  • PLi® Contributor
  • 1,491 posts

+51
Good

Posted 2 February 2018 - 01:25

Hi Huevos,

 

Well, that's why there are versions. There was openpli 1, 2, 3, 4, 5, 6. There will be openpli 7 someday.

 

A skin or a plugin might be compatible with openpli 6, but this does NOT mean that it will compatible with openpli 7.

While I agree with this... who ever heard of backward compatibility being one week. Seriously.

 

My suggestion is leave the old names for a while and just add new names. After a couple of months remove the old names. This gives the skinners time to catch up. After that time delete the old names, and start switching some Button and Label objects to StaticText. But in my opinion it is not fair to just break everyone's skins, especially when some skins are shared between images.

 

I believe that there also needs to be some publicity telling coders and skinners about the changes.  There should also be some documentation to assist everyone in adjusting their code to best match the new standards.  The documentation should also explain what all the new options are and how best to take advantage of the new / smarter facilities.

 

I am suggesting something like the date and time manual I wrote for the new date and time options I developed for Beyonwiz and OpenViX.

 

Regards,

Ian.



Re: Button() and Label(), PLi opinion. #296 Rob van der Does

  • Senior Member
  • 7,766 posts

+184
Excellent

Posted 2 February 2018 - 06:19

The skinners?’sounds you Touch the point that we somehow are stuck at the history.. Some screens now already need fixes for proper Display on Some screens

Yes, indeed: the skinners should update skins. But how much time do you allow them? If you just change a code that makes skins incompatible, you shouldn't be surprised to find skins to be incompatible the next day.

 

And IMHO skins that have not been updated for a considerable period of time should simply be deleted (preferably after having tried to inform the authors about the required changes).

 

And besides: is there any good reason not to make the current changes backwards-compatible? Even for a couple of months?



Re: Button() and Label(), PLi opinion. #297 Dimitrij

  • PLi® Core member
  • 10,190 posts

+346
Excellent

Posted 2 February 2018 - 08:10

Now many buttons are not visible in my skin.
Show an example of the fix in the skin.


GigaBlue UHD Quad 4K /Lunix3-4K/Duo 4K


Re: Button() and Label(), PLi opinion. #298 Rob van der Does

  • Senior Member
  • 7,766 posts

+184
Excellent

Posted 2 February 2018 - 10:14

Now many buttons are not visible in my skin.
Show an example of the fix in the skin.

See https://github.com/l...c8c4f8a6c0f9cfd and https://github.com/l...da9a577993a7061



Re: Button() and Label(), PLi opinion. #299 WanWizard

  • PLi® Core member
  • 69,906 posts

+1,787
Excellent

Posted 2 February 2018 - 10:54

It would not be a bad idea to move legacy classes and functions to separate files (for example in a legacy directory), leave a stub in place to not break the API, and have that stub log a deprecated warning, with a "will be removed in release x.y" text. This is how it is usually done.


Currently in use: VU+ Duo 4K (2xFBC S2), VU+ Solo 4K (1xFBC S2), uClan Usytm 4K Ultimate (S2+T2), Octagon SF8008 (S2+T2), Zgemma H9.2H (S2+T2)

Due to my bad health, I will not be very active at times and may be slow to respond. I will not read the forum or PM on a regular basis.

Many answers to your question can be found in our new and improved wiki.


Re: Button() and Label(), PLi opinion. #300 littlesat

  • PLi® Core member
  • 56,951 posts

+695
Excellent

Posted 2 February 2018 - 11:11

Another thinks... When VIX adapts and OpenATV adapts... all other skins will (should) also adapt... And why not?... it makes the skin.xml easier...


WaveFrontier 28.2E | 23.5E | 19.2E | 16E | 13E | 10/9E | 7E | 5E | 1W | 4/5W | 15W



1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users