Difference between revisions of "VS:VM MoveToLayer"

From VectorMEP
Jump to navigation Jump to search
m
m
 
(8 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
{{DISPLAYTITLE:VS:VM_MoveToLayer}}
 
{{DISPLAYTITLE:VS:VM_MoveToLayer}}
 
 
== Description ==
 
== Description ==
<pre><font color="blue">def</font> vs.AlertQuestion(question, advice, defaultButton, OKOverrideText, CancelOverrideText, customButtonAText, customButtonBText):
+
Procedure VM_MoveToLayer moves the selected objects to a layer.<syntaxhighlight lang="pascal">
    <font color="blue">return</font> INTEGER</pre>
+
PROCEDURE VM_MoveToLayer(
 +
    h    :Handle);
 +
</syntaxhighlight>
 
== Parameters ==
 
== Parameters ==
<dl><dd><table cellpadding="2" border="0"><tr>  <td valign="top">question</td>  <td></td>  <td valign="top">STRING</td>  <td> </td>  <td valign="top">The question to display</td></tr>
+
<dl><dd><table cellpadding="2" border="0"><tr>  <td valign="top">h</td>  <td></td>  <td valign="top">HANDLE</td>  <td> </td>  <td valign="top">Handle to layer.</td></tr></table></dd></dl>
<tr>  <td valign="top">advice</td>  <td></td>  <td valign="top">STRING</td>  <td> </td>  <td valign="top">The text to be added in a smaller font under the main information/message</td></tr>
 
<tr>  <td valign="top">defaultButton</td>  <td></td>  <td valign="top">INTEGER</td>  <td> </td>  <td valign="top">Specifies which button is to be made the default</td></tr>
 
<tr>  <td valign="top">OKOverrideText</td>  <td></td>  <td valign="top">STRING</td>  <td> </td>  <td valign="top">Specifies a string to use in overriding the 'OK' string</td></tr>
 
<tr>  <td valign="top">CancelOverrideText</td>  <td></td>  <td valign="top">STRING</td>  <td> </td>  <td valign="top">Specifies a string to use in overriding the 'Cancel' string</td></tr>
 
<tr>  <td valign="top">customButtonAText</td>  <td></td>  <td valign="top">STRING</td>  <td> </td>  <td valign="top">Specifies a string to use for an optional custom button A</td></tr>
 
<tr>  <td valign="top">customButtonBText</td>  <td></td>  <td valign="top">STRING</td>  <td> </td>  <td valign="top">Specifies a string to use for a second optional custom button B</td></tr></table></dd></dl>
 
 
 
== Return Value ==
 
  
 
== Remarks ==
 
== Remarks ==
 +
When nill is passed as Layer handle, a dialog is presented with a list of all Layers to choose from.
  
 
== Example ==
 
== Example ==
<pre><font color="blue">PROCEDURE</font> Example;
+
<syntaxhighlight lang="pascal">
<font color="blue">BEGIN</font>
+
PROCEDURE MoveToLayer;
AlrtDialog(<font color="green">'AlrtDialog'</font>);
+
VAR
AlertInform(<font color="green">'AlertInform'</font>, <font color="green">'advice'</font>, <font color="blue">FALSE</font>);
+
    h : HANDLE;
AlertCritical(<font color="green">'AlertCritical'</font>, <font color="green">'advice'</font>);
+
BEGIN
Message(YNDialog(<font color="green">'YNDialog'</font>));
+
    h := NIL;  
Message(AlertQuestion(<font color="green">'question'</font>, <font color="green">'advice'</font>, <font color="maroon">1</font>, <font color="green">'ok'</font>, <font color="green">'cancel'</font>, <font color="green">'a'</font>, <font color="green">'b'</font>));
+
    {h := GetObject('LayerName'); in case of predefined layer}
<font color="blue">END</font>;
+
    IF VerifyLibraryRoutine('VM_MoveToLayer') THEN
<font color="blue">RUN</font>(Example);</pre>
+
BEGIN
 +
IF (GetType(h) = 31) OR (h = NIL) THEN VM_MoveToLayer(h);
 +
        End
 +
    ELSE
 +
        Message('The routine VM_MoveToLayer is not available.');
 +
END;
 +
RUN(MoveToLayer);
 +
</syntaxhighlight>
 
== Version ==
 
== Version ==
 
Availability: from VectorMEP 2021
 
Availability: from VectorMEP 2021
 
[[Category:VS Function Reference:Object Editing]]
 
[[Category:VS Function Reference:Object Editing]]
 +
__NOTOC__

Latest revision as of 08:54, 16 November 2020

Description

Procedure VM_MoveToLayer moves the selected objects to a layer.

PROCEDURE VM_MoveToLayer(
    h     :Handle);

Parameters

h HANDLE Handle to layer.

Remarks

When nill is passed as Layer handle, a dialog is presented with a list of all Layers to choose from.

Example

PROCEDURE MoveToLayer;
VAR
    h : HANDLE;
BEGIN
    h := NIL; 
    {h := GetObject('LayerName'); in case of predefined layer}
    IF VerifyLibraryRoutine('VM_MoveToLayer') THEN
		BEGIN
			IF (GetType(h) = 31) OR (h = NIL) THEN VM_MoveToLayer(h);
        End
    ELSE
        Message('The routine VM_MoveToLayer is not available.');
END;
RUN(MoveToLayer);

Version

Availability: from VectorMEP 2021