diff --git a/designer/tslvcldesigner.tsf b/designer/tslvcldesigner.tsf index 1473127..fbd21a8 100644 --- a/designer/tslvcldesigner.tsf +++ b/designer/tslvcldesigner.tsf @@ -6814,6 +6814,7 @@ type TPropGrid = class(TTSLDataGrid) end function clickediter(o,e); begin + return FDesigner.openclassfile();// if FComponent then FDesigner.AddAndOPenEvent(FComponent.TreeNode);//DBLClickComponent(); end diff --git a/designer/utslcodeeditor.tsf b/designer/utslcodeeditor.tsf index 82b70fd..3ed4f68 100644 --- a/designer/utslcodeeditor.tsf +++ b/designer/utslcodeeditor.tsf @@ -1693,7 +1693,6 @@ type TEditer=class(TCustomcontrol) // end end DeletePageItem(it); - ECHO "==222=>>>"; end; FFindWnd := new TFindWnd(self); //查找 FGotoLineWnd := new TGoToLineWnd(self); //共同 diff --git a/designer/utslvcldebuger.tsf b/designer/utslvcldebuger.tsf index 4bedae0..618fa42 100644 --- a/designer/utslvcldebuger.tsf +++ b/designer/utslvcldebuger.tsf @@ -387,7 +387,7 @@ type TTslDebuga=class(TCustomControl) begin if not FValewnd then begin - FValewnd := new TTSLDataGrid(self); + FValewnd := new tdbgvalueshowgrid(self); FValewnd.Visible := false; FValewnd.Caption := "Value"; FValewnd.left := owner.left+100; @@ -2004,7 +2004,7 @@ end end end end -type TTSLDataGrid=class(TDrawGrid) +type tdbgvalueshowgrid=class(TDrawGrid) {** @explan(说明)TSL数组和对象展示 %% **} @@ -2235,7 +2235,7 @@ type TTSLDataGrid=class(TDrawGrid) return v; end end - o := new TTSlDataGrid(initializeapplication()); + o := new tdbgvalueshowgrid(initializeapplication()); o.ControlIndexs(idexs); o.height := 500; o.width := 500; diff --git a/funcext/tvclib/ugtkinterface.tsf b/funcext/tvclib/ugtkinterface.tsf index 19c617e..f06bbac 100644 --- a/funcext/tvclib/ugtkinterface.tsf +++ b/funcext/tvclib/ugtkinterface.tsf @@ -1277,6 +1277,7 @@ type tsgtkapi = class(tgtkapis) begin g_object_set_data(hMenu,"popmenubarwindow",hWnd); gtk_menu_popup(hmenu,0,0,0,0,3,0);//弹出 + //popup_at_rect(hmenu,0,array(x,y,-1,-1),0,0,0); return 1; end else begin @@ -3449,6 +3450,13 @@ type tgtkapis = class() //gtk data:pointer; button:integer; activate_time:integer);cdecl;external 'libgtk-3.so'; + procedure popup_at_rect( + menu:pointer; + rect_window:pointer; + var rect : array of integer; + rect_anchor:pointer; + menu_anchor:pointer; + trigger_event:pointer);cdecl;external 'libgtk-3.so'; procedure gtk_menu_item_activate(mi:pointer);cdecl;external 'libgtk-3.so'; diff --git a/funcext/tvclib/utslmemo.tsf b/funcext/tvclib/utslmemo.tsf index 7d4dd1e..63b24fc 100644 --- a/funcext/tvclib/utslmemo.tsf +++ b/funcext/tvclib/utslmemo.tsf @@ -2025,7 +2025,12 @@ type TCustomMemo = class(TCustomScrollControl,TCustomMemoCmd) if bb[0]=ee[0]then begin s := fLines[bb[0]-1].FStr; - if ee[1]>bb[1]and ee[1]>1 then r := s[bb[1]:ee[1]-1]; //可能出错 + if ee[1]>bb[1]and ee[1]>1 then + try + r := s[bb[1]:ee[1]-1]; //可能出错,添加try + except + r := ""; + end; end else begin //第一行 diff --git a/funcext/tvclib/utslvclauxiliary.tsf b/funcext/tvclib/utslvclauxiliary.tsf index 6245336..5445bba 100644 --- a/funcext/tvclib/utslvclauxiliary.tsf +++ b/funcext/tvclib/utslvclauxiliary.tsf @@ -1555,7 +1555,8 @@ type TNode = class() @param(Expanded)(bool) 是否展开 %% @param(Parent)(TNode) 父节点 %% **} - protected property CurrentDeleteNode read FCurrentDeleteNode write FCurrentDeleteNode; + protected + property CurrentDeleteNode read FCurrentDeleteNode write FCurrentDeleteNode; property CurrentAddNode read FCurrentAddNode write FCurrentAddNode; {** @ignoremembers(CurrentDeleteNode,CurrentAddNode) diff --git a/funcext/tvclib/utslvclgdi.tsf b/funcext/tvclib/utslvclgdi.tsf index f3517fc..0a37859 100644 --- a/funcext/tvclib/utslvclgdi.tsf +++ b/funcext/tvclib/utslvclgdi.tsf @@ -99,6 +99,7 @@ type TGdi = class(TSLUIBASE) end type Tcustomfont = class(tgdi) private + fdwfacename; FHeight; FWidth; Fescapement; @@ -283,8 +284,16 @@ type Tcustomfont = class(tgdi) end function Setfacename(v) begin - if ifstring(v)and v <> Ffacename and length(v)<= 32 then + {$ifdef linux} + + {$else} + if not(v in fdwfacename) then begin + return ; + end + {$endif} + if ifstring(v)and v <> Ffacename and length(v)<= 32 then + begin Ffacename := v; onchange(); end @@ -347,6 +356,7 @@ type Tcustomfont = class(tgdi) function create();override; begin inherited; + fdwfacename := array( "新宋体","宋体","Courier New"); fheight := 15; fwidth := 7; fescapement := 0; @@ -399,6 +409,14 @@ type Tcustomfont = class(tgdi) begin v0 := v[0]; vsv := vs[v0]; + {$ifdef linux} + + {$else} + if v0="facename" and not(vsv in fdwfacename ) then + begin + continue; + end + {$endif} if not ifnil(vsv)then begin ovi := invoke(self,"f"+v0); diff --git a/funcext/tvclib/utslvclstdctl.tsf b/funcext/tvclib/utslvclstdctl.tsf index 63fd3c1..a16df1a 100644 --- a/funcext/tvclib/utslvclstdctl.tsf +++ b/funcext/tvclib/utslvclstdctl.tsf @@ -3570,10 +3570,23 @@ type TcustomToolButton=class(tcomponent) end function DoOnClick(o,e);virtual; begin + if Parent then + begin + if FPopupMenu is class(TcustomPopupmenu) then + begin + Parent.PopupMenu := FPopupMenu; + rec := GetRect(); + xy := Parent.clienttoscreen(rec[0],rec[3]); + uf := TPM_LEFTALIGN .| TPM_TOPALIGN .| TPM_RIGHTBUTTON; + _wapi.TrackPopupMenu(FPopupMenu.Handle,uf,xy[0],xy[1],0,Parent.Handle,nil); + return ; + end + end if action and action.Execute()then begin + end else - CallMessgeFunction(OnClick,o,e); + CallMessgeFunction(OnClick,o,e); end function GetRect(); begin @@ -3585,7 +3598,7 @@ type TcustomToolButton=class(tcomponent) end function publishs();override; begin - return array("name","caption","enabled","imageid","visible","onclick"); + return array("name","caption","enabled","imageid","visible","onclick","popupmenu"); end function Recycling();override; begin @@ -3600,6 +3613,7 @@ type TcustomToolButton=class(tcomponent) end FToolbar := nil; inherited; + FPopupMenu := nil; FCaption := ""; //标题 FOnClick := nil; //点击 FImageId :=-1; //imageid @@ -3616,6 +3630,7 @@ type TcustomToolButton=class(tcomponent) property willaddBar read FWillAddbar; property Action:taction read GetAction write SetAction; property ShortCut read getShortCut write SetShortCut; + property PopupMenu:tpopupmenu read FPopupMenu write FPopupMenu; {** @param(OnClick)(function[o:TToolButton;e:tuieventbase]) 点击消息 %% @param(Caption)(string) 标题 %% @@ -3754,6 +3769,7 @@ type TcustomToolButton=class(tcomponent) end end private + FPopupMenu;//弹出菜单 FCaption; //标题 FOnClick; //点击 FCommandId; //command id 可以不要 @@ -3802,6 +3818,10 @@ type TcustomToolBar=class(TCustomControl) end end end + function ContextMenu(o,e);override; + begin + e.skip := true; + end function MouseUp(o,e);override; begin if csDesigning in ComponentState then return; @@ -3874,8 +3894,11 @@ type TcustomToolBar=class(TCustomControl) begin if not FTipWnd.Visible then begin - st := FButtons[idx].ShortCut; - FTipWnd.Tip := FButtons[idx].Caption+(st?(" ("+st+")"):""); + bt := FButtons[idx]; + st := bt.ShortCut; + if bt.PopupMenu is class(TcustomPopupmenu) then s1 := bt.PopupMenu.Caption; + else s1 := bt.Caption; + FTipWnd.Tip := s1+(st?(" ("+st+")"):""); FTipWnd.ShowTIp(); end end else