XWidgetSoft Forum https://www.bbs.xwidget.com/ |
|
Relationship between widgets https://www.bbs.xwidget.com/viewtopic.php?f=8&t=3619 |
Page 1 of 1 |
Author: | Armando [ October 8th, 2013, 3:41 pm ] |
Post subject: | Relationship between widgets |
Can I push a button on a widget "A" to produce an effect in a widget "B"? How would the code for it? I want, by pressing the 1 button on the widget "A" all these things occur in the Widet "B" Code: function button1OnClick(Sender)
{ Text23.text = edit1.Text; sleep(500); logo.moveTo(99,209,1,1,8); image1.moveTo(177,0,1,2,8); sleep(1000); image4.ScaleTo(1.8,1.8,2,0,1,9) image4.MoveTo(-210,22,1,1,9) sleep(500); box1.moveTo(193,73,1,1,8); } |
Author: | meme [ October 8th, 2013, 7:44 pm ] |
Post subject: | Re: Relationship between widgets |
Messages can be sent from one widget to another, I do something similar with a pop up calender, parts of the code are below, hope this helps. // send messages to the remote widget msg("close","YearCalendar") msg("hide","YearCalendar") msg("show","YearCalendar") //Message code in the remote widget function widgetOnMsg(MsgString) { if(MsgString=="close") // remote close { close(); } if(MsgString=="hide") // remote hide { widget.visible=false; } if(MsgString=="show") // remote show { yearOnClick() widget.visible=true; } |
Author: | Armando [ October 9th, 2013, 3:34 am ] |
Post subject: | Re: Relationship between widgets |
Excelent!!!!! thanks!!! If you could upload the two widgets you made, would be great! Thanks again meme!! BTW: your code for "blur" works great! |
Author: | Armando [ October 9th, 2013, 7:52 am ] |
Post subject: | Re: Relationship between widgets |
I wrote all the code in both widgets ... but I can not make them work! ... An example: Main widget: function button2OnClick(Sender) { Msg("uptext","remotewidget"); } (NB: "remotewidget" is the name of the folder where the remote widget is. Should I wrothe the full path?) Remote widget: function widgetOnMsg(MsgString) { if(MsgString=="uptext") // reduce nombre 1 punto { text1.Font.Size = text1.Font.Size +1; } } Which is what I'm doing wrong? what am I missing? SOLVED!!! I needed to add "widgetOnMsg" in attribute "OnMsg" in "Functions (widget)" |
Page 1 of 1 | All times are UTC - 8 hours |
Powered by phpBB® Forum Software © phpBB Group http://www.phpbb.com/ |