XWidgetSoft Forum

XWidget & XLaunchpad , Desktop customization
It is currently May 7th, 2025, 11:00 am

All times are UTC - 8 hours




Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: September 5th, 2017, 6:31 am 
Offline
User avatar

Joined: July 29th, 2013, 9:13 am
Posts: 609
Functions can exist within other functions within javascript. Code is typically structured so that it is 'tabbed' or indented to show its relationship to the parent function. This is perfectly valid in normal code and the indentation helps to show the function is solely operative within the context of the parent function. However, in Xwidget some functions are not recognised as being valid when indented or tabbed in code.

It specifically applies to Xwidget's own functions, note the following function is tabbed to the right and has 5 spaces prior to the function declaration.:

Code:
     
     function BottomHelpOnMouseDown(Sender,Button,Shift,X,Y)
     {
           if (preferencesSoundPref.text === "enable") {
                    playSound(pageFumble);
           }
           TopHelp.opacity = 0;
           BottomHelp.opacity = 0;
     };



These non-standard Xwidget function definitions (those created automatically with the Xwidget IDE, typically identified with the extra Sender,Button,Shift,X,Y variable information passed to the function), the function declaration must be at column position 1 for the IDE to know the function exists and to recognise it in your program. If they are indented the engine does not recognise them.

The effect of this bug is that if you have tabbed or indented onEvent functions based solely within other functions, after you convert your standard javascript code to Xwidget these type of functions may no longer be accessible. You will have to untab them and restore their position to column 1.

However, do note this does not apply to standard jscript functions as shown here:

Code:
          function getListing(path) {
                        pathString = getFileList(path,validTypes,false);
                        // convert to array
                        var paths = pathString.split('|');
                        for(var i = 0; i < paths.length; i++)
          .
          .
          .
          }


The above indented function is valid for both jscript and Xwidgets, only the indented Xwidget function is not recognised. That is the bug that needs to be fixed.


Last edited by yereverluvinuncleber on September 6th, 2017, 12:19 am, edited 1 time in total.

Top
 Profile  
 
PostPosted: September 5th, 2017, 8:12 am 
Offline
User avatar

Joined: July 29th, 2013, 9:13 am
Posts: 609
Jim, please feel free to test but I suspect you'd rather not. Just take my word for it that this is a bug and enter it into the list please.

Basically, indenting some code should not stop it being recognised.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 8 hours


Who is online

Users browsing this forum: Google [Bot] and 28 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Powered by phpBB® Forum Software © phpBB Group