diff --git a/designer/tslvcldesigner.tsf b/designer/tslvcldesigner.tsf index 57fcc78..f6cbd59 100644 --- a/designer/tslvcldesigner.tsf +++ b/designer/tslvcldesigner.tsf @@ -1433,7 +1433,7 @@ type TVclDesigner = class(tvcform) ic.Readvcon(HexFormatStrToTsl(GetTsIconBitmapInfo())); self.FormICon := ic; //文件打窗口 - FProjectFileOpener := new TOpenFileADlg(self); + FProjectFileOpener := new TSavefileADlg(self); FProjectFileOpener.filter := array("tvcl工程":"*.tpj"); FProjectFileOpener.parent := self; FProjectManager.FTslEditer.setdbugruncall(thisfunction(debugproject)); //设置调试回调 diff --git a/designer/utslvcldcomponents.tsf b/designer/utslvcldcomponents.tsf index bba52d8..bd39010 100644 --- a/designer/utslvcldcomponents.tsf +++ b/designer/utslvcldcomponents.tsf @@ -318,6 +318,7 @@ type TDComponent = class() dm := MessageBoxA("即将剪切:"+nd.Caption,"删除",(0x1 .| 0x30),nd.owner);// end else dm := MessageBoxA("即将删除:"+nd.Caption,"删除",(0x1 .| 0x30),nd.owner);// if dm<>1 then exit; + if not nd.owner then exit; d := nd.owner.Designer; if f then d.cutnode(nd); diff --git a/designer/utslvcldpropertytypes.tsf b/designer/utslvcldpropertytypes.tsf index 4a2352b..2584ac2 100644 --- a/designer/utslvcldpropertytypes.tsf +++ b/designer/utslvcldpropertytypes.tsf @@ -1502,6 +1502,8 @@ type TGridCellNaturalEdit = class(TGridPropertyRender,TPropertyNatural) function Ched(o,e); begin v := textonumber(o.TEXT); + if flastvalue = v then return ; + flastvalue := v; FGrid.CellChanged(FRow,FCol,"value",v); //o.parent.CallChanged(o.parent,nil); end @@ -1562,10 +1564,12 @@ type TGridCellNaturalEdit = class(TGridPropertyRender,TPropertyNatural) @explan(说明) 离开编辑格子 %% **} if not(FEdit is class(TPopEditCtrl)) then exit; - FEdit.text := ""; + //FEdit.text := ""; FEdit.visible := false; inherited; end; + private + flastvalue; end type TGridCellIntegerEdit = class(TGridCellNaturalEdit) @@ -2478,7 +2482,7 @@ type UniCheckList = class(TTreeView) // if nit >=0 then begin inherited; - if CurrentNode<>nit then + if CurrentNode and CurrentNode<>nit then begin DoOnSelChang(CurrentNode._tag); end diff --git a/funcext/tvclib/ugtkinterface.tsf b/funcext/tvclib/ugtkinterface.tsf index fcf7b51..64c14d2 100644 --- a/funcext/tvclib/ugtkinterface.tsf +++ b/funcext/tvclib/ugtkinterface.tsf @@ -800,7 +800,7 @@ type tsgtkapi = class(tgtkapis) fc := ftod["facename"]; ht := ftod["height"]; wd := ftod["width"]; - it := ftod["italic"]; + it := 0;//ftod["italic"]; wt := ftod["weight"]=700; udl := ftod["underline"]; fnotset := false; @@ -2229,16 +2229,16 @@ type tsgtkapi = class(tgtkapis) cairo_scale(hdc,p1,p2); cairo_set_source_surface(hdc, img, 0, 0); cairo_rectangle(hdc,0,0,rc[2]-rc[0],rc[3]-rc[1]); - if flag = 0x8800c6 or flag = 0x4 then + if flag = 0x8800c6 or flag = 0x4 then //添加alpha处理 begin //echo "\r\nset alopha*******+++****************"; - //cairo_paint_with_alpha(hdc,0.5); - //cairo_set_source_rgba(hdc, 0.6, 0.6, 0.6, 0.5); + cairo_paint_with_alpha(hdc,0.5); + cairo_set_source_rgba(hdc, 0.6, 0.6, 0.6, 0.5); end else begin //cairo_paint_with_alpha(hdc,0); - //cairo_paint_with_alpha(hdc,1); - //cairo_set_source_rgba(hdc, 1.0, 1.0, 1.0, 0); + cairo_paint_with_alpha(hdc,1); + cairo_set_source_rgba(hdc, 1.0, 1.0, 1.0, 0); end cairo_fill(hdc); cairo_scale(hdc,1/p1,1/p2); @@ -2546,7 +2546,7 @@ type tsgtkapi = class(tgtkapis) mulsel := false; if obj._getvalue_("flags") .& 0x200 then mulsel := true; //echo "\r\n>>>", obj._getvalue_("nmaxfiletitle"); - opaction := g_open_file_flag?false:true; //打开或者save + opaction := g_open_file_flag?false:true; //打开或者save cdlg := gtk_file_chooser_dialog_new("file selector",wd,opaction,"open",GTK_RESPONSE_ACCEPT,"cancel",GTK_RESPONSE_CANCEL,nil); if mulsel then begin @@ -2555,7 +2555,7 @@ type tsgtkapi = class(tgtkapis) dfdir := obj._getvalue_("lpstrinitialdir"); if dfdir then //默认位置 begin - df := ReadStringFromPtr(dfdir); + df := my_trim( ReadStringFromPtr(dfdir)); if df then begin gtk_file_chooser_set_filename(cdlg,TslStringToGtk( df)); @@ -2678,7 +2678,7 @@ type tsgtkapi = class(tgtkapis) ht := lgobj._getvalue_("height"); hts := ""; if ht>5 then hts := inttostr(ht); - ss := lgobj._getvalue_("facename")+" "+(lgobj._getvalue_("italic")?"Italic":"")+" "+((lgobj._getvalue_("weight")=700)?"Bold":"") + " "+ hts;; + ss := my_trim(lgobj._getvalue_("facename"))+" "+(lgobj._getvalue_("italic")?"Italic":"")+" "+((lgobj._getvalue_("weight")=700)?"Bold":"") + " "+ hts;; cdlg := gtk_font_selection_dialog_new("font select"); gtk_font_selection_dialog_set_preview_text(cdlg,"test fonttext"); gtk_font_selection_dialog_set_font_name(cdlg,TslStringToGtk(ss)); @@ -2772,7 +2772,7 @@ type tsgtkapi = class(tgtkapis) dir := obj._getvalue_("pidlroot"); if dir then //默认位置 begin - df := ReadStringFromPtr(dir); + df := (ReadStringFromPtr(dir)); if df then begin gtk_file_chooser_set_filename(cdlg,TslStringToGtk( df)); @@ -3038,6 +3038,19 @@ begin global G_O_TSWIN32API_; return G_O_TSWIN32API_; end +function my_trim(s); +begin + if not ifstring(s) then return ""; + for i:= 1 to length(s) do + begin + if s[i]="\0" then + begin + if i=1 then return ""; + return s[1:(i-1)]; + end + end + return s; +end /////////////////////////////////////////////////////////////////////////// type TGtkList = class( _gslist) //gtk链表类 function create(ptr); @@ -3202,7 +3215,7 @@ type tgtkapis = class() //gtk end if needset then begin - c := gtk_object_get_data(it,"caption"); + c := my_trim(gtk_object_get_data(it,"caption")); if gtk_object_get_data(it,"checked") then begin gtk_menu_item_set_label(it,TslStringToGtk("[√]"+c)); @@ -3230,7 +3243,7 @@ type tgtkapis = class() //gtk ft := lpm.ftype; st := lpm.fstate; ss := " "; - c := lpm.getdwtypedata()?:""; + c := my_trim(lpm.getdwtypedata())?:""; if ft = _const.MFT_SEPARATOR then //分割 begin it := gtk_separator_menu_item_new(); @@ -5498,7 +5511,7 @@ type tgtkapis = class() //gtk end return r; end - + end type _cairo_matrix_t = class(tslcstructureobj) diff --git a/funcext/tvclib/utslmemo.tsf b/funcext/tvclib/utslmemo.tsf index 1862a55..4eb83a5 100644 --- a/funcext/tvclib/utslmemo.tsf +++ b/funcext/tvclib/utslmemo.tsf @@ -3032,7 +3032,14 @@ type TSynHighLighter = class(TComponent) // if pos(vi," \t")>0 then begin SetTToken(tks,ctk,idx-1); - end + end else + if idx