Hello Guest it is March 28, 2024, 06:18:56 PM

Author Topic: scr.****************** (Screen Calls) List and example..........  (Read 7747 times)

0 Members and 1 Guest are viewing this topic.

Offline poppabear

*
  • *
  •  2,235 2,235
  • Briceville, TN, USA
    • View Profile
Here is the current list of working (and recommended) scr.calls...
NOTE: The Button click, down, up, and mdiexe calls do work but they have all been
replaced by newer/better ways to get-to/do those things. So, those calls are NOT shown here.
You can place this code into you lua scripter and put a stop debug break point on each line,
to see how it works and you can mouse over the returned values.

Code: [Select]
function test()
    local mInst         = 0;
    local inst          = mc.mcGetInstance(mInst);
    local NumValue      = 0;
    local StringValue   = "";
    local BoolValue     = false;
 
    --Goto a Page, ("Default" in the wxMach set is the only page at this time),
--it is considered page "0", all after that would be 1, ...
    scr.ShowPage("Default");--"PageName"     

    --Get the Button Up color property, i.e. "Green"(hex value) of the enable button
    StringValue = scr.GetProperty("tbutton2", "Button Color Up");--"ControlName", "PropertyName"
    --Set the blink rate of the up state of enable button to 250
    scr.SetProperty("tbutton2", "Blink Rate Up", "250");--"ControlName", "PropertyName", "Value"
    --Set the blink rate of the up state of enable button back to 500
    scr.SetProperty("tbutton2", "Blink Rate Up", "500");--"ControlName", "PropertyName", "Value"

    --Get the current "Page" number that your on 0 to ##
    StringValue = scr.GetCurrentPage();--no param
    --Does the named control exist in the set (True)?
    BoolValue   = scr.IsControl("tbutton2");--"ControlName"
    --Does the Property of the named control exist (false)?
    BoolValue   = scr.IsProperty("tbutton2", "CrashAll");--"ControlName", "PropertyName" 

--[[
NOTE: scr.ButtonClick, ButtonDown, ButtonUp, ExecMdi; These calls STILL work, BUT!!!! Steve says that
they are the MUCH outdated and older way, and ONLY kept for compatibility for some dark age Mach4 screens.....
These types of functions have all been replaced by mc.calls, or get/set properties... in other words
Use the newer, easier to use stuff!!!
--]]
end

if (mc.mcInEditor() == 1) then
    test();
end

PS. Thanks to Steve Murphy, for the heads up on the old stuff!! And help in general,

Scott
fun times

Offline simpson36

*
  •  1,369 1,369
    • View Profile
Re: scr.****************** (Screen Calls) List and example..........
« Reply #1 on: March 10, 2015, 05:31:03 PM »
Scott,

The comment in your code states that some number of scr.********* functions have been replaced by new mc.*********

So, what are the new functions  ???

Offline poppabear

*
  • *
  •  2,235 2,235
  • Briceville, TN, USA
    • View Profile
Re: scr.****************** (Screen Calls) List and example..........
« Reply #2 on: March 10, 2015, 05:38:21 PM »
ah, look in the mc.mc.... document, and the get/setproperties calls do alot of things as well. There is a copy of the down and dirty, and the mc.mc calls list that goes into it in the toolbox. Take a read down the list, since it will depend on what your wanting to do.

scott
fun times

Offline simpson36

*
  •  1,369 1,369
    • View Profile
Re: scr.****************** (Screen Calls) List and example..........
« Reply #3 on: March 10, 2015, 06:42:57 PM »
The Down and Dirty shows the use of scr.*********xx

Been there done that.

In the LuaCalls.txt document there are no functions that even contain the word 'prop'.

So not sure what to look for from here . . .

Offline dude1

*
  •  1,253 1,253
    • View Profile
Re: scr.****************** (Screen Calls) List and example..........
« Reply #4 on: March 10, 2015, 08:14:41 PM »
in lua you get a option drop down as you are typing that you can go through there`s a way to make it come up cant rember how but poppabear know`s the call you wont may be there