Commit cf2d7c90 authored by Martin Schreiber's avatar Martin Schreiber

* win32 "Courier New" for stf_fixed, "Courier" is not fully scaleable.

* optionwidget ow_fontglyphheight,ow_fontlineheight,ow_autoscale -> optionwidget1 ow1_fontglyphheight,ow1_fontlineheight,ow1_autoscale.
* IDE fixed grid row heights.
+ quoteescapedstring().
parent e3b4846a
MSEide+MSEgui version history
MSEide+MSEgui breaking changes version history
2012-01-27
optionwidget ow_fontglyphheight,ow_fontlineheight,ow_autoscale ->
optionwidget1 ow1_fontglyphheight,ow1_fontlineheight,ow1_autoscale.
Version 2.8
2012-01-11
2011-12-31
......
......@@ -101,6 +101,7 @@ object objectinspectorfo: tobjectinspectorfo
bounds_x = 0
bounds_y = 1
bounds_cx = 220
bounds_cy = 19
anchors = [an_left, an_top, an_right]
onsetvalue = compselectoronsetvalue
dropdown.options = [deo_selectonly, deo_autodropdown, deo_keydropdown]
......@@ -109,7 +110,7 @@ object objectinspectorfo: tobjectinspectorfo
item
end>
onbeforedropdown = compselectorbeforedropdown
reffontheight = 14
reffontheight = 13
end
object grid: twidgetgrid
frame.localprops = [frl_levelo, frl_colorclient]
......@@ -192,16 +193,17 @@ object objectinspectorfo: tobjectinspectorfo
dataclass = titemeditlist
end>
datarowlinecolor = -1610612731
datarowheight = 16
datarowheight = 15
statfile = mainfo.projectstatfile
onrowsdatachanged = gridrowsdatachanged
oncellevent = gridcellevent
drag.onbeforedragbegin = gridondragbegin
drag.onbeforedragover = gridondragover
drag.onbeforedragdrop = gridondragdrop
reffontheight = 14
reffontheight = 13
object props: ttreeitemedit
optionswidget = [ow_mousefocus, ow_tabfocus, ow_arrowfocus, ow_arrowfocusin, ow_arrowfocusout, ow_destroywidgets, ow_fontglyphheight, ow_autoscale]
optionswidget = [ow_mousefocus, ow_tabfocus, ow_arrowfocus, ow_arrowfocusin, ow_arrowfocusout, ow_destroywidgets, ow_fontglyphheight]
optionswidget1 = [ow1_autoheight]
optionsskin = [osk_noskin]
frame.levelo = 0
frame.colorclient = -2147483646
......@@ -212,12 +214,12 @@ object objectinspectorfo: tobjectinspectorfo
bounds_x = 0
bounds_y = 0
bounds_cx = 90
bounds_cy = 16
bounds_cy = 15
optionsedit = [oe_readonly, oe_undoonesc, oe_closequery, oe_checkmrcancel, oe_resetselectonexit, oe_exitoncursor, oe_hintclippedtext, oe_locate, oe_savestate]
onupdaterowvalues = propupdaterowvalue
options = [teo_treecolnavig, teo_keyrowmoving]
oncheckrowmove = propsoncheckrowmove
reffontheight = 14
reffontheight = 13
end
object values: tmbdropdownitemedit
optionswidget = [ow_mousefocus, ow_tabfocus, ow_arrowfocus, ow_arrowfocusin, ow_arrowfocusout, ow_destroywidgets, ow_fontglyphheight]
......@@ -243,7 +245,7 @@ object objectinspectorfo: tobjectinspectorfo
bounds_x = 91
bounds_y = 0
bounds_cx = 148
bounds_cy = 16
bounds_cy = 15
optionsedit = [oe_undoonesc, oe_closequery, oe_checkmrcancel, oe_forcereturncheckvalue, oe_resetselectonexit, oe_exitoncursor, oe_autoselect, oe_autoselectonfirstclick, oe_hintclippedtext, oe_autopopupmenu, oe_savestate]
font.name = 'stf_default'
font.xscale = 1
......@@ -260,7 +262,7 @@ object objectinspectorfo: tobjectinspectorfo
item
end>
onbeforedropdown = valuesbeforedropdown
reffontheight = 14
reffontheight = 13
end
end
object compedit: tbutton
......@@ -269,12 +271,12 @@ object objectinspectorfo: tobjectinspectorfo
bounds_x = 223
bounds_y = 2
bounds_cx = 19
bounds_cy = 18
bounds_cy = 17
anchors = [an_top, an_right]
state = [as_disabled, as_localdisabled, as_localcaption, as_localhint, as_localonexecute]
caption = 'ED'
onexecute = compeditonexecute
reffontheight = 14
reffontheight = 13
end
object tpopupmenu1: tpopupmenu
onupdate = popupupdate
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -1785,8 +1785,8 @@ begin
fdatalist:= fgridintf.getcol.datalist;
fgriddatalink:= tcustomwidgetgrid1(fgridintf.getgrid).getgriddatalink;
fgridintf.updateeditoptions(foptionsedit);
if (ow_autoscale in foptionswidget) and
(foptionswidget * [ow_fontglyphheight,ow_fontlineheight] <> []) then begin
if (ow1_autoscale in foptionswidget1) and
(foptionswidget1 * [ow1_fontglyphheight,ow1_fontlineheight] <> []) then begin
fgridintf.getcol.grid.datarowheight:= bounds_cy;
end;
end
......
......@@ -26,7 +26,10 @@ uses
{$ifdef mse_with_ifi},mseifiglob{$endif};
const
defaulteditwidgetoptions = defaultoptionswidget+[ow_fontglyphheight,ow_autoscale];
defaulteditwidgetoptions = defaultoptionswidget
{+[ow_fontglyphheight,ow_autoscale]};
defaulteditwidgetoptions1 = defaultoptionswidget1+
[ow1_fontglyphheight,ow1_autoscale];
defaulteditwidgetwidth = 100;
defaulteditwidgetheight = 20;
defaulttextflags = [tf_ycentered,tf_noselect];
......@@ -417,7 +420,8 @@ type
property onpastefromclipboard: updatestringeventty read fonpastefromclipboard
write fonpastefromclipboard;
published
property optionswidget default defaulteditwidgetoptions; //first!
property optionswidget1 default defaulteditwidgetoptions1; //first!
property optionswidget default defaulteditwidgetoptions; //first!
property bounds_cx default defaulteditwidgetwidth;
property bounds_cy default defaulteditwidgetheight;
end;
......@@ -1085,6 +1089,7 @@ begin
end;
maxlength:= -1;
foptionswidget:= defaulteditwidgetoptions;
foptionswidget1:= defaulteditwidgetoptions1;
ftextflags:= defaulttextflags;
ftextflagsactive:= defaulttextflagsactive;
updatetextflags;
......
......@@ -35,7 +35,11 @@ const
texteditminimalframe: framety = (left: 1; top: 0; right: 1; bottom: 0);
defaulttexteditwidgetoptions =
(defaulteditwidgetoptions - [ow_fontglyphheight]) + [ow_fontlineheight];
(defaulteditwidgetoptions
{ - [ow_fontglyphheight]}){ + [ow_fontlineheight]};
defaulttexteditwidgetoptions1 =
(defaulteditwidgetoptions1 - [ow1_fontglyphheight]) +
[ow1_fontlineheight];
type
......@@ -293,6 +297,9 @@ type
property oneditnotifcation: editnotificationeventty read foneditnotification
write foneditnotification;
property oncellevent: celleventty read foncellevent write foncellevent;
published
property optionswidget default defaulttexteditwidgetoptions;
property optionswidget1 default defaulttexteditwidgetoptions1;
end;
ttextedit = class(tcustomtextedit)
......@@ -432,6 +439,7 @@ begin
end;
inherited;
foptionswidget:= defaulttexteditwidgetoptions;
foptionswidget1:= defaulttexteditwidgetoptions1;
optionsedit:= defaulttexteditoptions;
textflags:= defaulttextflags - [tf_noselect];
end;
......@@ -485,8 +493,9 @@ begin
fgridintf:= intf;
if (intf <> nil) then begin
flines:= tgridrichstringdatalist(fgridintf.getcol.datalist);
if (ow_autoscale in foptionswidget) and
(foptionswidget * [ow_fontglyphheight,ow_fontlineheight] <> []) then begin
if (ow1_autoscale in foptionswidget1) and
(foptionswidget1 * [ow1_fontglyphheight,ow1_fontlineheight]
<> []) then begin
fgridintf.getcol.grid.datarowheight:= bounds_cy;
end;
end;
......@@ -641,7 +650,7 @@ end;
procedure tcustomtextedit.initgridwidget;
begin
optionswidget:= optionswidget - [ow_autoscale];
optionswidget1:= optionswidget1 - [ow1_autoscale];
frame:= nil;
with fgridintf.grid do begin
optionsgrid:= optionsgrid + [og_autofirstrow];
......
......@@ -176,11 +176,9 @@ type
procedure updatecellzone(const row: integer; const pos: pointty;
var result: cellzonety); override;
function actualfont: tfont; override;
// procedure cellchanged(const row: integer); override;
property editwidget: twidget read geteditwidget write seteditwidget;
property grid: tcustomwidgetgrid read getgrid;
published
// property datalist;
property datalist stored false; //stored by defineproperties
end;
......@@ -486,7 +484,6 @@ type
treader1 = class(treader);
tcontainer1 = class(twidget)
private
protected
fgrid: tcustomwidgetgrid;
procedure doexit; override;
......@@ -500,7 +497,6 @@ type
procedure widgetregionchanged(const sender: twidget); override;
procedure dochildfocused(const sender: twidget); override;
procedure doenter; override;
// procedure dokeydown(var info: keyeventinfoty); override;
public
constructor create(aowner: tcustomwidgetgrid); reintroduce;
function focusback(const aactivate: boolean = true): boolean; override;
......@@ -550,7 +546,7 @@ procedure defaultinitgridwidget(const awidget: twidget;
begin
with twidget1(awidget) do begin
optionswidget:= optionswidget - [ow_autoscale];
optionswidget1:= optionswidget1 - [ow1_autoscale];
optionsskin:= optionsskin + defaultgridskinoptions;
if (fframe <> nil) then begin
if (ws_staticframe in fwidgetstate) then begin
......@@ -574,7 +570,7 @@ var
widget1: twidget;
begin
with twidget1(sender) do begin
if (ow_autoscale in foptionswidget) and
if (ow1_autoscale in foptionswidget1) and
not (csdesigning in componentstate) then begin
//in designmode widgetsize -> cellsize
if gridintf <> nil then begin
......@@ -2125,7 +2121,7 @@ begin
end;
end;
{ tcontainer }
{ tcontainer1 }
procedure tcontainer1.doexit;
begin
......@@ -2143,6 +2139,26 @@ begin
inherited;
end;
{
procedure tcontainer1.registerchildwidget(const child: twidget);
var
int1: integer;
begin
if ws1_oldautoscale in twidget1(child).fwidgetstate1 then begin
foldautoscale:= true;
end;
if foldautoscale then begin
for int1:= 0 to high(fwidgets) do begin
with twidget1(fwidgets[int1]) do begin
if not (ws1_oldautoscale in fwidgetstate1) then begin
exclude(foptionswidget1,ow1_autoscale);
end;
end;
end;
end;
inherited;
end;
}
{ tfixcontainer }
constructor tfixcontainer.create(aowner: tcustomwidgetgrid);
......@@ -2173,10 +2189,11 @@ var
pt1: pointty;
begin
with self do begin
if not (gs_layoutupdating in grid.fstate) and
(grid.componentstate * [csdesigning,csloading,csdestroying] =
[csdesigning]) and (sender <> nil) and
(twidget1(sender).fparentwidget = self) then begin
if not (gs_layoutupdating in grid.fstate) and (sender <> nil) and
(grid.componentstate * [csdesigning,csdestroying] = [csdesigning]) and
(not (csloading in grid.componentstate) or
(ws1_autoscaling in twidget1(sender).fwidgetstate1)) and
(twidget1(sender).fparentwidget = self) then begin
with grid do begin
cell1:= widgetcell(sender);
if cell1.row <> invalidaxis then begin
......@@ -2268,120 +2285,6 @@ begin
result:= inherited focusback(aactivate);
end;
end;
{
procedure tfixcontainer.dokeydown(var info: keyeventinfoty);
var
cell1: gridcoordty;
int1: integer;
widget1: twidget;
function checkarrowfocus(const awidget: twidget): boolean;
begin
if (awidget <> nil) and (ow_arrowfocus in awidget.optionswidget) and
awidget.canfocus then begin
result:= true;
widget1:= awidget;
end
else begin
result:= false;
end;
end;
begin
with info do begin
cell1:= fgrid.widgetcell(focusedchild);
cell1.row:= cell1.row + fgrid.ffixrows.count; //positive index
widget1:= nil;
include(eventstate,es_processed);
if shiftstate = [] then begin
case key of
key_right: begin
if cell1.col >= 0 then begin
for int1:= cell1.col + 1 to fgrid.datacols.count - 1 do begin
if checkarrowfocus(twidgetcol(fgrid.fdatacols.items[int1]).
ffixrowwidgets[cell1.row]) then begin
break;
end;
end;
if widget1 = nil then begin
for int1:= 0 to fgrid.ffixcols.opositecount - 1 do begin
if checkarrowfocus(twidgetfixcol(fgrid.ffixcols.items[int1]).
ffixrowwidgets[cell1.row]) then begin
break;
end;
end;
if widget1 = nil then begin
for int1:= fgrid.ffixcols.opositecount to fgrid.ffixcols.count - 1 do begin
if checkarrowfocus(twidgetfixcol(fgrid.ffixcols.items[int1]).
ffixrowwidgets[cell1.row]) then begin
break;
end;
end;
if widget1 = nil then begin
for int1:= fgrid.fdatacols.count - 1 downto cell1.col+1 do begin
if checkarrowfocus(twidgetcol(fgrid.fdatacols.items[int1]).
ffixrowwidgets[cell1.row]) then begin
break;
end;
end;
end;
end;
end;
end;
end;
key_left: begin
if cell1.col >= 0 then begin
for int1:= cell1.col - 1 downto 0 do begin
if checkarrowfocus(twidgetcol(fgrid.fdatacols.items[int1]).
ffixrowwidgets[cell1.row]) then begin
break;
end;
end;
if widget1 = nil then begin
for int1:= fgrid.ffixcols.count - 1 downto fgrid.ffixcols.opositecount do begin
if checkarrowfocus(twidgetfixcol(fgrid.ffixcols.items[int1]).
ffixrowwidgets[cell1.row]) then begin
break;
end;
end;
if widget1 = nil then begin
for int1:= fgrid.ffixcols.opositecount - 1 downto 0 do begin
if checkarrowfocus(twidgetfixcol(fgrid.ffixcols.items[int1]).
ffixrowwidgets[cell1.row]) then begin
break;
end;
end;
if widget1 = nil then begin
for int1:= fgrid.fdatacols.count - 1 downto cell1.col+1 do begin
if checkarrowfocus(twidgetcol(fgrid.fdatacols.items[int1]).
ffixrowwidgets[cell1.row]) then begin
break;
end;
end;
end;
end;
end;
end;
end;
else begin
exclude(eventstate,es_processed);
end;
end;
end
else begin
exclude(eventstate,es_processed);
end;
if not (es_processed in eventstate) then begin
inherited;
end
else begin
if widget1 <> nil then begin
widget1.setfocus;
end;
end;
end;
end;
}
{ twidgetdummy }
......@@ -2462,10 +2365,12 @@ var
begin
if not (csdestroying in fgrid.componentstate) then begin
inherited;
if not (gs_layoutupdating in fgrid.fstate) and
(fgrid.componentstate * [csdesigning,csloading] =
[csdesigning]) and (sender <> nil) and (flayoutupdating = 0) and
(twidget1(sender).fparentwidget = self) then begin
if not (gs_layoutupdating in fgrid.fstate) and (sender <> nil) and
(fgrid.componentstate * [csdesigning,csdestroying] = [csdesigning]) and
(not (csloading in fgrid.componentstate) or
(ws1_autoscaling in twidget1(sender).fwidgetstate1)) and
(flayoutupdating = 0) and
(twidget1(sender).fparentwidget = self) then begin
with fgrid do begin
int3:= -1;
for int1:= 0 to datacols.count-1 do begin
......@@ -2708,7 +2613,7 @@ begin
if (cell1.row <> invalidaxis) and (cell1.col <> invalidaxis) and
(cell1.row < 0) then begin
if not checkdescendent(awidget) then begin //new insert
exclude(twidget1(awidget).foptionswidget,ow_autoscale);
exclude(twidget1(awidget).foptionswidget1,ow1_autoscale);
end;
if cell1.col >= 0 then begin
datacols[cell1.col].setfixrowwidget(awidget,cell1.row);
......@@ -2998,7 +2903,6 @@ begin
twidget1(fcontainer3).getchildren(proc,root);
end;
//procedure tcustomwidgetgrid.loaded;
procedure tcustomwidgetgrid.doendread;
var
int1,int2,int3: integer;
......@@ -3060,7 +2964,6 @@ begin
end;
end;
end;
// fwidgetname:= '';
ffixrowwidgetnames:= nil;
end;
end;
......
......@@ -215,7 +215,7 @@ const
//stf_default stf_empty stf_unicode stf_menu stf_message stf_report
(defaultfontname, '', '', '', '', 'Arial',
//stf_proportional stf_fixed,
defaultfontname, 'Courier',
defaultfontname, 'Courier New',
//stf_helvetica stf_roman stf_courier
'Arial', 'Times New Roman', 'Courier New');
......
{ MSEgui Copyright (c) 1999-2006 by Martin Schreiber
{ MSEgui Copyright (c) 1999-2012 by Martin Schreiber
See the file COPYING.MSE, included in this distribution,
for details about the copyright.
......
This diff is collapsed.
{ MSEgui Copyright (c) 1999-2011 by Martin Schreiber
{ MSEgui Copyright (c) 1999-2012 by Martin Schreiber
See the file COPYING.MSE, included in this distribution,
for details about the copyright.
......@@ -431,6 +431,8 @@ function wordatindex(const value: msestring; const index: integer;
function quotestring(value: string; quotechar: char): string; overload;
function quotestring(value: msestring; quotechar: msechar): msestring; overload;
function quoteescapedstring(value: string; quotechar: char): string; overload;
function quoteescapedstring(value: msestring; quotechar: msechar): msestring; overload;
function unquotestring(value: string; quotechar: char): string; overload;
function unquotestring(value: msestring; quotechar: msechar): msestring; overload;
function extractquotedstr(const value: msestring): msestring;
......@@ -2688,6 +2690,71 @@ begin
end;
end;
const
escapechar = '\';
function quoteescapedstring(value: string; quotechar: char): string;
var
ps,pd,pe: pchar;
begin
setlength(result,length(value)*2+2); //max
pd:= pchar(pointer(result));
pd^:= quotechar;
inc(pd);
if value <> '' then begin
ps:= pchar(pointer(value));
pe:= ps+length(value);
while ps < pe do begin
pd^:= ps^;
if ps^ = quotechar then begin
pd^:= escapechar;
inc(pd);
pd^:= quotechar;
end;
if ps^ = escapechar then begin
inc(pd);
pd^:= escapechar;
end;
inc(pd);
inc(ps);
end;
end;
pd^:= quotechar;
inc(pd);
setlength(result,pd-pchar(pointer(result)));
end;
function quoteescapedstring(value: msestring; quotechar: msechar): msestring;
var
ps,pd,pe: pmsechar;
begin
setlength(result,length(value)*2+2); //max
pd:= pmsechar(pointer(result));
pd^:= quotechar;
inc(pd);
if value <> '' then begin
ps:= pmsechar(pointer(value));
pe:= ps+length(value);
while ps < pe do begin
pd^:= ps^;
if ps^ = quotechar then begin
pd^:= escapechar;
inc(pd);
pd^:= quotechar;
end;
if ps^ = escapechar then begin
inc(pd);
pd^:= escapechar;
end;
inc(pd);
inc(ps);
end;
end;
pd^:= quotechar;
inc(pd);
setlength(result,pd-pmsechar(pointer(result)));
end;
function unquotestring(value: msestring;
quotechar: msechar): msestring; overload;
var
......
......@@ -29,8 +29,10 @@ const
defaultdispwidgetwidth = 100;
defaultdispwidgetheight = 20;
defaultdispwidgetoptions = (defaultoptionswidget -
[ow_mousefocus,ow_tabfocus,ow_arrowfocus]) +
[ow_fontglyphheight];
[ow_mousefocus,ow_tabfocus,ow_arrowfocus]){ +
[ow_fontglyphheight]};
defaultdispwidgetoptions1 = defaultoptionswidget1 + [ow1_fontglyphheight];
type
......@@ -161,6 +163,7 @@ type
property textflags: textflagsty read ftextflags write settextflags
default defaultdisptextflags;
property optionswidget default defaultdispwidgetoptions;
property optionswidget1 default defaultdispwidgetoptions1;
property options: dispwidgetoptionsty read foptions write setoptions default [];
end;
......@@ -406,6 +409,7 @@ constructor tdispwidget.create(aowner: tcomponent);
begin
inherited;
foptionswidget:= defaultdispwidgetoptions;
foptionswidget1:= defaultdispwidgetoptions1;
fwidgetrect.cx:= defaultdispwidgetwidth;
fwidgetrect.cy:= defaultdispwidgetheight;
ftextflags:= defaultdisptextflags;
......
......@@ -190,7 +190,9 @@ const
fastrepeat = 100000; //us
defaultgridwidgetoptions = defaultoptionswidgetmousewheel +
[ow_focusbackonesc,ow_fontglyphheight];
[ow_focusbackonesc{,ow_fontglyphheight}];
defaultgridwidgetoptions1 = defaultoptionswidget1 +
[ow1_fontglyphheight];
type
tgridexception = class(exception);
......@@ -2359,6 +2361,7 @@ type
property wheelscrollheight: integer read fwheelscrollheight write
fwheelscrollheight default defaultwheelscrollheight;
property optionswidget default defaultgridwidgetoptions;
property optionswidget1 default defaultgridwidgetoptions1;
end;
tcellgrid = class(tcustomgrid)
......@@ -8823,6 +8826,7 @@ begin
fobjectpicker:= tobjectpicker.create(iobjectpicker(self));
// fobjectpicker.options:= fobjectpicker.options + [opo_candoubleclick];
foptionswidget:= defaultgridwidgetoptions;
foptionswidget1:= defaultgridwidgetoptions1;
exclude(fstate,gs_updatelocked);
internalupdatelayout;
end;
......@@ -13916,7 +13920,7 @@ end;
procedure tcustomgrid.dofontheightdelta(var delta: integer);
begin
if ow_autoscale in optionswidget then begin
if ow1_autoscale in optionswidget1 then begin
ffixrows.dofontheightdelta(delta);
end;
end;
......@@ -15661,7 +15665,7 @@ end;
procedure tcustomstringgrid.dofontheightdelta(var delta: integer);
begin
inherited;
if ow_autoscale in foptionswidget then begin
if ow1_autoscale in foptionswidget1 then begin
datarowheight:= datarowheight + delta;
end;
end;
......@@ -15764,7 +15768,7 @@ end;
procedure tcustomstringgrid.synctofontheight;
begin
inherited;
if ow_fontlineheight in optionswidget then begin
if ow1_fontlineheight in optionswidget1 then begin
datarowheight:= font.lineheight;
end
else begin
......
......@@ -23,10 +23,11 @@ const
defaultbuttonwidth = 50;
defaultbuttonheight = 20;
defaultlabeltextflags = [tf_ycentered];
defaultlabeloptionswidget = (defaultoptionswidget +
[ow_fontglyphheight{,ow_autosize}]) -
defaultlabeloptionswidget = (defaultoptionswidget {+
[ow_fontglyphheight]}) -
[ow_mousefocus,ow_tabfocus,ow_arrowfocus];
defaultlabeloptionswidget1 = [ow1_autowidth,ow1_autoheight];
defaultlabeloptionswidget1 = defaultoptionswidget1 +
[ow1_autowidth,ow1_autoheight,ow1_fontglyphheight];
defaultlabelwidgetwidth = 100;
defaultlabelwidgetheight = 20;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment