Bläddra i källkod

* fix webbug 2932

pierre 21 år sedan
förälder
incheckning
0fa8bff988
2 ändrade filer med 44 tillägg och 6 borttagningar
  1. 4 5
      ide/weditor.pas
  2. 40 1
      ide/wviews.pas

+ 4 - 5
ide/weditor.pas

@@ -731,7 +731,6 @@ const
 
      ToClipCmds         : TCommandSet = ([cmCut,cmCopy,cmCopyWin]);
      FromClipCmds       : TCommandSet = ([cmPaste]);
-     FromWinClipCmds    : TCommandSet = ([cmPasteWin]);
      NulClipCmds        : TCommandSet = ([cmClear]);
      UndoCmd            : TCommandSet = ([cmUndo]);
      RedoCmd            : TCommandSet = ([cmRedo]);
@@ -6679,9 +6678,6 @@ begin
       CanPaste:=(Clipboard<>nil) and ((Clipboard^.SelStart.X<>Clipboard^.SelEnd.X) or
            (Clipboard^.SelStart.Y<>Clipboard^.SelEnd.Y));
       SetCmdState(FromClipCmds,CanPaste  and (Clipboard<>@Self));
-{$ifdef WinClipSupported}
-      SetCmdState(FromWinClipCmds,GetTextWinClipboardSize>0);
-{$endif WinClipSupported}
       SetCmdState(UndoCmd,(GetUndoActionCount>0));
       SetCmdState(RedoCmd,(GetRedoActionCount>0));
       Message(Application,evBroadcast,cmCommandSetChanged,nil);
@@ -7277,7 +7273,10 @@ end;
 END.
 {
   $Log$
-  Revision 1.42  2003-01-31 12:04:50  pierre
+  Revision 1.43  2004-02-10 07:16:28  pierre
+  * fix webbug 2932
+
+  Revision 1.42  2003/01/31 12:04:50  pierre
    * try to fix the selection extension better
 
   Revision 1.41  2003/01/29 00:29:14  pierre

+ 40 - 1
ide/wviews.pas

@@ -258,6 +258,10 @@ implementation
 
 uses Mouse,
      Resource,
+{$ifdef WinClipSupported}
+     WinClip,
+     FpConst,
+{$endif WinClipSupported}
 {$ifdef FVISION}
      FVConsts,
 {$else}
@@ -297,6 +301,9 @@ const
 const
   MessageDialog  : PCenterDialog = nil;
   UserButtonCmd  : array[Low(UserButtonName)..High(UserButtonName)] of word = (cmUserBtn1,cmUserBtn2,cmUserBtn3,cmUserBtn4);
+{$ifdef WinClipSupported}
+  FromWinClipCmds    : TCommandSet = ([cmPasteWin]);
+{$endif WinClipSupported}
 
 function ColorIndex(Color: byte): word;
 begin
@@ -328,6 +335,10 @@ var
   Ch: Char;
   Result: Word;
   ItemShown, P: PMenuItem;
+{$ifdef WinClipSupported}
+  PPW: PMenuItem;
+  WinClipEmpty: boolean;
+{$endif WinClipSupported}
   Target: PMenuView;
   R: TRect;
   E: TEvent;
@@ -426,6 +437,14 @@ begin
   AutoSelect := False; E.What:=evNothing;
   Result := 0;
   ItemShown := nil;
+{$ifdef WinClipSupported}
+  PPW:=SearchMenuItem(Menu,cmPasteWin);
+  if Assigned(PPW) then
+    begin
+      WinClipEmpty:=GetTextWinClipboardSize=0;
+      SetCmdState(FromWinClipCmds,Not WinClipEmpty);
+    end;
+{$endif WinClipSupported}
   Current := Menu^.Default;
   MouseActive := False;
   if UpdateMenu(Menu) then
@@ -435,6 +454,23 @@ begin
        TrackKey(true);
   repeat
     Action := DoNothing;
+{$ifdef WinClipSupported}
+    If Assigned(PPW) then
+      begin
+        If WinClipEmpty and (GetTextWinClipboardSize>0) then
+          begin
+            WinClipEmpty:=false;
+            SetCmdState(FromWinClipCmds,true);
+            DrawView;
+          end
+        else if Not WinClipEmpty and (GetTextWinClipboardSize=0) then
+          begin
+            WinClipEmpty:=true;
+            SetCmdState(FromWinClipCmds,false);
+            DrawView;
+          end;
+      end;
+{$endif WinClipSupported}
     GetEvent(E);
     case E.What of
       evMouseDown:
@@ -2496,7 +2532,10 @@ end;
 END.
 {
   $Log$
-  Revision 1.6  2002-09-09 07:06:53  pierre
+  Revision 1.7  2004-02-10 07:16:28  pierre
+  * fix webbug 2932
+
+  Revision 1.6  2002/09/09 07:06:53  pierre
    * avoid a int64 warning
 
   Revision 1.5  2002/09/07 15:40:50  peter