/* Plugin C3D : Msg3d - part Editor */ /* author : iri - http://www.irizone.net - april 2004 */ typeof ed = PluginEditor;; typeof X = ObjText;; typeof Y = ObjText;; typeof color = I;; typeof class = S;; typeof plugin = S;; proto save=fun [ [Inst r1] ] [[S r1] [S r1] [[S r1]r1] [[S r1]r1]];; fun InstName(UI)= UI.nameInst ;; fun _chooseColor(c)= if color != nil then ( set color = c; 0 ) else 0 ;; fun showColorMap(button, ed) = _CRcolorMap _channel ed.PluginEditorEditWin 5 125 "choose a color" @_chooseColor 0 ;; fun _paintE(a, b)= _PAINTrectangle ed.PluginEditorEditWin 90 55 15 15 DRAW_SOLID 1 0 DRAW_SOLID color;; fun openedit(win, param) = let strextr param -> l in let _GETwindowSizePosition win -> [w h x y] in ( set ed = startPluginEditor _channel win 0 0 w h WN_CHILDINSIDE|WN_NOBORDER class; _CRtext _channel ed.PluginEditorEditWin 5 5 80 20 ET_ALIGN_LEFT "Pos X :"; set X = _CReditLine _channel ed.PluginEditorEditWin 90 5 100 20 ET_ALIGN_LEFT|ET_DOWN|ET_NUMBER let getInfo l "x" -> string in if string == nil then "10" else string; _CRtext _channel ed.PluginEditorEditWin 5 30 80 20 ET_ALIGN_LEFT "Pos Y :"; set Y = _CReditLine _channel ed.PluginEditorEditWin 90 30 100 20 ET_ALIGN_LEFT|ET_DOWN|ET_NUMBER let getInfo l "y" -> string in if string == nil then "10" else string; _CBbutton _CRbutton _channel ed.PluginEditorEditWin 5 55 80 20 ET_ALIGN_LEFT "Color :" @showColorMap ed; let getInfo l "color" -> string in if string == nil then set color = 0 else set color = atoi string; _CBwinPaint ed.PluginEditorEditWin @_paintE nil; 0 ) ;; fun closeedit()= strbuild ("x" ::(_GETtext X)::nil):: ("y" ::(_GETtext Y)::nil):: ("color" ::(itoa color)::nil)::nil ;; fun suppactions(l)= if l == nil then nil else let l -> [UI nl] in let (InstName UI) -> name in ("action"::(strcat class ".broad")::nil):: ("action"::(strcat class ".private")::nil):: (suppactions nl);; fun save(l) = let l -> [UI nl] in let if (InstName UI)==nil then class else InstName UI -> name in [ nil /* registerF */ nil /* register */ ("plugin"::plugin::nil)::nil /* supplemental Dat */ /* dmi */ (suppactions l) ] ;; fun IniPlug(file) = set plugin = file; set class=getInfo strextr _getpack _checkpack file "name"; PlugRegister class @save nil @openedit @closeedit ;;