OSDN Git Service

Surface preview on memScript
authornaru <bottle@mikage.to>
Sat, 5 Apr 2003 16:26:27 +0000 (16:26 +0000)
committernaru <bottle@mikage.to>
Sat, 5 Apr 2003 16:26:27 +0000 (16:26 +0000)
bottleclient/BottleDef.pas
bottleclient/MainForm.pas
bottleclient/SettingForm.dfm
bottleclient/SettingForm.pas
bottleclient/SurfacePreview.dfm
bottleclient/SurfacePreview.pas

index 3c9ab47..55a9785 100755 (executable)
@@ -77,6 +77,7 @@ type
     FHideGhosts: boolean;
     FVisibleGhostsList: TStringList;
     FSurfacePreviewOnHint: boolean;
+    FSurfacePreviewOnScriptPoint: boolean;
     procedure SetDblClkInsert(const Value: boolean);
     procedure SetDefaultScript(const Value: String);
     procedure SetIgnoreTimeCritical(const Value: boolean);
@@ -129,6 +130,7 @@ type
     procedure SetHideGhosts(const Value: boolean);
     procedure SetVisibleGhostsList(const Value: TStringList);
     procedure SetSurfacePreviewOnHint(const Value: boolean);
+    procedure SetSurfacePreviewOnScriptPoint(const Value: boolean);
   public
     property NoSendGhostList: boolean read FNoSendGhostList write SetNoSendGhostList;
     property ConfirmOnExit: boolean read FConfirmOnExit write SetConfirmOnExit;
@@ -198,6 +200,7 @@ type
     property VisibleGhostsList: TStringList read FVisibleGhostsList write SetVisibleGhostsList;
     //\83T\81[\83t\83B\83X\83v\83\8c\83r\83\85\81[
     property SurfacePreviewOnHint: boolean read FSurfacePreviewOnHint write SetSurfacePreviewOnHint;
+    property SurfacePreviewOnScriptPoint: boolean read FSurfacePreviewOnScriptPoint write SetSurfacePreviewOnScriptPoint;
     //\83R\83\93\83X\83g\83\89\83N\83^\81E\83f\83X\83g\83\89\83N\83^\81E\95Û\91
     constructor Create;
     destructor Destroy; override;
@@ -391,6 +394,7 @@ begin
     VisibleGhostsList.CommaText := FIni.ReadString('System', 'VisibleGhostsList', '');
     //\83T\81[\83t\83B\83X\83v\83\8c\83r\83\85\81[
     SurfacePreviewOnHint := FIni.ReadBool('System', 'SurfacePreviewOnHint', false);
+    SurfacePreviewOnScriptPoint := FIni.ReadBool('System', 'SurfacePreviewOnScriptPoint', false);
   except
     ShowMessage('INI\83t\83@\83C\83\8b\93Ç\82Ý\8d\9e\82Ý\83G\83\89\81[');
     Application.Terminate;
@@ -693,6 +697,7 @@ begin
   FIni.WriteString('System', 'VisibleGhostsList', VisibleGhostsList.CommaText);
   //
   FIni.WriteBool('System', 'SurfacePreviewOnHint', SurfacePreviewOnHint);
+  FIni.WriteBool('System', 'SurfacePreviewOnScriptPoint', SurfacePreviewOnScriptPoint);
 end;
 
 function TBottlePrefs.GetDefaultScript: String;
@@ -741,6 +746,12 @@ begin
   FSurfacePreviewOnHint := Value;
 end;
 
+procedure TBottlePrefs.SetSurfacePreviewOnScriptPoint(
+  const Value: boolean);
+begin
+  FSurfacePreviewOnScriptPoint := Value;
+end;
+
 { TChannelListItem }
 
 procedure TChannelListItem.SetGhost(const Value: String);
index a845b08..519baac 100755 (executable)
@@ -2430,6 +2430,8 @@ var id: integer;
     token: String;
 begin
   // \95Ò\8fW\83E\83B\83\93\83h\83E\82Å\83}\83E\83X\83|\83C\83\93\83g\82·\82é\82Æ\83T\81[\83t\83B\83X\83v\83\8c\83r\83\85\81[
+  if not Pref.SurfacePreviewOnScriptPoint then
+    Exit;
   token := memScript.TokenStringFromPos(Point(X, Y));
   if IsSurfaceTag(token, id) then
   begin
@@ -2457,7 +2459,6 @@ begin
     Exit;
   end;
 
-
   if ghost <> '' then
   begin
     Bmp := TBitmap.Create;
index 06652ac..375c8df 100755 (executable)
@@ -498,10 +498,10 @@ object frmSetting: TfrmSetting
       object cbxSurfacePreviewOnHint: TCheckBox
         Left = 16
         Top = 48
-        Width = 289
+        Width = 377
         Height = 17
         Hint = #23450#22411#21477#25407#20837#12513#12491#12517#12540#12434#12503#12523#12480#12454#12531#12375#12383#12392#12365#12395#12503#12524#12499#12517#12540#12434#34920#31034
-        Caption = #23450#22411#21477#25407#20837#26178#12395#12503#12524#12499#12517#12540#12434#34892#12358'(&E)'
+        Caption = #23450#22411#21477#25407#20837#26178#12395#12503#12524#12499#12517#12540#12377#12427'(&C)'
         TabOrder = 0
       end
       object lvwPluginList: TListView
@@ -522,6 +522,14 @@ object frmSetting: TfrmSetting
         TabOrder = 1
         ViewStyle = vsReport
       end
+      object cbxSurfacePreviewOnScriptPoint: TCheckBox
+        Left = 16
+        Top = 72
+        Width = 385
+        Height = 17
+        Caption = #32232#38598#12454#12451#12531#12489#12454#12391'\s'#12479#12464#12434#12509#12452#12531#12488#12375#12383#12392#12365#12395#12503#12524#12499#12517#12540#12377#12427'(&E)'
+        TabOrder = 2
+      end
     end
   end
   object btnClose: TButton
index d96d57d..4c1d7a6 100755 (executable)
@@ -60,6 +60,7 @@ type
     lblSurfacePreview: TLabel;
     lvwPluginList: TListView;
     lblPluginList: TLabel;
+    cbxSurfacePreviewOnScriptPoint: TCheckBox;
     procedure FormClose(Sender: TObject; var Action: TCloseAction);
     procedure edtProxyPortKeyPress(Sender: TObject; var Key: Char);
     procedure ctvBottleNodeChecked(Sender: TObject;
@@ -149,6 +150,7 @@ begin
   memAutoJoinChannels.Lines := Pref.AutoJoinChannels;
   //
   cbxSurfacePreviewOnHint.Checked := Pref.SurfacePreviewOnHint;
+  cbxSurfacePreviewOnScriptPoint.Checked := Pref.SurfacePreviewOnScriptPoint;
   for i := 0 to Spps.Count-1 do
   begin
     with lvwPluginList.Items.Add do
@@ -218,6 +220,7 @@ begin
   Pref.AutoJoinChannels := memAutoJoinChannels.Lines;
   //
   Pref.SurfacePreviewOnHint := cbxSurfacePreviewOnHint.Checked;
+  Pref.SurfacePreviewOnScriptPoint := cbxSurfacePreviewOnScriptPoint.Checked;
 end;
 
 procedure TfrmSetting.edtProxyPortKeyPress(Sender: TObject; var Key: Char);
index 47fd0f4..93fecd0 100644 (file)
@@ -24,7 +24,7 @@ object frmSurfacePreview: TfrmSurfacePreview
   end
   object Timer: TTimer
     Enabled = False
-    Interval = 2000
+    Interval = 3000
     OnTimer = TimerTimer
     Left = 16
     Top = 16
index f9658e8..e68cfea 100644 (file)
@@ -14,6 +14,7 @@ type
     procedure TimerTimer(Sender: TObject);
   private
     { Private \90é\8c¾ }
+    FIsHidden: boolean;
   public
     { Public \90é\8c¾ }
     procedure HideAway;
@@ -41,11 +42,12 @@ begin
   // (Show/Hide\83\81\83\\83b\83h\8eg\82¤\82Æ\83t\83H\81[\83J\83X\82ª\88Ú\82Á\82½\82è\82µ\82Ä\96Ê\93|\82È\82Ì\82Å)
   Left := Low(integer);
   Top := Low(integer);
+  FIsHidden := true;
 end;
 
 function TfrmSurfacePreview.IsHidden: boolean;
 begin
-  Result := Left = Low(integer);
+  Result := FIsHidden;
 end;
 
 procedure TfrmSurfacePreview.ShowPreview(Bmp: TBitmap; X, Y: integer);
@@ -55,6 +57,7 @@ begin
   ClientHeight := Bmp.Height;
   Self.Left := X;
   Self.Top := Y;
+  FIsHidden := false;
 
   // \8e©\93®\82Å\8fÁ\82¦\82é\83^\83C\83}\81[\82ð\83Z\83b\83g
   Timer.Enabled := false; // \82¢\82Á\82½\82ñ\82±\82ê\82Å\8cv\8e\9e\82ª\83\8a\83Z\83b\83g\82³\82ê\82é