<?xml version="1.0"?>
<OriginStorage Label="" Display="652"><XFname NodeID="11" Label="Name" DataID="300">legendupdate</XFname><xFdescription NodeID="11" Label="Description" DataID="310">Update Le&amp;gend:Update or reconstruct legend on the graph page/layer</xFdescription><attachTo NodeID="13" Label="Attach to Origin Object" Combo="None|Auto|Column|Sheet/Layer|Book/Graph" DataID="320" Show="0">1</attachTo><author NodeID="11" Label="Author" DataID="314"></author><AutoDependent NodeID="10" Label="Auto Compile Dependent Files" DataID="451">1</AutoDependent><UsageCtxt NodeID="268435456" Label="Usage Context" DataID="329"><LabTalk NodeID="10" Label="Labtalk" DataID="357">1.</LabTalk><WksSel NodeID="10" Label="Worksheet Selection" DataID="350">0.</WksSel><GrObj NodeID="268435456" Label="Graphic Object Events" DataID="330" Use="0"><InitAnchors NodeID="10" Label="Initialization" DataID="339">1.</InitAnchors><Move NodeID="10" Label="Move" DataID="331">1.</Move><Moving NodeID="10" Label="Moving" DataID="332">0.</Moving><Resize NodeID="10" Label="Resize" DataID="333">0.</Resize><Resizing NodeID="10" Label="Resizing" DataID="334">0.</Resizing><Delete NodeID="10" Label="Delete" DataID="335">0.</Delete><Select NodeID="10" Label="Select" DataID="336">0.</Select><Unselect NodeID="10" Label="Unselect" DataID="337">0.</Unselect><BtnClick NodeID="10" Label="Button Click" DataID="338">0.</BtnClick><Rotate NodeID="10" Label="Rotate" DataID="340">0.</Rotate><Rotating NodeID="10" Label="Rotating" DataID="341">0.</Rotating><Skew NodeID="10" Label="Skew" DataID="342">0.</Skew><Skewing NodeID="10" Label="Skewing" DataID="343">0.</Skewing><EditEv NodeID="10" Label="Edit" DataID="344">0.</EditEv><Editing NodeID="10" Label="Editing" DataID="345">0.</Editing><NewSelection NodeID="10" Label="New Selection" DataID="346">0.</NewSelection><DeletePart NodeID="10" Label="Delete Part" DataID="347">0.</DeletePart><Keyboard NodeID="10" Label="Keyboard" DataID="348">0.</Keyboard><ObjType NodeID="13" Label="Type" Combo="Rect|Line" DataID="349">0.</ObjType></GrObj><Theme NodeID="268435456" Label="Theme" DataID="386"><UseInDialog NodeID="10" Label="Support Saving Themes in Dialog" DataID="372">1</UseInDialog><ShowInMenu NodeID="10" Label="Show Themes as Popups in Menu" DataID="352">1</ShowInMenu><SaveInBook NodeID="10" Label="Support Saving to Book" DataID="387">0.</SaveInBook><SaveInSheet NodeID="10" Label="Support Saving to Sheet" DataID="388">0.</SaveInSheet></Theme><mainmenu NodeID="268435456" Label="Menus" DataID="365" Use="1" BranchCombo="None|Main Menus|Context Menus|Both|Context Menus 1|Context Menus 2|Context Menus 3|Context Menus 4"><AddAsTool NodeID="10" Label="Add As Tool" DataID="366">0.</AddAsTool><ClassOp NodeID="10" Label="Class Operation" DataID="367">0.</ClassOp><GetN NodeID="13" Label="Auto GetN Dialog" Combo="None|Simple GetNBox|GetNGraphBox with Preview|GetNImageBox|Wizard|Custom" DataID="371">1.</GetN><CustomDialog NodeID="11" Label="Custom Dialog Function" DataID="395" Show="0"></CustomDialog><DlgFromMenu NodeID="10" Label="Open Dialog from Menu for Option Index" DataID="374">1.</DlgFromMenu><checkMenu NodeID="10" Label="Check Menu" DataID="470">0.</checkMenu></mainmenu><windows NodeID="268435456" Label="Windows" DataID="450" Use="1"><graph NodeID="10" Label="Graph" DataID="368">1</graph><worksheet NodeID="10" Label="Worksheet" DataID="369">0.</worksheet><matrix NodeID="10" Label="Matrix" DataID="370">0.</matrix><matrix NodeID="10" Label="Report" DataID="360">0.</matrix></windows></UsageCtxt><outTree NodeID="10" Label="Generate LabTalk Tree upon execution" DataID="373">1.</outTree><askOutResultsLog NodeID="10" Label="Add Checkbox to Auto GetN Dialog about Results Log Output" DataID="393">0.</askOutResultsLog><outResultsLog NodeID="13" Label="Output to Results Log upon execution" Combo="None|All|Report Tree|First Input|First Output|All Outputs|All Except Trees" DataID="394">0.</outResultsLog><customButtons NodeID="11" Label="GetN Dialog Custom Buttons" DataID="391">Apply</customButtons><syntax NodeID="41" Label="Command Line Usage" DataID="305" MultilineEditExpShrink="1" DispFormat="33554432" RowHeightRange="2-18">legendupdate dest:=layer update:=reconstruct
legendupdate dest:=layer update:=reconstruct legend:=combine order:=ascend mode:=lu</syntax><vars NodeID="268435456" Label="Variables" Branch="1"><v1 _XFUNCTION_VAR="1" RepeatID="1"><name NodeID="11" Label="Name" DataID="10">dest</name><description NodeID="11" Label="Label" DataID="20" Show="0">Destination</description><io NodeID="13" Label="Input/Output" Combo="Input|Output|Input/Output" DataID="30">0.</io><type NodeID="11" Label="Data Type" Combo="double|string|int|vector|vector&lt;string&gt;|vector&lt;complex&gt;|Range|XYRange|XYRangeComplex|XYZRange|matrix|ButtonInfo|LineInfo|TextInfo|EventInfo|MarkerInfo|RectInfo|Column|MatrixObject|Image|DataPlot|Page|GraphPage|WorksheetPage|MatrixPage|GraphLayer|Worksheet|MatrixLayer|TreeNode|FileLink|ReportTree|ReportData|GraphPageBase" DataID="40">int</type><valdata NodeID="13" Label="Data" DataID="50" Combo="" Enable="1">0</valdata><comboString NodeID="11" Label="Control" DataID="70">page:Whole Page|layer:Active Layer|spepage:Specific Page|spelayer:Specific layer</comboString><context NodeID="268435456" Label="Context" DataID="71"></context><optionString NodeID="11" Label="Option String" DataID="69"></optionString><suggestedValues NodeID="11" Label="Suggested Values" DataID="405"></suggestedValues><themeID NodeID="14" Label="Theme ID" DataID="35">0.</themeID><help NodeID="268435456" Label="English Help" DataID="410" RepeatID="256"><description NodeID="11" Label="Display Name" DataID="408">Destination</description><remark NodeID="41" Label="Description" DataID="409" RowHeightRange="3-8">Specifies whether the whole page or the active layer to manipulate.</remark><hint NodeID="41" Label="Auto Complete Hint" DataID="406" RowHeightRange="1-3">Page or layer to manipulate</hint><comboDescription NodeID="47" Label="Option Explanations" DataID="407" TypeID="65543" BlobArrElementaryType="8" xmlns:dt="urn:schemas-microsoft-com:datatypes" dt:dt="bin.base64">U3BlY2lmaWVzIHRoZSB3aG9sZSBwYWdlIHRvIG1hbmlwdWxhdGUuAFNwZWNpZmllcyBvbmx5
IHRoZSBhY3RpdmUgbGF5ZXIgdG8gbWFuaXB1bGF0ZS4AAA==</comboDescription></help><helpj NodeID="268435456" Label="Japanese Help" DataID="410" RepeatID="512"><description NodeID="11" Label="Display Name" DataID="408" CdPg="932">適用対象</description><remark NodeID="41" Label="Description" DataID="409" RowHeightRange="3-8" CdPg="932">ページ全体またはアクティブレイヤを操作するかどうかを指定します。</remark><hint NodeID="41" Label="Auto Complete Hint" DataID="406" RowHeightRange="1-3" CdPg="932">操作するページやレイヤ</hint><comboDescription NodeID="47" Label="Option Explanations" DataID="407" CdPg="932"></comboDescription></helpj><helpg NodeID="268435456" Label="German Help" DataID="410" RepeatID="768"><description NodeID="11" Label="Display Name" DataID="408" CdPg="1252">Ziel</description><remark NodeID="41" Label="Description" DataID="409" RowHeightRange="3-8" CdPg="1252">Legt fest, ob die ganze Seite oder der aktive Layer verändert werden soll oder nicht.</remark><hint NodeID="41" Label="Auto Complete Hint" DataID="406" RowHeightRange="1-3" CdPg="1252">Zu verändernde/r Seite oder Layer</hint><comboDescription NodeID="47" Label="Option Explanations" DataID="407" CdPg="1252"></comboDescription></helpg><helpc NodeID="268435456" Label="Chinese Help" DataID="410" RepeatID="1024"><description NodeID="11" Label="Display Name" DataID="408" CdPg="936"></description><remark NodeID="41" Label="Description" DataID="409" RowHeightRange="3-8" CdPg="936"></remark><hint NodeID="41" Label="Auto Complete Hint" DataID="406" RowHeightRange="1-3" CdPg="936"></hint><comboDescription NodeID="47" Label="Option Explanations" DataID="407" CdPg="936"></comboDescription></helpc></v1><v2 _XFUNCTION_VAR="1" RepeatID="2"><name NodeID="11" Label="Name" DataID="10">update</name><description NodeID="11" Label="Label" DataID="20" Show="0">Update Mode</description><io NodeID="13" Label="Input/Output" Combo="Input|Output|Input/Output" DataID="30">0.</io><type NodeID="11" Label="Data Type" Combo="double|string|int|vector|vector&lt;string&gt;|vector&lt;complex&gt;|Range|XYRange|XYRangeComplex|XYZRange|matrix|ButtonInfo|LineInfo|TextInfo|EventInfo|MarkerInfo|RectInfo|Column|MatrixObject|Image|DataPlot|Page|GraphPage|WorksheetPage|MatrixPage|GraphLayer|Worksheet|MatrixLayer|TreeNode|FileLink|ReportTree|ReportData|GraphPageBase" DataID="40">int</type><valdata NodeID="13" Label="Data" DataID="50" Combo="" Enable="1">1</valdata><comboString NodeID="11" Label="Control" DataID="70">reconstruct:Reconstruct|update:Update</comboString><context NodeID="268435456" Label="Context" DataID="71"></context><optionString NodeID="11" Label="Option String" DataID="69"></optionString><suggestedValues NodeID="11" Label="Suggested Values" DataID="405"></suggestedValues><themeID NodeID="14" Label="Theme ID" DataID="35">0.</themeID><help NodeID="268435456" Label="English Help" DataID="410" RepeatID="256"><description NodeID="11" Label="Display Name" DataID="408">Update Mode</description><remark NodeID="41" Label="Description" DataID="409" RowHeightRange="3-8">Specifies whether to reconstruct or update the legend.</remark><hint NodeID="41" Label="Auto Complete Hint" DataID="406" RowHeightRange="1-3">Reconstruct or update the legend</hint><comboDescription NodeID="47" Label="Option Explanations" DataID="407" TypeID="65543" BlobArrElementaryType="8" xmlns:dt="urn:schemas-microsoft-com:datatypes" dt:dt="bin.base64">U3BlY2lmaWVzIHRvIHJlY29uc3RydWN0IHRoZSBsZWdlbmQAU3BlY2lmaWVzIHRvIHVwZGF0
ZSB0aGUgbGVnZW5kAAA=</comboDescription></help><helpj NodeID="268435456" Label="Japanese Help" DataID="410" RepeatID="512"><description NodeID="11" Label="Display Name" DataID="408" CdPg="932">更新モード</description><remark NodeID="41" Label="Description" DataID="409" RowHeightRange="3-8" CdPg="932">凡例を再構成または更新するかどうかを指定します。</remark><hint NodeID="41" Label="Auto Complete Hint" DataID="406" RowHeightRange="1-3" CdPg="932">凡例を再構成または更新します。</hint><comboDescription NodeID="47" Label="Option Explanations" DataID="407" CdPg="932"></comboDescription></helpj><helpg NodeID="268435456" Label="German Help" DataID="410" RepeatID="768"><description NodeID="11" Label="Display Name" DataID="408" CdPg="1252">Aktualisierungsmodus</description><remark NodeID="41" Label="Description" DataID="409" RowHeightRange="3-8" CdPg="1252">Legt fest, ob die Legende neu gebildet oder aktualisiert werden soll.</remark><hint NodeID="41" Label="Auto Complete Hint" DataID="406" RowHeightRange="1-3" CdPg="1252">Neubilden oder Aktualisieren der Legende</hint><comboDescription NodeID="47" Label="Option Explanations" DataID="407" CdPg="1252"></comboDescription></helpg><helpc NodeID="268435456" Label="Chinese Help" DataID="410" RepeatID="1024"><description NodeID="11" Label="Display Name" DataID="408" CdPg="936"></description><remark NodeID="41" Label="Description" DataID="409" RowHeightRange="3-8" CdPg="936"></remark><hint NodeID="41" Label="Auto Complete Hint" DataID="406" RowHeightRange="1-3" CdPg="936"></hint><comboDescription NodeID="47" Label="Option Explanations" DataID="407" CdPg="936"></comboDescription></helpc></v2><v3 _XFUNCTION_VAR="1" RepeatID="3"><name NodeID="11" Label="Name" DataID="10">legend</name><description NodeID="11" Label="Label" DataID="20" Show="0">Legend</description><io NodeID="13" Label="Input/Output" Combo="Input|Output|Input/Output" DataID="30">0.</io><type NodeID="11" Label="Data Type" Combo="double|string|int|vector|vector&lt;string&gt;|vector&lt;complex&gt;|Range|XYRange|XYRangeComplex|XYZRange|matrix|ButtonInfo|LineInfo|TextInfo|EventInfo|MarkerInfo|RectInfo|Column|MatrixObject|Image|DataPlot|Page|GraphPage|WorksheetPage|MatrixPage|GraphLayer|Worksheet|MatrixLayer|TreeNode|FileLink|ReportTree|ReportData|GraphPageBase" DataID="40">int</type><valdata NodeID="13" Label="Data" DataID="50" Combo="" Enable="1">0</valdata><comboString NodeID="11" Label="Control" DataID="70">separate:Legend for each Graph|combine:One Legend for All</comboString><context NodeID="268435456" Label="Context" DataID="71"></context><optionString NodeID="11" Label="Option String" DataID="69"></optionString><suggestedValues NodeID="11" Label="Suggested Values" DataID="405"></suggestedValues><themeID NodeID="14" Label="Theme ID" DataID="35">0.</themeID><help NodeID="268435456" Label="English Help" DataID="410" RepeatID="256"><description NodeID="11" Label="Display Name" DataID="408">Legend</description><remark NodeID="41" Label="Description" DataID="409" RowHeightRange="3-8">Whether all graphs share the same legend or their respective legend.</remark><hint NodeID="41" Label="Auto Complete Hint" DataID="406" RowHeightRange="1-3">Format of the legend</hint><comboDescription NodeID="47" Label="Option Explanations" DataID="407" TypeID="65543" BlobArrElementaryType="8" xmlns:dt="urn:schemas-microsoft-com:datatypes" dt:dt="bin.base64">U3BlY2lmaWVzIGVhY2ggZ3JhcGggaGFzIGl0cyBvd24gbGVnZW5kLgBTcGVjaWZpZXMgYWxs
IGdyYXBocyBzaGFyZSB0aGUgc2FtZSBsZWdlbmQAAA==</comboDescription></help><helpj NodeID="268435456" Label="Japanese Help" DataID="410" RepeatID="512"><description NodeID="11" Label="Display Name" DataID="408" CdPg="932">凡例</description><remark NodeID="41" Label="Description" DataID="409" RowHeightRange="3-8" CdPg="932">すべてのグラフが同じ凡例を共有するか、各レイヤ毎の凡例にするかを指定します。</remark><hint NodeID="41" Label="Auto Complete Hint" DataID="406" RowHeightRange="1-3" CdPg="932">凡例のフォーマット</hint><comboDescription NodeID="47" Label="Option Explanations" DataID="407" CdPg="932"></comboDescription></helpj><helpg NodeID="268435456" Label="German Help" DataID="410" RepeatID="768"><description NodeID="11" Label="Display Name" DataID="408" CdPg="1252">Legende</description><remark NodeID="41" Label="Description" DataID="409" RowHeightRange="3-8" CdPg="1252">Ob alle Diagramme die gleiche Legende teilen oder ihre jeweilige Legende besitzen</remark><hint NodeID="41" Label="Auto Complete Hint" DataID="406" RowHeightRange="1-3" CdPg="1252">Format der Legende</hint><comboDescription NodeID="47" Label="Option Explanations" DataID="407" CdPg="1252"></comboDescription></helpg><helpc NodeID="268435456" Label="Chinese Help" DataID="410" RepeatID="1024"><description NodeID="11" Label="Display Name" DataID="408" CdPg="936"></description><remark NodeID="41" Label="Description" DataID="409" RowHeightRange="3-8" CdPg="936"></remark><hint NodeID="41" Label="Auto Complete Hint" DataID="406" RowHeightRange="1-3" CdPg="936"></hint><comboDescription NodeID="47" Label="Option Explanations" DataID="407" CdPg="936"></comboDescription></helpc></v3><v4 _XFUNCTION_VAR="1" RepeatID="4"><name NodeID="11" Label="Name" DataID="10">order</name><description NodeID="11" Label="Label" DataID="20" Show="0">Order</description><io NodeID="13" Label="Input/Output" Combo="Input|Output|Input/Output" DataID="30">0.</io><type NodeID="11" Label="Data Type" Combo="double|string|int|vector|vector&lt;string&gt;|vector&lt;complex&gt;|Range|XYRange|XYRangeComplex|XYZRange|matrix|ButtonInfo|LineInfo|TextInfo|EventInfo|MarkerInfo|RectInfo|Column|MatrixObject|Image|DataPlot|Page|GraphPage|WorksheetPage|MatrixPage|GraphLayer|Worksheet|MatrixLayer|TreeNode|FileLink|ReportTree|ReportData|GraphPageBase" DataID="40">int</type><valdata NodeID="13" Label="Data" DataID="50" Combo="" Enable="1">1</valdata><comboString NodeID="11" Label="Control" DataID="70">descend:Descending|ascend:Ascending</comboString><context NodeID="268435456" Label="Context" DataID="71"></context><optionString NodeID="11" Label="Option String" DataID="69"></optionString><suggestedValues NodeID="11" Label="Suggested Values" DataID="405"></suggestedValues><themeID NodeID="14" Label="Theme ID" DataID="35">0.</themeID><help NodeID="268435456" Label="English Help" DataID="410" RepeatID="256"><description NodeID="11" Label="Display Name" DataID="408">Order</description><remark NodeID="41" Label="Description" DataID="409" RowHeightRange="3-8">Specifies the order of the legend.</remark><hint NodeID="41" Label="Auto Complete Hint" DataID="406" RowHeightRange="1-3">Order of the legend</hint><comboDescription NodeID="47" Label="Option Explanations" DataID="407" TypeID="65543" BlobArrElementaryType="8" xmlns:dt="urn:schemas-microsoft-com:datatypes" dt:dt="bin.base64">VGhlIGxlZ2VuZCBpcyBvcmRlcmVkIGRlY2VuZGluZ2x5AFRoZSBsZWdlbmQgaXMgb3JkZXJl
ZCBhc2NlbmRpbmdseQAA</comboDescription></help><helpj NodeID="268435456" Label="Japanese Help" DataID="410" RepeatID="512"><description NodeID="11" Label="Display Name" DataID="408" CdPg="932">順序</description><remark NodeID="41" Label="Description" DataID="409" RowHeightRange="3-8" CdPg="932">凡例の順序を指定します。</remark><hint NodeID="41" Label="Auto Complete Hint" DataID="406" RowHeightRange="1-3" CdPg="932">凡例の順序</hint><comboDescription NodeID="47" Label="Option Explanations" DataID="407" CdPg="932"></comboDescription></helpj><helpg NodeID="268435456" Label="German Help" DataID="410" RepeatID="768"><description NodeID="11" Label="Display Name" DataID="408" CdPg="1252">Reihenfolge</description><remark NodeID="41" Label="Description" DataID="409" RowHeightRange="3-8" CdPg="1252">Legt die Reihenfolge der Legende fest.</remark><hint NodeID="41" Label="Auto Complete Hint" DataID="406" RowHeightRange="1-3" CdPg="1252">Reihenfolge der Legende</hint><comboDescription NodeID="47" Label="Option Explanations" DataID="407" CdPg="1252"></comboDescription></helpg><helpc NodeID="268435456" Label="Chinese Help" DataID="410" RepeatID="1024"><description NodeID="11" Label="Display Name" DataID="408" CdPg="936"></description><remark NodeID="41" Label="Description" DataID="409" RowHeightRange="3-8" CdPg="936"></remark><hint NodeID="41" Label="Auto Complete Hint" DataID="406" RowHeightRange="1-3" CdPg="936"></hint><comboDescription NodeID="47" Label="Option Explanations" DataID="407" CdPg="936"></comboDescription></helpc></v4><v5 _XFUNCTION_VAR="1" RepeatID="5"><name NodeID="11" Label="Name" DataID="10">mode</name><description NodeID="11" Label="Label" DataID="20" Show="0">Auto Legend Translation Mode</description><io NodeID="13" Label="Input/Output" Combo="Input|Output|Input/Output" DataID="30">0.</io><type NodeID="11" Label="Data Type" Combo="double|string|int|vector|vector&lt;string&gt;|vector&lt;complex&gt;|Range|XYRange|XYRangeComplex|XYZRange|matrix|ButtonInfo|LineInfo|TextInfo|EventInfo|MarkerInfo|RectInfo|Column|MatrixObject|Image|DataPlot|Page|GraphPage|WorksheetPage|MatrixPage|GraphLayer|Worksheet|MatrixLayer|TreeNode|FileLink|ReportTree|ReportData|GraphPageBase" DataID="40">int</type><valdata NodeID="13" Label="Data" DataID="50" Combo="" Enable="1">0</valdata><comboString NodeID="11" Label="Control" DataID="70">comment:Use Comment (1st line)|dr:Data Range|lu:Long Name &amp; Units|udpara:User Parameter 1|lname:Long Name|sname:Short Name|lpara:Parameter 1|custom:Custom</comboString><context NodeID="268435456" Label="Context" DataID="71"></context><optionString NodeID="11" Label="Option String" DataID="69"></optionString><suggestedValues NodeID="11" Label="Suggested Values" DataID="405"></suggestedValues><themeID NodeID="14" Label="Theme ID" DataID="35">0.</themeID><help NodeID="268435456" Label="English Help" DataID="410" RepeatID="256"><description NodeID="11" Label="Display Name" DataID="408">Auto Legend Translation Mode</description><remark NodeID="41" Label="Description" DataID="409" RowHeightRange="3-8">Specifies the mode of legend translation.</remark><hint NodeID="41" Label="Auto Complete Hint" DataID="406" RowHeightRange="1-3">Mode of legend translation</hint><comboDescription NodeID="47" Label="Option Explanations" DataID="407" TypeID="65543" BlobArrElementaryType="8" xmlns:dt="urn:schemas-microsoft-com:datatypes" dt:dt="bin.base64">VXNlIHRoZSBmaXJzdCBsaW5lIGFzIHRoZSBsZWdlbmQAVXNlIHRoZSBkYXRhIHJhbmdlIGFz
IHRoZSBsZWdlbmQAVXNlIHRoZSBsb25nIG5hbWUgYW5kIHVuaXRzIGFzIHRoZSBsZWdlbmQA
VXNlIHVzZXItZGVmaW5lZCBwYXJhbWV0ZXIgYXMgdGhlIGxlZ2VuZABVc2UgdGhlIGxvbmcg
bmFtZSBhcyB0aGUgbGVnZW5kAFVzZSB0aGUgc2hvcnQgbmFtZSBhcyB0aGUgbGVnZW5kAFVz
ZSB0aGUgc3lzdGVtIHBhcmFtZXRlciBhcyB0aGUgbGVnZW5kAFRoZSBsZWdlbmQgaXMgZGVm
aW5lZCBieSBjdXN0b20AAA==</comboDescription></help><helpj NodeID="268435456" Label="Japanese Help" DataID="410" RepeatID="512"><description NodeID="11" Label="Display Name" DataID="408" CdPg="932">凡例の自動更新モード</description><remark NodeID="41" Label="Description" DataID="409" RowHeightRange="3-8" CdPg="932">凡例の更新モードを指定します。</remark><hint NodeID="41" Label="Auto Complete Hint" DataID="406" RowHeightRange="1-3" CdPg="932">凡例の更新モード</hint><comboDescription NodeID="47" Label="Option Explanations" DataID="407" CdPg="932"></comboDescription></helpj><helpg NodeID="268435456" Label="German Help" DataID="410" RepeatID="768"><description NodeID="11" Label="Display Name" DataID="408" CdPg="1252">Automatischer Übersetzungsmodus der Legende</description><remark NodeID="41" Label="Description" DataID="409" RowHeightRange="3-8" CdPg="1252">Legt den Modus der Legendenübersetzung fest.</remark><hint NodeID="41" Label="Auto Complete Hint" DataID="406" RowHeightRange="1-3" CdPg="1252">Modus der Legendenübersetzung</hint><comboDescription NodeID="47" Label="Option Explanations" DataID="407" CdPg="1252"></comboDescription></helpg><helpc NodeID="268435456" Label="Chinese Help" DataID="410" RepeatID="1024"><description NodeID="11" Label="Display Name" DataID="408" CdPg="936"></description><remark NodeID="41" Label="Description" DataID="409" RowHeightRange="3-8" CdPg="936"></remark><hint NodeID="41" Label="Auto Complete Hint" DataID="406" RowHeightRange="1-3" CdPg="936"></hint><comboDescription NodeID="47" Label="Option Explanations" DataID="407" CdPg="936"></comboDescription></helpc></v5><v6 _XFUNCTION_VAR="1" RepeatID="6"><name NodeID="11" Label="Name" DataID="10">custom</name><description NodeID="11" Label="Label" DataID="20" Show="0">Legend Custom Format(@D,@LU etc)</description><io NodeID="13" Label="Input/Output" Combo="Input|Output|Input/Output" DataID="30">0.</io><type NodeID="11" Label="Data Type" Combo="double|string|int|vector|vector&lt;string&gt;|vector&lt;complex&gt;|Range|XYRange|XYRangeComplex|XYZRange|matrix|ButtonInfo|LineInfo|TextInfo|EventInfo|MarkerInfo|RectInfo|Column|MatrixObject|Image|DataPlot|Page|GraphPage|WorksheetPage|MatrixPage|GraphLayer|Worksheet|MatrixLayer|TreeNode|FileLink|ReportTree|ReportData|GraphPageBase" DataID="40">string</type><valdata NodeID="11" Label="Data" DataID="50" Enable="1"></valdata><comboString NodeID="11" Label="Control" DataID="70"></comboString><context NodeID="268435456" Label="Context" DataID="71"></context><optionString NodeID="11" Label="Option String" DataID="69"></optionString><suggestedValues NodeID="11" Label="Suggested Values" DataID="405"></suggestedValues><themeID NodeID="14" Label="Theme ID" DataID="35">0.</themeID><help NodeID="268435456" Label="English Help" DataID="410" RepeatID="256"><description NodeID="11" Label="Display Name" DataID="408">Legend Custom Format(@D,@LU etc)</description><remark NodeID="41" Label="Description" DataID="409" RowHeightRange="3-8"><![CDATA[This parameter applies only to mode:=custom option ]]></remark><hint NodeID="41" Label="Auto Complete Hint" DataID="406" RowHeightRange="1-3">Format of legend defined by custom</hint><comboDescription NodeID="47" Label="Option Explanations" DataID="407"></comboDescription></help><helpj NodeID="268435456" Label="Japanese Help" DataID="410" RepeatID="512"><description NodeID="11" Label="Display Name" DataID="408" CdPg="932">凡例のカスタムフォーマット(@D,@LU etc)</description><remark NodeID="41" Label="Description" DataID="409" RowHeightRange="3-8" CdPg="932"><![CDATA[このパラメータは、カスタムオプションのモードにのみ適用できます。 ]]></remark><hint NodeID="41" Label="Auto Complete Hint" DataID="406" RowHeightRange="1-3" CdPg="932">凡例のフォーマットはカスタム定義されます。</hint><comboDescription NodeID="47" Label="Option Explanations" DataID="407" CdPg="932"></comboDescription></helpj><helpg NodeID="268435456" Label="German Help" DataID="410" RepeatID="768"><description NodeID="11" Label="Display Name" DataID="408" CdPg="1252">Benutzerdefiniertes Format der Legende(@D,@LU etc)</description><remark NodeID="41" Label="Description" DataID="409" RowHeightRange="3-8" CdPg="1252"><![CDATA[Dieser Parameter wird nur auf den Modus:=benutzerdefinierte Option angewendet. ]]></remark><hint NodeID="41" Label="Auto Complete Hint" DataID="406" RowHeightRange="1-3" CdPg="1252">Format der benutzerdefinierten Legende</hint><comboDescription NodeID="47" Label="Option Explanations" DataID="407" CdPg="1252"></comboDescription></helpg><helpc NodeID="268435456" Label="Chinese Help" DataID="410" RepeatID="1024"><description NodeID="11" Label="Display Name" DataID="408" CdPg="936"></description><remark NodeID="41" Label="Description" DataID="409" RowHeightRange="3-8" CdPg="936"></remark><hint NodeID="41" Label="Auto Complete Hint" DataID="406" RowHeightRange="1-3" CdPg="936"></hint><comboDescription NodeID="47" Label="Option Explanations" DataID="407" CdPg="936"></comboDescription></helpc></v6><v7 _XFUNCTION_VAR="1" RepeatID="7"><name NodeID="11" Label="Name" DataID="10">page</name><description NodeID="11" Label="Label" DataID="20" Show="0">GraphPage</description><io NodeID="13" Label="Input/Output" Combo="Input|Output|Input/Output" DataID="30">0.</io><type NodeID="11" Label="Data Type" Combo="double|string|int|vector|vector&lt;string&gt;|vector&lt;complex&gt;|Range|XYRange|XYRangeComplex|XYZRange|matrix|ButtonInfo|LineInfo|TextInfo|EventInfo|MarkerInfo|RectInfo|Column|MatrixObject|Image|DataPlot|Page|GraphPage|WorksheetPage|MatrixPage|GraphLayer|Worksheet|MatrixLayer|TreeNode|FileLink|ReportTree|ReportData|GraphPageBase" DataID="40">GraphPage</type><valdata NodeID="80" Label="Data" DataID="50" _DROP_DOWN_BUTTON_ID="-1|0">&lt;optional&gt;</valdata><comboString NodeID="11" Label="Control" DataID="70"></comboString><context NodeID="268435456" Label="Context" DataID="71"></context><optionString NodeID="11" Label="Option String" DataID="69">V:0</optionString><suggestedValues NodeID="11" Label="Suggested Values" DataID="405"></suggestedValues><themeID NodeID="14" Label="Theme ID" DataID="35">0.</themeID><help NodeID="268435456" Label="English Help" DataID="410" RepeatID="256"><description NodeID="11" Label="Display Name" DataID="408">GraphPage</description><remark NodeID="41" Label="Description" DataID="409" RowHeightRange="3-8"></remark><hint NodeID="41" Label="Auto Complete Hint" DataID="406" RowHeightRange="1-3"></hint><comboDescription NodeID="47" Label="Option Explanations" DataID="407"></comboDescription></help><helpj NodeID="268435456" Label="Japanese Help" DataID="410" RepeatID="512"><description NodeID="11" Label="Display Name" DataID="408" CdPg="932"></description><remark NodeID="41" Label="Description" DataID="409" RowHeightRange="3-8" CdPg="932"></remark><hint NodeID="41" Label="Auto Complete Hint" DataID="406" RowHeightRange="1-3" CdPg="932"></hint><comboDescription NodeID="47" Label="Option Explanations" DataID="407" CdPg="932"></comboDescription></helpj><helpg NodeID="268435456" Label="German Help" DataID="410" RepeatID="768"><description NodeID="11" Label="Display Name" DataID="408" CdPg="1252"></description><remark NodeID="41" Label="Description" DataID="409" RowHeightRange="3-8" CdPg="1252"></remark><hint NodeID="41" Label="Auto Complete Hint" DataID="406" RowHeightRange="1-3" CdPg="1252"></hint><comboDescription NodeID="47" Label="Option Explanations" DataID="407" CdPg="1252"></comboDescription></helpg><helpc NodeID="268435456" Label="Chinese Help" DataID="410" RepeatID="1024"><description NodeID="11" Label="Display Name" DataID="408" CdPg="936"></description><remark NodeID="41" Label="Description" DataID="409" RowHeightRange="3-8" CdPg="936"></remark><hint NodeID="41" Label="Auto Complete Hint" DataID="406" RowHeightRange="1-3" CdPg="936"></hint><comboDescription NodeID="47" Label="Option Explanations" DataID="407" CdPg="936"></comboDescription></helpc></v7><v8 _XFUNCTION_VAR="1" RepeatID="8"><name NodeID="11" Label="Name" DataID="10">layer</name><description NodeID="11" Label="Label" DataID="20" Show="0">GraphLayer</description><io NodeID="13" Label="Input/Output" Combo="Input|Output|Input/Output" DataID="30">0.</io><type NodeID="11" Label="Data Type" Combo="double|string|int|vector|vector&lt;string&gt;|vector&lt;complex&gt;|Range|XYRange|XYRangeComplex|XYZRange|matrix|ButtonInfo|LineInfo|TextInfo|EventInfo|MarkerInfo|RectInfo|Column|MatrixObject|Image|DataPlot|Page|GraphPage|WorksheetPage|MatrixPage|GraphLayer|Worksheet|MatrixLayer|TreeNode|FileLink|ReportTree|ReportData|GraphPageBase" DataID="40">GraphLayer</type><valdata NodeID="81" Label="Data" DataID="50" _DROP_DOWN_BUTTON_ID="2112|1">&lt;optional&gt;</valdata><comboString NodeID="11" Label="Control" DataID="70"></comboString><context NodeID="268435456" Label="Context" DataID="71"></context><optionString NodeID="11" Label="Option String" DataID="69">V:0</optionString><suggestedValues NodeID="11" Label="Suggested Values" DataID="405"></suggestedValues><themeID NodeID="14" Label="Theme ID" DataID="35">0.</themeID><help NodeID="268435456" Label="English Help" DataID="410" RepeatID="256"><description NodeID="11" Label="Display Name" DataID="408">GraphLayer</description><remark NodeID="41" Label="Description" DataID="409" RowHeightRange="3-8"></remark><hint NodeID="41" Label="Auto Complete Hint" DataID="406" RowHeightRange="1-3"></hint><comboDescription NodeID="47" Label="Option Explanations" DataID="407"></comboDescription></help><helpj NodeID="268435456" Label="Japanese Help" DataID="410" RepeatID="512"><description NodeID="11" Label="Display Name" DataID="408" CdPg="932"></description><remark NodeID="41" Label="Description" DataID="409" RowHeightRange="3-8" CdPg="932"></remark><hint NodeID="41" Label="Auto Complete Hint" DataID="406" RowHeightRange="1-3" CdPg="932"></hint><comboDescription NodeID="47" Label="Option Explanations" DataID="407" CdPg="932"></comboDescription></helpj><helpg NodeID="268435456" Label="German Help" DataID="410" RepeatID="768"><description NodeID="11" Label="Display Name" DataID="408" CdPg="1252"></description><remark NodeID="41" Label="Description" DataID="409" RowHeightRange="3-8" CdPg="1252"></remark><hint NodeID="41" Label="Auto Complete Hint" DataID="406" RowHeightRange="1-3" CdPg="1252"></hint><comboDescription NodeID="47" Label="Option Explanations" DataID="407" CdPg="1252"></comboDescription></helpg><helpc NodeID="268435456" Label="Chinese Help" DataID="410" RepeatID="1024"><description NodeID="11" Label="Display Name" DataID="408" CdPg="936"></description><remark NodeID="41" Label="Description" DataID="409" RowHeightRange="3-8" CdPg="936"></remark><hint NodeID="41" Label="Auto Complete Hint" DataID="406" RowHeightRange="1-3" CdPg="936"></hint><comboDescription NodeID="47" Label="Option Explanations" DataID="407" CdPg="936"></comboDescription></helpc></v8></vars><modificationLog NodeID="41" Label="Modification Log" DataID="438" MultilineEditExpShrink="1" DispFormat="33554432" RowHeightRange="2-15">8/17/07 Fay. Edit.
Max 9/25/08 Correct typo in script samples dialog</modificationLog><codes NodeID="268435456" Label="Code" DataID="324"><rettype NodeID="11" Label="Return Type" Combo="void|int|double|string|vector" DataID="41">void</rettype><header NodeID="45" Label="Header" DataID="323" MultilineEditExpShrink="1" DispFormat="33554432" RowHeightRange="3-15"><![CDATA[
/// Iris 07/19/2007 INIT_MODE_VAL_FROM_PAGE_SETTINGS
/// Iris 07/25/2007 SHOULD_CHANGE_LEGEND_POSITION_IN_THIS_XF
/// Iris 07/26/2007 FIX_RECONSTRUCT_STILL_SHOW_YERR_IN_LEGEND
/// Hong 08/08/07 QA80-10064 FIX_LEGEND_COMBINE_FAIL_KEEP_ORIGIN_ORDER
/// Sim 09-05-2008 CLEAN_DEFAULT_THEME
/// Army 07/06/2009 QA80-13651 SUPPORT_SPECIFY_PAGE_AND_LAYER

//put additional include files here
#include <..\originlab\graph_utils.h>
#include <..\originlab\theme_utils.h>
//put your own support static functions here

//static vector<string> s_vsLegendFormat = {"@LM", "@R", "@U", "@LD", "@LA", "@LS", "@LP"};
/// Iris 07/27/2007 IMPROVE_CUSTOM_FORMAT_EDITABLE_COMBO
//static vector<string> s_vsCustomLegendFormat = {"@D","@LG","@LM","@LN","@LA","@LS","@LL","@LU","@LH","@LC","@LP<n>","@LD<n>","@LQ<n>","@U","@W","@WL","@WS"};
///end IMPROVE_CUSTOM_FORMAT_EDITABLE_COMBO

/*
static int _get_legend_count(const GraphLayer& gl)
{	

	GraphObject	goLegend = gl.GraphObjects(GO_LEGEND_NAME);
	if(!goLegend.IsValid())
		return -1;
	
	if(goLegend.Text.IsEmpty())
		return 0;
	
	vector<string> vsText;
	str_separate(goLegend.Text,"\r\n",vsText);
	
	return vsText.GetSize();
}
*/
/// Hong 07/24/07 v8.0666 MORE_RELIABLE
static bool _update_getn_by_update(TreeNode& trGetN)
{
	bool bEnable = (update_reconstruct == trGetN.update.nVal) ? true : false;	
	/// Hong QA80-10064 v8.0672 LEGEND_ADD_ORDER_OPTION_WHEN_RECONSTRUCT
	trGetN.order.Enable = bEnable;
	trGetN.order.Show = bEnable;
	/// end LEGEND_ADD_ORDER_OPTION_WHEN_RECONSTRUCT
	GraphPage gp = Project.Pages();

	/// Hong 08/03/07 QA80-10064-P5 HIDDEN_LEGEND_WHEN_ACTIVE_LAYER
	//if ( 1 == gp.Layers.Count() )
	if ( dest_layer == trGetN.dest.nVal || 1 == gp.Layers.Count() )
	/// end HIDDEN_LEGEND_WHEN_ACTIVE_LAYER
		bEnable = false;
	
	trGetN.legend.Enable = bEnable;
	trGetN.legend.Show = bEnable;
		
	return true;
}
/// end MORE_RELIABLE

/// Hong 07/23/07 QA80-10064 MORE_OPTIONS_FOR_LEGEND_UPDATE
static bool _update_getn_by_dest(TreeNode& trGetN)
{
	bool bDestPage = (dest_page == trGetN.dest.nVal) ? 1 : 0;
	trGetN.legend.Enable = bDestPage;
	/// Hong 07/24/07 v8.0666 MORE_RELIABLE
	//if ( bDestPage ) // as layout will reconstrcut all legend, so do this limite
	//{
	//	trGetN.update.Enable = ENABLE_READ_ONLY;
	//	trGetN.update.nVal = update_reconstruct;
	//}
	//else
	//{
	//	trGetN.update.Enable = ENABLE;
	//}
	trGetN.mode.Enable = bDestPage;
	trGetN.mode.Show = bDestPage;
	
	_update_getn_by_update(trGetN);
	/// end MORE_RELIABLE
	return true;
}
/// end MORE_OPTIONS_FOR_LEGEND_UPDATE

/// Hong 07/24/07 v8.0666 ADD_APPLY_BTN
/// Hong QA80-10064 v8.0672 LEGEND_ADD_ORDER_OPTION_WHEN_RECONSTRUCT
//static void _legend_update(int dest, int update, int legend, int mode, string custom)
///Army 07/06/2009 v8.1052 QA80-13651 SUPPORT_SPECIFY_PAGE_AND_LAYER
//static void _legend_update(int dest, int update, int legend, int mode, string custom, bool bAscending)
static void _legend_update(int dest, int update, int legend, int mode, string custom, bool bAscending, GraphPage& page= NULL, GraphLayer& layer =NULL)
///End SUPPORT_SPECIFY_PAGE_AND_LAYER
/// end LEGEND_ADD_ORDER_OPTION_WHEN_RECONSTRUCT
{
	///Army 07/06/2009 v8.1052 QA80-13651 SUPPORT_SPECIFY_PAGE_AND_LAYER
	/*
	/// Hong 07/23/07 QA80-10064 MORE_OPTIONS_FOR_LEGEND_UPDATE
	GraphLayer gl = Project.ActiveLayer();
	/// end MORE_OPTIONS_FOR_LEGEND_UPDATE
	
	if(!gl.IsValid())
		XF_THROW(XFERR_INVALID_LAYER);
	
	/// Hong 07/23/07 QA80-10064 MORE_OPTIONS_FOR_LEGEND_UPDATE	
	//int nMode = (0 == setmode)? -1 : mode;
	//bool bReconstruct = (legend == legend_reconstruct)? true:false;
	//legend_update(gl, mode, true, bReconstruct, custom);	
	GraphPage gp = gl.GetPage();
	*/
	GraphLayer gl;
	GraphPage  gp;
	if(dest_spepage == dest)
	{
		gp=page;
		if(!page.IsValid())
			XF_THROW(XFERR_INVALID_PAGE);
	}
	else
	{
		if(dest_spelayer == dest)
			gl=layer;
		else
			gl = Project.ActiveLayer();
		if(!gl.IsValid())
			XF_THROW(XFERR_INVALID_LAYER);
		gp = gl.GetPage();
	}
	///End SUPPORT_SPECIFY_PAGE_AND_LAYER
	
	bool bReconstruct = (update_reconstruct == update)? true:false;
	
	///Army 07/06/2009 v8.1052 QA80-13651 SUPPORT_SPECIFY_PAGE_AND_LAYER
	//if ( dest_layer == dest )
	if ( dest_layer == dest || dest_spelayer == dest )
	///End SUPPORT_SPECIFY_PAGE_AND_LAYER
	{
		/// Hong QA80-10064 v8.0672 LEGEND_ADD_ORDER_OPTION_WHEN_RECONSTRUCT
		//legend_update(gl, mode, true, bReconstruct, custom);
		legend_update(gl, mode, true, bReconstruct, custom, false, bAscending);
		/// end LEGEND_ADD_ORDER_OPTION_WHEN_RECONSTRUCT
	}
	else
	{
		/// Hong 07/24/07 v8.0666 SUPPORT_UPDATE_ONE_FOR_ALL_LEGEND
		bool bCreate = true;
		bool bOneforAll = is_page_one_legend_for_all(gp);
		if ( bOneforAll )
			bCreate = false;
		/// end SUPPORT_UPDATE_ONE_FOR_ALL_LEGEND
		foreach (gl in gp.Layers)
		{
			/// Hong 07/24/07 v8.0666 SUPPORT_UPDATE_ONE_FOR_ALL_LEGEND
			//legend_update(gl, mode, true, bReconstruct, custom);
			/// Hong QA80-10064 v8.0672 LEGEND_ADD_ORDER_OPTION_WHEN_RECONSTRUCT
			//legend_update(gl, mode, bCreate, bReconstruct, custom, bOneforAll);
			legend_update(gl, mode, bCreate, bReconstruct, custom, bOneforAll, bAscending);
			/// end LEGEND_ADD_ORDER_OPTION_WHEN_RECONSTRUCT
			/// end SUPPORT_UPDATE_ONE_FOR_ALL_LEGEND
		}
		/// Hong 07/24/07 v8.0666 MORE_RELIABLE
		/// Iris 07/26/2007 FIX_RECONSTRUCT_STILL_SHOW_YERR_IN_LEGEND
		//if ( bReconstruct )
		bool bCombine = (legend_combine == legend) ? true : false;
		if ( bReconstruct && bCombine)
		///end FIX_RECONSTRUCT_STILL_SHOW_YERR_IN_LEGEND
		{ // only reconstruct will enable legend
		/// end MORE_RELIABLE
			/// Iris 07/26/2007 FIX_RECONSTRUCT_STILL_SHOW_YERR_IN_LEGEND
			//bool bCombine = (legend_combine == legend) ? true : false;
			///end FIX_RECONSTRUCT_STILL_SHOW_YERR_IN_LEGEND
			
			/// Hong 08/08/07 QA80-10064 FIX_LEGEND_COMBINE_FAIL_KEEP_ORIGIN_ORDER
			//legend_update_text_property(gp, bCombine);
			legend_combine(gp, 0, bAscending);
			/// end FIX_LEGEND_COMBINE_FAIL_KEEP_ORIGIN_ORDER
			
			/// Iris 07/25/2007 SHOULD_CHANGE_LEGEND_POSITION_IN_THIS_XF
			/*
			if ( !bCombine )
			{
				foreach (gl in gp.Layers)
				{
					GraphObject goLegend = gl.GraphObjects(GO_LEGEND_NAME);	
					if(goLegend)
					{
						legend_position(goLegend, true, LEGEND_POS_RIGHT);
						legend_position(goLegend, false, LEGEND_POS_TOP);
					}
				}
			}
			*/
			///end SHOULD_CHANGE_LEGEND_POSITION_IN_THIS_XF
		}
	}	
	/// end MORE_OPTIONS_FOR_LEGEND_UPDATE		
	///end UPDATE_CODES_BY_USING_NEW_FUNCTION
}
/// end ADD_APPLY_BTN]]></header><code NodeID="45" Label="Expression" DataID="325" MultilineEditExpShrink="1" DispFormat="33554432" RowHeightRange="5-20"><![CDATA[/// Hong 07/24/07 v8.0666 ADD_APPLY_BTN
/*
/// Hong 07/23/07 QA80-10064 MORE_OPTIONS_FOR_LEGEND_UPDATE
GraphLayer gl = Project.ActiveLayer();
/// end MORE_OPTIONS_FOR_LEGEND_UPDATE
if(!gl.IsValid())
	XF_THROW(XFERR_INVALID_LAYER);

///Jake 07/20/07 UPDATE_CODES_BY_USING_NEW_FUNCTION
*/	/*	
GraphObject	goLegend = gl.GraphObjects(GO_LEGEND_NAME);
if(!goLegend.IsValid())
{
	legend_update(gl,mode,true);
	return;
}


int nPlotsCount = gl.DataPlots.Count();
int nLegendCount = _get_legend_count(gl);
	
//string strLegendFormat =(mode_custom == mode)? custom : s_vsLegendFormat[mode];
string strLegendFormat;
if(mode_custom == mode)
	strLegendFormat = custom ;
else
	strLegendFormat = s_vsLegendFormat[mode];
	
if(strLegendFormat.IsEmpty())
	XF_THROW(XFERR_INVALID_EXTRA_FORMAT);

if(apply_allplots == apply)//need to update all legend text
{	
	goLegend.Text.Empty();
	for(int ii = 0; ii < nPlotsCount; ii++)
	{
		legend_append_plot(gl,ii,strLegendFormat);
	}
	return; /// Iris 07/19/2007 SHOULD_DIRECTLY_RETURN_IF_RECONSTRUCT_ALL_LEGENDS
}

if(nPlotsCount > nLegendCount)//need append legend
{
	for(int ii = nLegendCount; ii < nPlotsCount; ii++)
	{
		legend_append_plot(gl,ii,strLegendFormat);
	}
}
else if(nPlotsCount <  nLegendCount)//need detele legend
{
	for(int ii = nLegendCount - 1; ii > nPlotsCount - 1; ii--)
	{
		legend_delete_plot(gl,ii);
	}
}
*/	
/*	/// Hong 07/23/07 QA80-10064 MORE_OPTIONS_FOR_LEGEND_UPDATE	
//int nMode = (0 == setmode)? -1 : mode;
//bool bReconstruct = (legend == legend_reconstruct)? true:false;
//legend_update(gl, mode, true, bReconstruct, custom);	
GraphPage gp = gl.GetPage();

bool bReconstruct = (update_reconstruct == update)? true:false;

if ( dest_layer == dest )
{
	legend_update(gl, mode, true, bReconstruct, custom);
}
else
{
	/// Hong 07/24/07 v8.0666 SUPPORT_UPDATE_ONE_FOR_ALL_LEGEND
	bool bCreate = true;
	bool bOneforAll = is_page_one_legend_for_all(gp);
	if ( bOneforAll )
		bCreate = false;
	/// end SUPPORT_UPDATE_ONE_FOR_ALL_LEGEND
	foreach (gl in gp.Layers)
	{
		/// Hong 07/24/07 v8.0666 SUPPORT_UPDATE_ONE_FOR_ALL_LEGEND
		//legend_update(gl, mode, true, bReconstruct, custom);
		legend_update(gl, mode, bCreate, bReconstruct, custom, bOneforAll);
		/// end SUPPORT_UPDATE_ONE_FOR_ALL_LEGEND
	}
	/// Hong 07/24/07 v8.0666 MORE_RELIABLE
	if ( bReconstruct )
	{ // only reconstruct will enable legend
	/// end MORE_RELIABLE
		bool bCombine = (legend_combine == legend) ? true : false;
		
		legend_update_text_property(gp, bCombine);
		
		if ( !bCombine )
		{
			foreach (gl in gp.Layers)
			{
				GraphObject goLegend = gl.GraphObjects(GO_LEGEND_NAME);	
				if(goLegend)
				{
					legend_position(goLegend, true, LEGEND_POS_LEFT);
					legend_position(goLegend, false, LEGEND_POS_TOP);
				}
			}
		}
	}
}	
/// end MORE_OPTIONS_FOR_LEGEND_UPDATE		
///end UPDATE_CODES_BY_USING_NEW_FUNCTION
*/
///Army 07/06/2009 v8.1052 QA80-13651 SUPPORT_SPECIFY_PAGE_AND_LAYER
/*
/// Hong QA80-10064 v8.0672 LEGEND_ADD_ORDER_OPTION_WHEN_RECONSTRUCT
//_legend_update(dest, update, legend, mode, custom);

_legend_update(dest, update, legend, mode, custom, order);
/// end LEGEND_ADD_ORDER_OPTION_WHEN_RECONSTRUCT
*/
_legend_update(dest, update, legend, mode, custom, order, page, layer);
///End SUPPORT_SPECIFY_PAGE_AND_LAYER
/// end ADD_APPLY_BTN	]]></code><event1 NodeID="45" Label="Event1" DataID="327" MultilineEditExpShrink="1" DispFormat="33554432" RowHeightRange="5-20" Show="0"><![CDATA[///Army 07/06/2009 v8.1052 QA80-13651 SUPPORT_SPECIFY_PAGE_AND_LAYER
string strCombo;
if( trGetN.dest && trGetN.dest.GetAttribute(STR_COMBO_ATTRIB, strCombo) )
{
	string str1 = strCombo.GetToken(dest_page,'|');
	string str2 = strCombo.GetToken(dest_layer,'|');		
	string strComboNew = str1 + "|" + str2;
	trGetN.dest.SetAttribute(STR_COMBO_ATTRIB, strComboNew);	
}
///End SUPPORT_SPECIFY_PAGE_AND_LAYER

GraphLayer gl;	
/// Hong 07/23/07 QA80-10064 MORE_OPTIONS_FOR_LEGEND_UPDATE
//okxf_resolve_string_get_origin_object(trGetN.gl.strVal, &gl);
gl = Project.ActiveLayer();
/// end MORE_OPTIONS_FOR_LEGEND_UPDATE
if(!gl.IsValid())
{
	strErrMsg = XFERR_INVALID_LAYER;
	bOKEnable = false;	
	return false;
}	
	
string	strCustomFormat;
int 	nRet = xf_is_theme_applied(trGetN);
///---Sim 09-05-2008 CLEAN_DEFAULT_THEME
//bool 	bRet = ( nEventID == GETNE_ON_THEME && (THEME_NONE == nRet || THEME_FACTORY_DEFAULT == nRet)|| nEventID == GETNE_ON_INIT);
bool 	bRet = ( nEventID == GETNE_ON_THEME && (THEME_NONE == nRet) || nEventID == GETNE_ON_INIT);
///---END CLEAN_DEFAULT_THEME
if(bRet)
{
	GraphPage gp = gl.GetPage();
	
	/// Iris 07/31/2007 v8.0671 ADDED_UTILITY_FUNC_TO_GET_SET_LEGEND_MODE
	/*
	Tree tr;
	tr = gp.GetFormat(FPB_OTHER, FOB_OTHER, true, true);
	
	if( tr.Root.Legends.Type )
		trGetN.mode.nVal = tr.Root.Legends.Type.nVal;
	else
		error_report("fail to get Legends.Type node");	
		
	if(tr.Root.Legends.CustomFormat)
		strCustomFormat = tr.Root.Legends.CustomFormat.strVal;
	*/		
	string strCustomFormat;
	trGetN.mode.nVal = get_page_legend_mode(gp, strCustomFormat);
	///end ADDED_UTILITY_FUNC_TO_GET_SET_LEGEND_MODE
	
	/// Hong 07/24/07 v8.0666 MORE_RELIABLE
	if ( 1 == gp.Layers.Count() )
	{
		trGetN.dest.nVal = dest_page;
		trGetN.dest.Show = false;
	}
	/// end MORE_RELIABLE
}

trGetN.custom.Show = (trGetN.mode.nVal == mode_custom)? true : false;
if ( GETNE_ON_INIT == nEventID )
{
	trGetN.custom.strVal = strCustomFormat;
}

/// Hong 07/23/07 QA80-10064 MORE_OPTIONS_FOR_LEGEND_UPDATE
//trGetN.mode.Enable = trGetN.custom.Enable = trGetN.setmode.nVal; 
if ( GETNE_ON_INIT == nEventID || GETNE_ON_THEME == nEventID )
{
	_update_getn_by_dest(trGetN); 
}
/// end MORE_OPTIONS_FOR_LEGEND_UPDATE

/// Hong 07/24/07 v8.0666 ADD_APPLY_BTN
if ( GETNE_ON_APPLY == nEventID )
{		
	/// Hong QA80-10064 v8.0672 LEGEND_ADD_ORDER_OPTION_WHEN_RECONSTRUCT
	//_legend_update(trGetN.dest.nVal, trGetN.update.nVal, trGetN.legend.nVal, trGetN.mode.nVal, trGetN.custom.strVal);
	_legend_update(trGetN.dest.nVal, trGetN.update.nVal, trGetN.legend.nVal, trGetN.mode.nVal, trGetN.custom.strVal, trGetN.order.nVal);
	/// end LEGEND_ADD_ORDER_OPTION_WHEN_RECONSTRUCT
}
/// end ADD_APPLY_BTN

/// Iris 07/27/2007 IMPROVE_CUSTOM_FORMAT_EDITABLE_COMBO
// this check below is not right since we might support other custom format string later. 
/*
if(0 == lstrcmp(lpcszNodeName, "custom"))
{
	
	if(s_vsCustomLegendFormat.Find(trGetN.custom.strVal) == -1 || trGetN.custom.strVal.IsEmpty())
	{
		bOKEnable = false;
		strErrMsg = XFERR_INVALID_EXTRA_FORMAT;
	}
}
*/
///end IMPROVE_CUSTOM_FORMAT_EDITABLE_COMBO

/// Hong 07/23/07 QA80-10064 MORE_OPTIONS_FOR_LEGEND_UPDATE
if( 0 == lstrcmp(lpcszNodeName, "dest") )
{
	_update_getn_by_dest(trGetN);
}
/// end MORE_OPTIONS_FOR_LEGEND_UPDATE

/// Hong 07/24/07 v8.0666 MORE_RELIABLE
if( 0 == lstrcmp(lpcszNodeName, "update") )
{
	_update_getn_by_update(trGetN);
}
/// end MORE_RELIABLE
	
return true;]]></event1><event2 NodeID="45" Label="Event2" DataID="376" MultilineEditExpShrink="1" DispFormat="33554432" RowHeightRange="5-20" Show="0"><![CDATA[return false;]]></event2><event3 NodeID="45" Label="Event3" DataID="378" MultilineEditExpShrink="1" DispFormat="33554432" RowHeightRange="5-20" Show="0"><![CDATA[///Army 07/06/2009 v8.1052 QA80-13651 SUPPORT_SPECIFY_PAGE_AND_LAYER
if(0 == nGetNDialog)
{
	GraphLayer gl2;
	GraphPage  gp2;
	if(dest_spelayer == trGetN.dest.nVal)
	{
		okxf_resolve_string_get_origin_object(trGetN.layer.strVal, &gl2);
		if(!gl2.IsValid())
		{
			warning_msg_box(XFERR_INVALID_GRAPH_LAYER, false);
			nRet = XFEVT_ABORT;
		}
	}
	if(dest_spepage == trGetN.dest.nVal)
	{
		okxf_resolve_string_get_origin_object(trGetN.page.strVal, &gp2);
		if(!gp2.IsValid())
		{
			warning_msg_box(CER_INVALID_PAGE, false);
			nRet = XFEVT_ABORT;
		}
	}	
}
///End SUPPORT_SPECIFY_PAGE_AND_LAYER
if(nGetNDialog > 0)
{
	GraphLayer gl;
	/// Hong 07/23/07 QA80-10064 MORE_OPTIONS_FOR_LEGEND_UPDATE
	//okxf_resolve_string_get_origin_object(trGetN.gl.strVal, &gl);
	gl = Project.ActiveLayer();
	/// end MORE_OPTIONS_FOR_LEGEND_UPDATE
	if(!gl.IsValid())
		XF_THROW(XFERR_INVALID_LAYER);
	
	/// Hong 07/23/07 QA80-10064 MORE_OPTIONS_FOR_LEGEND_UPDATE				
	_update_getn_by_dest(trGetN);
	/// end MORE_OPTIONS_FOR_LEGEND_UPDATE		
    /*
	// get default legend mode to init "mode" and "custom" control
	int nLegendCount = _get_legend_count(gl);
	string strTypeFormat = legend_get_extra_format(gl, nLegendCount-1);
	
	if(!strTypeFormat.IsEmpty())
	{
		int nIndex = s_vsLegendFormat.Find(strTypeFormat);
		if(nIndex == -1)// is Custom type
		{
			trGetN.mode.nVal = mode_custom;
			trGetN.custom.strVal = strTypeFormat;
		}
		else
			trGetN.mode.nVal = nIndex;
	}
	/// Iris 07/19/2007 INIT_MODE_VAL_FROM_PAGE_SETTINGS
	else //if not specify mode for each legend, then need to read legend mode from Page Details dialog
	{
		
		Tree tr;
		tr = gl.GetPage().GetFormat(FPB_OTHER, FOB_OTHER, true, true);
		
		if( tr.Root.Legends.Type )
			trGetN.mode.nVal = tr.Root.Legends.Type.nVal;			
		else
			error_report("fail to get Legends.Type node");
	}
	//end INIT_MODE_VAL_FROM_PAGE_SETTINGS
	*/
	
	//trGetN.custom.Show = (trGetN.mode.nVal == mode_custom)? true:false;
}]]></event3><GetNEvent NodeID="47" Label="GetNBox Event" DataID="379" Show="0" TypeID="65543" BlobArrElementaryType="8" xmlns:dt="urn:schemas-microsoft-com:datatypes" dt:dt="bin.base64">AA==</GetNEvent></codes><SaveInOpj NodeID="10" Label="Save with Object" DataID="560">0.</SaveInOpj><optargindex NodeID="14" Label="Option Argument Index" DataID="72">0.</optargindex><version NodeID="14" Label="Version" DataID="73">1.</version><category NodeID="11" Label="Primary Category" DataID="74" Show="0">Graph Manipulation</category><subcategory NodeID="11" Label="Primary Subcategory" DataID="77" Show="0"></subcategory><seccategory1 NodeID="11" Label="Secondary Category" DataID="75" Show="0"></seccategory1><secsubcategory1 NodeID="11" Label="Secondary Subcategory 1" DataID="78" Show="0"></secsubcategory1><seccategory2 NodeID="11" Label="Secondary Category 2" DataID="76" Show="0"></seccategory2><secsubcategory2 NodeID="11" Label="Secondary Subcategory 2" DataID="79" Show="0"></secsubcategory2><module NodeID="11" Label="Module" DataID="80"></module><subGroup NodeID="17" Label="Subgroup Index Within a Category" Combo="-10|-9|-8|-7|-6|-5|-4|-3|-2|-1|0|1|2|3|4|5|6|7|8|9" DataID="82">9.</subGroup><errmsgCount NodeID="14" Label="Number of Error Messages" DataID="412">0.</errmsgCount><helpe NodeID="268435456" Label="English Help" DataID="420" RepeatID="256"><info NodeID="41" Label="Auto Complete Hint" DataID="422" RowHeightRange="2-8"></info><summary NodeID="47" Label="Summary" DataID="421" Show="0"><![CDATA[]]></summary><example NodeID="47" Label="Examples" DataID="431" Show="0"><![CDATA[]]></example><ref NodeID="47" Label="References" DataID="432" Show="0"><![CDATA[]]></ref><algorithm NodeID="47" Label="Algorithm" DataID="434" Show="0"><![CDATA[]]></algorithm><parameters NodeID="47" Label="Parameters" DataID="444" Show="0"><![CDATA[]]></parameters><script NodeID="41" Label="LabTalk Script Example" Show="0" DataID="436" RowHeightRange="2-12">/*
This example shows how to update graph legends.

The sample data is exe_path\Samples\Signal Processing\Signal with Shot Noise.dat

1. Load sample data.
2. Plot a line.
3. Use both worksheet long name and unit as legend.
*/

// Get sample data
fn$ = system.path.program$ + "Samples\Signal Processing\Signal with Shot Noise.dat";
newbook;
impASC fn$;

// Plot a line graph
plotxy col(2) plot:=0;

// Update legend;
legendupdate mode:=lu;</script><errmsgs NodeID="47" Label="Error Messages" DataID="413" Show="0"></errmsgs></helpe><helpj NodeID="268435456" Label="Japanese Help" DataID="420" RepeatID="512"><description NodeID="11" Label="Description" DataID="440" CdPg="932">凡例の更新(&amp;G):グラフ/レイヤ上の凡例を更新あるいは再構成する。</description><customButtons NodeID="11" Label="GetN Dialog Custom Buttons" DataID="448" CdPg="932">適用</customButtons><info NodeID="41" Label="Auto Complete Hint" DataID="422" RowHeightRange="2-8" CdPg="932"></info><summary NodeID="47" Label="Summary" DataID="421" Show="0" CdPg="932"><![CDATA[]]></summary><example NodeID="47" Label="Examples" DataID="431" Show="0" CdPg="932"><![CDATA[]]></example><ref NodeID="47" Label="References" DataID="432" Show="0" CdPg="932"><![CDATA[]]></ref><algorithm NodeID="47" Label="Algorithm" DataID="434" Show="0" CdPg="932"><![CDATA[]]></algorithm><parameters NodeID="47" Label="Parameters" DataID="444" Show="0" CdPg="932"><![CDATA[]]></parameters><script NodeID="41" Label="LabTalk Script Example" Show="0" DataID="436" RowHeightRange="2-12" CdPg="932"></script><errmsgs NodeID="47" Label="Error Messages" DataID="413" Show="0" CdPg="932"></errmsgs></helpj><helpg NodeID="268435456" Label="German Help" DataID="420" RepeatID="768"><description NodeID="11" Label="Description" DataID="440" CdPg="1252">Le&amp;gende aktualisieren: Legende auf Diagrammseite/-layer wird aktualisiert oder neu gebildet</description><customButtons NodeID="11" Label="GetN Dialog Custom Buttons" DataID="448" CdPg="1252">Anwenden</customButtons><info NodeID="41" Label="Auto Complete Hint" DataID="422" RowHeightRange="2-8" CdPg="1252"></info><summary NodeID="47" Label="Summary" DataID="421" Show="0" CdPg="1252"><![CDATA[]]></summary><example NodeID="47" Label="Examples" DataID="431" Show="0" CdPg="1252"><![CDATA[]]></example><ref NodeID="47" Label="References" DataID="432" Show="0" CdPg="1252"><![CDATA[]]></ref><algorithm NodeID="47" Label="Algorithm" DataID="434" Show="0" CdPg="1252"><![CDATA[]]></algorithm><parameters NodeID="47" Label="Parameters" DataID="444" Show="0" CdPg="1252"><![CDATA[]]></parameters><script NodeID="41" Label="LabTalk Script Example" Show="0" DataID="436" RowHeightRange="2-12" CdPg="1252"></script><errmsgs NodeID="47" Label="Error Messages" DataID="413" Show="0" CdPg="1252"></errmsgs></helpg><helpc NodeID="268435456" Label="Chinese Help" DataID="420" RepeatID="1024"><description NodeID="11" Label="Description" DataID="440" CdPg="936"></description><customButtons NodeID="11" Label="GetN Dialog Custom Buttons" DataID="448" CdPg="936"></customButtons><info NodeID="41" Label="Auto Complete Hint" DataID="422" RowHeightRange="2-8" CdPg="936"></info><summary NodeID="47" Label="Summary" DataID="421" Show="0" CdPg="936"><![CDATA[]]></summary><example NodeID="47" Label="Examples" DataID="431" Show="0" CdPg="936"><![CDATA[]]></example><ref NodeID="47" Label="References" DataID="432" Show="0" CdPg="936"><![CDATA[]]></ref><algorithm NodeID="47" Label="Algorithm" DataID="434" Show="0" CdPg="936"><![CDATA[]]></algorithm><parameters NodeID="47" Label="Parameters" DataID="444" Show="0" CdPg="936"><![CDATA[]]></parameters><script NodeID="41" Label="LabTalk Script Example" Show="0" DataID="436" RowHeightRange="2-12" CdPg="936"></script><errmsgs NodeID="47" Label="Error Messages" DataID="413" Show="0" CdPg="936"></errmsgs></helpc><SkipHiddenInDlg NodeID="10" Label="Skip hidden in dialog" DataID="295">0.</SkipHiddenInDlg><ClearMsg NodeID="10" Label="Auto Clear Error Message in dialog" DataID="296">1.</ClearMsg><KeepBtnStatus NodeID="10" Label="Keep Button Status for Event Handler" DataID="298">0.</KeepBtnStatus><SptApplyUndoButtonSts NodeID="10" Label="Control Apply and Undo button by User" DataID="294">0.</SptApplyUndoButtonSts><PreviewButton NodeID="10" Label="Show Preview Button" DataID="299">0.</PreviewButton><AutoApplyChkbox NodeID="10" Label="Show Auto Apply CheckBox" DataID="290">1.</AutoApplyChkbox><SkipHelpDoc NodeID="10" Label="Skip Help Document Processing" DataID="297">0.</SkipHelpDoc><seeAlso NodeID="11" Label="See Also" DataID="430"></seeAlso><relatedXF NodeID="11" Label="Related X-Functions" DataID="442"></relatedXF></OriginStorage>
