From: <mie...@us...> - 2008-08-15 00:30:08
|
Revision: 2967 http://oorexx.svn.sourceforge.net/oorexx/?rev=2967&view=rev Author: miesfeld Date: 2008-08-15 00:30:17 +0000 (Fri, 15 Aug 2008) Log Message: ----------- [ 2022005 ] Update the ooDialog Static control Modified Paths: -------------- main/trunk/extensions/platform/windows/oodialog/dyndlg.cls main/trunk/extensions/platform/windows/oodialog/msgext.cls main/trunk/extensions/platform/windows/oodialog/oovuser.cpp Modified: main/trunk/extensions/platform/windows/oodialog/dyndlg.cls =================================================================== --- main/trunk/extensions/platform/windows/oodialog/dyndlg.cls 2008-08-14 21:48:27 UTC (rev 2966) +++ main/trunk/extensions/platform/windows/oodialog/dyndlg.cls 2008-08-15 00:30:17 UTC (rev 2967) @@ -214,7 +214,6 @@ if style~wordpos("SS_RIGHTJUST") > 0 then ret = ret || " RIGHTJUST" if style~wordpos("SS_REALSIZECONTROL") > 0 then ret = ret || " SIZECONTROL" if style~wordpos("SS_REALSIZEIMAGE") > 0 then ret = ret || " SIZEIMAGE" - if style~wordpos("SS_SIMPLE") > 0 then ret = ret || " SIMPLE" if style~wordpos("SS_SUNKEN") > 0 then ret = ret || " SUNKEN" if style~wordpos("SS_WORDELLIPSIS") > 0 then ret = ret || " WORDELLIPSIS" @@ -417,10 +416,11 @@ if s~wordpos("CONTROL") > 0 then do - parse var s type '"'name'"' "," id "," class "," style "," x "," y "," w "," h + parse var s type '"'name'"' "," id "," class "," style "," x "," y "," w "," h "," extStyle opts = "" class = class~strip~translate style = style~translate(" ", "|") + extStyle = extStyle~translate(" ", "|") select when class = '"BUTTON"' then do if style~wordpos("BS_AUTORADIOBUTTON") > 0 | style~wordpos("BS_RADIOBUTTON") > 0 then @@ -460,11 +460,11 @@ when style~wordpos("SS_BLACKFRAME") > 0 then self~AddBlackFRAME(x, y, w, h, opts, id) when style~wordpos("SS_ETCHEDFRAME") > 0 then - self~AddStatic(id, x, y, w, h, "ETCHED " || opts) + self~AddEtchedFrame(x, y, w, h, opts, id) when style~wordpos("SS_ETCHEDHORZ") > 0 then - self~AddStatic(id, x, y, w, h, "HORZ " || opts) + self~AddEtchedHorizonatlFrame(x, y, w, h, opts, id) when style~wordpos("SS_ETCHEDVERT") > 0 then - self~AddStatic(id, x, y, w, h, "VERT " || opts) + self~AddEtchedVerticalFrame(x, y, w, h, opts, id) when style~wordpos("SS_BITMAP") > 0 then self~AddImage(id, x, y, w, h, "BITMAP " || opts) when style~wordpos("SS_ENHMETAFILE") > 0 then @@ -516,10 +516,11 @@ end /* select 2*/ end else do - parse var s type '"'name'"' "," id "," x "," y "," w "," h "," style - if id~space(0) = "" then parse var s type id "," x "," y "," w "," h "," style + parse var s type '"'name'"' "," id "," x "," y "," w "," h "," style "," extStyle + if id~space(0) = "" then parse var s type id "," x "," y "," w "," h "," style "," extStyle type = type~strip~translate style = style~translate(" ", "|") + extStyle = extStyle~translate(" ", "|") select when type = "DEFPUSHBUTTON" | type = "PUSHBUTTON" then @@ -617,30 +618,62 @@ self~AktPtr = UsrAddControl("GB",self~AktPtr, x, y, cx, cy, opts, text, id) +::method AddStatic + use arg id = (-1), x, y, cx = 0, cy = 0, options, text = "" + argA = .array~new + options = self~GetDefaultOpts(options) + argA[1] = x + argA[2] = y + argA[3] = cx + argA[4] = cy + argA[5] = options + argA[6] = id + select + when options~wordpos("WHITERECT") > 0 then return self~InternAddStatic(argA, 0) + when options~wordpos("GRAYRECT") > 0 then return self~InternAddStatic(argA, 1) + when options~wordpos("BLACKRECT") > 0 then return self~InternAddStatic(argA, 2) + when options~wordpos("WHITEFRAME") > 0 then return self~InternAddStatic(argA, 3) + when options~wordpos("GRAYFRAME") > 0 then return self~InternAddStatic(argA, 4) + when options~wordpos("BLACKFRAME") > 0 then return self~InternAddStatic(argA, 5) + when options~wordpos("ETCHED") > 0 then return self~InternAddStatic(argA, 6) + when options~wordpos("HORZ") > 0 then return self~InternAddStatic(argA, 7) + when options~wordpos("VERT") > 0 then return self~InternAddStatic(argA, 8) + + when options~wordpos("BITMAP") > 0 then forward message "AddImage" + when options~wordpos("METAFILE") > 0 then forward message "AddImage" + when options~wordpos("ICON") > 0 then forward message "AddImage" + + when options~wordpos("LEFT") > 0 then return self~addText(x, y, cx, cy, text, options, id) + when options~wordpos("RIGHT") > 0 then return self~addText(x, y, cx, cy, text, options, id) + when options~wordpos("CENTER") > 0 then return self~addText(x, y, cx, cy, text, options, id) + when options~wordpos("SIMPLE") > 0 then return self~addText(x, y, cx, cy, text, options, id) + when options~wordpos("LEFTNOWRAP") > 0 then return self~addText(x, y, cx, cy, text, options, id) + otherwise return -1 + end + -- End select + + return 0 + +::method AddImage + use arg id, x, y, cx, cy, options + id = self~ItemAdd(id) + if id < 0 then return id + options = self~GetDefaultOpts(options) + self~AktPtr = UsrAddControl("IMG", self~AktPtr, id, x, y, cx, cy, options) + ::method AddText - use arg x, y, cx, cy, text, opts, id - if Arg(5, 'o') = 1 then return 1 - if Arg(3, 'o') = 1 then cx = 0 - if Arg(4, 'o') = 1 then cy = 0 + use arg x, y, cx = 0, cy = 0, text = "", opts, id = (-1) + if cx = 0 | cy = 0 then do parse value GetStdTextSize(text) with icx icy if cx = 0 then cx = icx+2 if cy = 0 then cy = icy end - id = self~ItemAdd(id, \(Arg(7,"o") | id = "ID")) + id = self~ItemAdd(id) if id = -2 then return id opts = self~GetDefaultOpts(opts) self~AktPtr = UsrAddControl("TXT", self~AktPtr, x, y, cx, cy, opts, text, id) - - - -::method InternAddStatic - use arg arga, type - if arga~hasindex(6) = 0 then id = self~ItemAdd(-1, 0); else id = self~ItemAdd(arga[6],1) - if id = -2 then return id - opts = self~GetDefaultOpts(arga[5]) - self~AktPtr = UsrAddControl("FRM", self~AktPtr, arga[1], arga[2], arga[3], arga[4], type, opts, id) return 0 ::method AddWhiteRect @@ -661,38 +694,23 @@ ::method AddBlackFrame return self~InternAddStatic(Arg(1,"A"), 5) -::method AddStatic - use arg id, x, y, cx, cy, options - arga = .array~new - options = self~GetDefaultOpts(options) - arga[1] = x - arga[2] = y - arga[3] = cx - arga[4] = cy - arga[5] = options - if arg(1, 'E') then arga[6] = id +::method AddEtchedFrame + return self~InternAddStatic(Arg(1,"A"), 6) - select - when options~wordpos("WHITERECT") > 0 then return self~InternAddStatic(arga, 0) - when options~wordpos("GRAYRECT") > 0 then return self~InternAddStatic(arga, 1) - when options~wordpos("BLACKRECT") > 0 then return self~InternAddStatic(arga, 2) - when options~wordpos("WHITEFRAME") > 0 then return self~InternAddStatic(arga, 3) - when options~wordpos("GRAYFRAME") > 0 then return self~InternAddStatic(arga, 4) - when options~wordpos("BLACKFRAME") > 0 then return self~InternAddStatic(arga, 5) - when options~wordpos("ETCHED") > 0 then return self~InternAddStatic(arga, 6) - when options~wordpos("HORZ") > 0 then return self~InternAddStatic(arga, 7) - when options~wordpos("VERT") > 0 then return self~InternAddStatic(arga, 8) - otherwise return -1 - end - -- End select +::method AddEtchedHorizontalFrame + return self~InternAddStatic(Arg(1,"A"), 7) -::method AddImage - use arg id, x, y, cx, cy, options - id = self~ItemAdd(id) - if id < 0 then return id - options = self~GetDefaultOpts(options) - self~AktPtr = UsrAddControl("IMG", self~AktPtr, id, x, y, cx, cy, options) +::method AddEtchedVerticalFrame + return self~InternAddStatic(Arg(1,"A"), 8) +::method InternAddStatic private + use arg arga, type + if arga~hasindex(6) = 0 then id = self~ItemAdd(-1, 0); else id = self~ItemAdd(arga[6],1) + if id = -2 then return id + opts = self~GetDefaultOpts(arga[5]) + self~AktPtr = UsrAddControl("FRM", self~AktPtr, arga[1], arga[2], arga[3], arga[4], type, opts, id) + return 0 + ::method AddEntryLine use arg id, fname, x, y, cx, cy, opts symbid = id Modified: main/trunk/extensions/platform/windows/oodialog/msgext.cls =================================================================== --- main/trunk/extensions/platform/windows/oodialog/msgext.cls 2008-08-14 21:48:27 UTC (rev 2966) +++ main/trunk/extensions/platform/windows/oodialog/msgext.cls 2008-08-15 00:30:17 UTC (rev 2967) @@ -284,9 +284,9 @@ if Arg(3,'o') = 1 then msgToRise = "On" || type type = type~translate select - when type = "KEYDOWN" then lp = -550 - when type = "SELCHANGE" then lp = -551 - when type = "SELCHANGING" then lp = -552 + when type = "KEYDOWN" then lp = -550 + when type = "SELCHANGE" then lp = -551 + when type = "SELCHANGING" then lp = -552 otherwise return -1 end return self~AddUserMsg(msgToRise, 0x0000004E, "0xFFFFFFFF", id, "0xFFFFFFFF", lp, "0xFFFFFFFF") @@ -302,15 +302,15 @@ if Arg(3,'o') = 1 then msgToRise = "On" || type type = type~translate select - when type = "UP" then wp =0 - when type = "DOWN" then wp =1 - when type = "PAGEUP" then wp =2 - when type = "PAGEDOWN" then wp =3 - when type = "POSITION" then wp =4 - when type = "DRAG" then wp =5 - when type = "TOP" then wp =6 - when type = "BOTTOM" then wp =7 - when type = "ENDTRACK" then wp =8 + when type = "UP" then wp =0 + when type = "DOWN" then wp =1 + when type = "PAGEUP" then wp =2 + when type = "PAGEDOWN" then wp =3 + when type = "POSITION" then wp =4 + when type = "DRAG" then wp =5 + when type = "TOP" then wp =6 + when type = "BOTTOM" then wp =7 + when type = "ENDTRACK" then wp =8 otherwise return -1 end ret = self~AddUserMsg(msgToRise, 0x00000114, "0xFFFFFFFF", wp, "0x0000FFFF", hwnd, "0xFFFFFFFF") /* WM_HSCROLL */ @@ -318,6 +318,22 @@ return self~AddUserMsg(msgToRise, 0x00000115, "0xFFFFFFFF", wp, "0x0000FFFF", hwnd, "0xFFFFFFFF") /* WM_VSCROLL */ +::method connectStaticNotify + use strict arg id, type, msgToRaise = "" + if \ id~DataType("W") then id = self~ResolveSymbolicId(id) + if id = -1 then return -1 + if msgToRaise == "" then msgToRaise = "On" || type + type = type~translate + select + when type = "CLICK" then lp = 0 + when type = "DBLCLK" then lp = 1 + when type = "ENABLE" then lp = 2 + when type = "DISABLE" then lp = 3 + otherwise return -1 + end + return self~AddUserMsg(msgToRaise, 0x00000111, "0xFFFFFFFF", lp~x2d * X2D("10000") + id, "0xFFFFFFFF", 0, 0) + + ::method DefTreeEditStarter use arg id, dummy, category if Arg(3,'o') = 1 then tc = self~GetTreeControl(id) Modified: main/trunk/extensions/platform/windows/oodialog/oovuser.cpp =================================================================== --- main/trunk/extensions/platform/windows/oodialog/oovuser.cpp 2008-08-14 21:48:27 UTC (rev 2966) +++ main/trunk/extensions/platform/windows/oodialog/oovuser.cpp 2008-08-15 00:30:17 UTC (rev 2967) @@ -733,38 +733,6 @@ /* id x y cx cy */ UAddControl(&p, 0x0081, buffer[0], buffer[1], buffer[2], buffer[3], buffer[4], NULL, lStyle); } - else if (!strcmp(argv[0].strptr,"TXT")) - { - CHECKARGL(8); - - /* UsrAddControl("TXT", self~AktPtr, x, y, cx, cy, opts, text, id) */ - for ( i = 0; i < 4; i++ ) - { - buffer[i] = atoi(argv[i+2].strptr); - } - - p = (WORD *)GET_POINTER(argv[1]); - - if (argc > 8) - i = atoi(argv[8].strptr); - else i = -1; - - lStyle = WS_CHILD; - if (strstr(argv[6].strptr,"CENTER")) lStyle |= SS_CENTER; - else if (strstr(argv[6].strptr,"RIGHT")) lStyle |= SS_RIGHT; - else if (strstr(argv[6].strptr,"SIMPLE")) lStyle |= SS_SIMPLE; - else if (strstr(argv[6].strptr,"LEFTNOWRAP")) lStyle |= SS_LEFTNOWORDWRAP; - else lStyle |= SS_LEFT; - - if (!strstr(argv[6].strptr,"HIDDEN")) lStyle |= WS_VISIBLE; - if (strstr(argv[6].strptr,"GROUP")) lStyle |= WS_GROUP; - if (strstr(argv[6].strptr,"DISABLED")) lStyle |= WS_DISABLED; - if (strstr(argv[6].strptr,"BORDER")) lStyle |= WS_BORDER; - if (strstr(argv[6].strptr,"TAB")) lStyle |= WS_TABSTOP; - - /* id x y cx cy */ - UAddControl(&p, 0x0082, i, buffer[0], buffer[1], buffer[2], buffer[3], argv[7].strptr, lStyle); - } else if (!strcmp(argv[0].strptr,"LB")) { CHECKARG(8); @@ -826,6 +794,46 @@ /* id x y cx cy */ UAddControl(&p, 0x0085, buffer[0], buffer[1], buffer[2], buffer[3], buffer[4], NULL, lStyle); } + else if (!strcmp(argv[0].strptr,"TXT")) + { + CHECKARGL(8); + + /* UsrAddControl("TXT", self~AktPtr, x, y, cx, cy, opts, text, id) */ + for ( i = 0; i < 4; i++ ) + { + buffer[i] = atoi(argv[i+2].strptr); + } + + p = (WORD *)GET_POINTER(argv[1]); + + if (argc > 8) + i = atoi(argv[8].strptr); + else i = -1; + + lStyle = WS_CHILD; + if (strstr(argv[6].strptr,"CENTER")) lStyle |= SS_CENTER; + else if (strstr(argv[6].strptr,"RIGHT")) lStyle |= SS_RIGHT; + else if (strstr(argv[6].strptr,"SIMPLE")) lStyle |= SS_SIMPLE; + else if (strstr(argv[6].strptr,"LEFTNOWRAP")) lStyle |= SS_LEFTNOWORDWRAP; + else lStyle |= SS_LEFT; + + if (strstr(argv[6].strptr,"NOTIFY")) lStyle |= SS_NOTIFY; + if (strstr(argv[6].strptr,"SUNKEN")) lStyle |= SS_SUNKEN; + if (strstr(argv[6].strptr,"EDITCONTROL")) lStyle |= SS_EDITCONTROL; + if (strstr(argv[6].strptr,"ENDELLIPSIS")) lStyle |= SS_ENDELLIPSIS; + if (strstr(argv[6].strptr,"NOPREFIX")) lStyle |= SS_NOPREFIX; + if (strstr(argv[6].strptr,"PATHELLIPSIS")) lStyle |= SS_PATHELLIPSIS; + if (strstr(argv[6].strptr,"WORDELLIPSIS")) lStyle |= SS_WORDELLIPSIS; + + if (!strstr(argv[6].strptr,"HIDDEN")) lStyle |= WS_VISIBLE; + if (strstr(argv[6].strptr,"GROUP")) lStyle |= WS_GROUP; + if (strstr(argv[6].strptr,"DISABLED")) lStyle |= WS_DISABLED; + if (strstr(argv[6].strptr,"BORDER")) lStyle |= WS_BORDER; + if (strstr(argv[6].strptr,"TAB")) lStyle |= WS_TABSTOP; + + /* id x y cx cy */ + UAddControl(&p, 0x0082, i, buffer[0], buffer[1], buffer[2], buffer[3], argv[7].strptr, lStyle); + } else if (!strcmp(argv[0].strptr,"FRM")) { CHECKARGL(8); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |