/* TOOLVERT (GED) -- GED Sample Toolbar Vertically Oriented */ /* TOOLVERT (GED) -- GED Beispieltoolbar mit vertikaler Orientierung */ /* // Copyright (c) 2007 Oliver Bartels F+E, Erding // Author: Roman Ludwig // Changes History: // rl (071204) ORIGINAL CODING. // // DESCRIPTION // // The toolvert User Language program creates a permanently visible // vertically oriented toolbar with a series of function buttons. // The sample draw function action sequences are extended to automatically // select documentary layer 1 side 2. For the arrow functions the arrow width // is set to 0.5mm and the arrow drawing is terminated after the first arrow. */ // Enforce GED caller type as no GED specific ULC system functions are used #pragma ULCALLERGED // Includes #include "pop.ulh" // User Language popup utilities // Messages string UPRBOXNAME = M("Bemassung","Measurement"); string UPRBUTTON1 = M("&Distanz","&Distance"); string UPRBUTTON2 = M("&Flaeche","&Area"); string UPRBUTTON3 = M("&Winkel","A&ngle"); string UPRBUTTON4 = M("&Lineal","&Ruler"); string UPRBUTTON5 = M("&Pfeillinie","Arrow &Outline"); string UPRBUTTON6 = M("Pf&eilflaeche","Arrow &Filled"); string ERRNOWIN = M("Nur in Windowsumgebungen verfuegbar!", "Windows Environment needed!"); string ERRDBLTOOL = M("Toolbarfunktion ist bereits aktiv!", "Double invocation of toolbar function!"); // Toolbar configuration definitions #define OWNPROGNAME "toolvert" // Own ULC program name #define BOXID 2000 // Dialog box ID for position storage #define BUTWIDTH 10.0 // Dialog box button width // Global definitions struct butdesc { // Toolbar button descriptor string name /* Toolbar button name */; string actseq /* Toolbar button action secquence */; }; struct butdesc butl[] = { // Toolbar button list { UPRBUTTON1, "gedpoly:s10:s3:'d1s2'" }, { UPRBUTTON2, "gedpoly:s10:s4:'d1s2'" }, { UPRBUTTON3, "gedpoly:s10:s5:'d1s2'" }, { UPRBUTTON4, "gedpoly:s10:s6:'d1s2'" }, { UPRBUTTON5, "gedpoly:s10:s2:s1:'d1s2':'0.5 mm':m:m:mr:sl9" }, { UPRBUTTON6, "gedpoly:s10:s2:s0:ol4:'d1s2':'0.5 mm':m:m:mr:sl9" } }; int butn = arylength(butl) /* Toolbar button count */; // Main program void main() { double cy = DIAL_TOPMARG /* Dialog box current y coordinate */; string varname /* Variable name */; int boxidx /* Dialog box index */; int actcode /* Action code */; int reason /* Callback reason */; int intval /* Dialog box item integer value */; int i /* Loop control variable */; // Check if action call if (varget(VAR_PDBOXIDX,boxidx)==0 && varget(VAR_PDBOXACT,actcode)==0 && varget(VAR_PDBOXREAS,reason)==0) { if (actcode>0 && actcode<=butn) { // Perform requested action ulsystem(butl[actcode-1].actseq,0); } else { // Abort, remove dialog box bae_dialsetcurrent(boxidx); bae_dialclr(); bae_dialsetcurrent(0); } exit(0); } // Check if dialog box support if (bae_dialclr()) error(ERRNOWIN); // Store action buttons for (i=0;i