File MIES_Utilities_GUI.ipf

utility functions for GUI

Functions

variable IsWaveDisplayedOnGraph(string win, WaveOrNull wv = defaultValue, dfref dfr = defaultValue)

Check if a given wave, or at least one wave from the dfr, is displayed on a graph.

Returns:

one if one is displayed, zero otherwise

variable KillCursorInGraphs(string graphs, string cursorName)

Kill all cursors in a given list of graphs.

Parameters:
  • graphs – semicolon separated list of graph names

  • cursorName – name of cursor as string

string FindCursorInGraphs(string graphs, string cursorName)

Find the first match for a given cursor in a list of graph names.

Parameters:
  • graphs – semicolon separated list of graph names

  • cursorName – name of cursor as string

Returns:

graph where cursor was found

variable GetCursorXPositionAB(string graph, variable *csrAx, variable *csrBx)

get the x value of the cursors A and B

Todo:

make this a generic cursor getter function and merge with cursors() in

See also

SF_FormulaExecutor

Parameters:
  • graph[in] where the cursor are

  • csrAx[out] Position of cursor A

  • csrBx[out] Position of cursor B

variable RemoveAnnotationsFromGraph(string graph)

Removes all annotations from the graph.

string UniqueTraceName(string graph, string baseName)

Return a unique trace name in the graph.

Remember that it might be necessary to call DoUpdate if you added possibly colliding trace names in the current function run.

Parameters:
  • graph – existing graph

  • baseName – base name of the trace, must not be empty

variable GetMarkerSkip(variable numPoints, variable numMarkers)

Calculate the value for mskip of ModifyGraph

Parameters:
  • numPoints – number of points shown

  • numMarkers – desired number of markers

variable KillWindows(string list)

Kill all passed windows.

Silently ignore errors.

string GetAllAxesWithOrientation(string graph, variable axisOrientation)

Return all axes with the given orientation.

Parameters:
variable GetNumFromModifyStr(string info, string key, string listChar, variable item)

Polished version of GetNumFromModifyStr from Readback ModifyStr.ipf

Parameters:
  • info – string as returned by AxisInfo or TraceInfo

  • key – keyword

  • listChar – empty, { or ( depending on keyword style

  • item – return the given element from the extracted list

string SortAxisList(string graph, string list)

Return the list of axis sorted from highest to lowest starting value of the axisEnab keyword.

list must be from one orientation, usually something returned by GetAllAxesWithOrientation()

variable GetPlotArea(string win, RectD *s)
std::tuple<RGBAColor> ParseColorSpec(string str)

Parse a color specification as used by ModifyGraph having an optionl translucency part.

variable StoreCurrentPanelsResizeInfo(string panel)

If the layout of an panel was changed, this function calls the ResizeControlsPanel module functions of the Igor Pro native package to store the changed resize info. The originally intended way to do this was through the Packages GUI, which is clunky for some workflows.

variable GetNotebookCRC(string win)

Return the CRC of the contents of the plain/formatted notebook.

Takes into account formatting but ignores selection.

string FormatTextWaveForLegend(WaveText input)

Format the 2D text wave into a string usable for a legend.

variable IsValidTraceLineStyle(variable lineStyleCode)

Checks if given lineStyle code is valid (as of Igor Pro 9)

Parameters:

lineStyleCode – line style code value for a trace

Returns:

1 if valid, 0 otherwise

variable IsValidTraceDisplayMode(variable traceDisplayCode)

Checks if given trace display code is valid (as of Igor Pro 9)

Parameters:

traceDisplayCode – line style code value for a trace

Returns:

1 if valid, 0 otherwise

variable UpdateInfoButtonHelp(string win, string ctrl, string content)

Update the help and user data of a button used as info/copy button.

variable HorizExpandWithVisX()

Custom graph marquee.

Requires an existing marquee and a graph as current top window

variable EquallySpaceAxis(string graph, string axisRegExp = defaultValue, variable axisOffset = defaultValue, variable axisOrientation = defaultValue, variable sortOrder = defaultValue, string listForBegin = defaultValue, string listForEnd = defaultValue)

Space the matching axis in an equal manner.

Parameters:
  • graph – graph

  • axisRegExp – [optional, defaults to “.*”] regular expression matching the axes names

  • axisOffset – [optional, defaults to 0] offset of first axis in parts of total width

  • axisOrientation – [optional, defaults to all] allows to apply equalization to all axis of one orientation

  • sortOrder – [optional, defaults to no sorting (NaN)] apply different sorting schemes to list of axes, see sortingOrder parameter of SortList

  • listForBegin – [optional, defaults to an empty list] list of axes to move to the front of the sorted axis list

  • listForEnd – [optional, defaults to an empty list] list of axes to move to the end of the sorted axis list

variable EquallySpaceAxisPA(string graph, string allAxes, string distAxes, variable axisOffset = defaultValue)

This is a light weight adapted version of.

See also

EquallySpaceAxis It allows to give a list of distAxes that do not require to exist. Non-existing axes are taken into account on the distribution, but are skipped when the graph is accessed. Also removing images from a graph does not update AxisList until the graph is updated, so we can not rely on Axislist here as we do the Layout after pending changes So with allAxes = “1;2;3;4;” and distAxes = “2;3;” axis 2 and 3 are set at 25% to 50% and 50% to 75% respectively.

Parameters:
  • graph[in] Name of graph where axes from distAxes list exist

  • allAxes[in] List of all axes, that should be distributed. May include non-existing axes.

  • distAxes[in] List of axes that are distributed. Only axes that appear in allAxes as well are modified.

  • axisOffset[in] [optional, default = 0] offset between 0 and 1 where distribution starts.

variable RemoveFreeAxisFromGraph(string graph)

Remove all free axis from the given graph.

variable RemoveDrawLayers(string graph)

Remove all draw layers from the graph.

variable RemoveTracesFromGraph(string graph, string trace = defaultValue, WaveOrNull wv = defaultValue, dfref dfr = defaultValue)

Remove traces from a graph.

Only one of trace/wv/dfr may be supplied.

Parameters:
  • graph – graph

  • trace – [optional, default: all] remove the given trace only

  • wv – [optional, default: ignored] remove all traces which stem from the given wave

  • dfr – [optional, default: ignored] remove all traces which stem from one of the waves in dfr

variable AddVersionToPanel(string win, variable version)

Add user data “panelVersion” to the panel.

variable HasPanelLatestVersion(string win, variable expectedVersion)

Return 1 if the panel is up to date, zero otherwise.

variable GetPanelVersion(string win)

Get the user data “panelVersion”.

Parameters:

win – panel window as string

Returns:

numeric panel version greater 0 and -1 if no version is present or -2 if the windows does not exist

variable ToggleCheckBoxes(string win, string checkBoxIn, string checkBoxPartner, variable checkBoxInState)

Places paired checkboxes in opposite state.

Parameters:
  • win – window name

  • checkBoxIn – ctrl checkbox ex. cba.ctrlName

  • checkBoxPartner – checkbox that will be placed in opposite state

  • checkBoxInState – state of the ctrl checkbox

variable EqualizeCheckBoxes(string win, string checkBoxIn, string checkBoxPartner, variable checkBoxInState)

Placed paired checkboxes in same state.

Parameters:
  • win – window name

  • checkBoxIn – ctrl checkbox ex. cba.ctrlName

  • checkBoxPartner – checkbox that will be placed in the same state

  • checkBoxInState – state of the ctrl checkbox