OSDN Git Service

・スレッド絞込フィールドの幅を変更できるようになった。
authoryoffy <yoffy>
Wed, 27 Aug 2003 17:25:09 +0000 (17:25 +0000)
committeryoffy <yoffy>
Wed, 27 Aug 2003 17:25:09 +0000 (17:25 +0000)
Giko.dfm
Giko.pas

index ffc4adb..8eae20f 100644 (file)
--- a/Giko.dfm
+++ b/Giko.dfm
@@ -389,7 +389,7 @@ object GikoForm: TGikoForm
                 Tag = 1
                 Left = 194
                 Top = 1
-                Width = 145
+                Width = 127
                 Height = 20
                 ItemHeight = 12
                 TabOrder = 0
@@ -397,19 +397,23 @@ object GikoForm: TGikoForm
                 OnExit = SelectComboBoxExit
                 OnKeyDown = SelectComboBoxKeyDown
               end
-              object Sepa02ToolButton: TToolButton
-                Left = 339
+              object SelectComboBoxSplitter: TImage
+                Left = 321
                 Top = 0
-                Width = 8
-                Style = tbsSeparator
+                Width = 5
+                Height = 22
+                Cursor = crHSplit
+                OnMouseDown = SelectComboBoxSplitterMouseDown
+                OnMouseMove = SelectComboBoxSplitterMouseMove
+                OnMouseUp = SelectComboBoxSplitterMouseUp
               end
               object ToolButton8: TToolButton
-                Left = 347
+                Left = 326
                 Top = 0
                 Action = ThreadEditorAction
               end
               object ToolButton10: TToolButton
-                Left = 372
+                Left = 351
                 Top = 0
                 Width = 8
                 Caption = 'ToolButton10'
@@ -417,12 +421,12 @@ object GikoForm: TGikoForm
                 Style = tbsSeparator
               end
               object ToolButton12: TToolButton
-                Left = 380
+                Left = 359
                 Top = 0
                 Action = BoardIEAction
               end
               object ToolButton14: TToolButton
-                Left = 405
+                Left = 384
                 Top = 0
                 Width = 8
                 Caption = 'ToolButton14'
@@ -430,23 +434,23 @@ object GikoForm: TGikoForm
                 Style = tbsSeparator
               end
               object ListDownloadToolButton: TToolButton
-                Left = 413
+                Left = 392
                 Top = 0
                 Action = SelectListReloadAction
               end
               object ListThreadDownloadToolButton: TToolButton
-                Left = 438
+                Left = 417
                 Top = 0
                 Action = SelectThreadReloadAction
               end
               object ToolButton2: TToolButton
-                Left = 463
+                Left = 442
                 Top = 0
                 Width = 8
                 Style = tbsSeparator
               end
               object ToolButton1: TToolButton
-                Left = 471
+                Left = 450
                 Top = 0
                 Action = SelectReservAction
                 DropdownMenu = RoundNamePopupMenu
index 4130d13..89ae509 100644 (file)
--- a/Giko.pas
+++ b/Giko.pas
@@ -260,7 +260,6 @@ type
                AllItemToolButton: TToolButton;
                LogItemToolButton: TToolButton;
                NewItemToolButton: TToolButton;
-    Sepa02ToolButton: TToolButton;
     ListDownloadToolButton: TToolButton;
                ListThreadDownloadToolButton: TToolButton;
     ToolButton2: TToolButton;
@@ -459,6 +458,7 @@ type
     ReloadAction: TAction;
     GoFowardAction: TAction;
     GoBackAction: TAction;
+    SelectComboBoxSplitter: TImage;
                procedure FormCreate(Sender: TObject);
                procedure FormDestroy(Sender: TObject);
                procedure CabinetPanelHide(Sender: TObject);
@@ -711,6 +711,12 @@ type
       var Handled: Boolean);
     procedure MainCoolBarContextPopup(Sender: TObject; MousePos: TPoint;
       var Handled: Boolean);
+    procedure SelectComboBoxSplitterMouseMove(Sender: TObject;
+      Shift: TShiftState; X, Y: Integer);
+    procedure SelectComboBoxSplitterMouseDown(Sender: TObject;
+      Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
+    procedure SelectComboBoxSplitterMouseUp(Sender: TObject;
+      Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
        private
                { Private \90é\8c¾ }
 
@@ -749,7 +755,11 @@ type
                FDownloadMax: Integer;                          //\83_\83E\83\93\83\8d\81[\83h\92\86\82Ì\8dÅ\91å\83T\83C\83Y
                FEvent: THTMLDocumentEventSink;//\83u\83\89\83E\83U\83h\83L\83\85\83\81\83\93\83g\83C\83x\83\93\83g
 
-        Fkeynum : Integer; //\83L\81[\83{\81[\83h\83\8c\83X\83|\83b\83v\83A\83b\83v\97p
+    Fkeynum : Integer; //\83L\81[\83{\81[\83h\83\8c\83X\83|\83b\83v\83A\83b\83v\97p
+
+    IsDraggingSelectComboBox : Boolean;
+    DraggingSelectComboBoxPosition : TPoint;
+
                procedure SetBoardTreeNode;
                function SetCategoryListItem(ABBS2ch: TBBS2ch): Integer;
                function SetBoardListItem(Category: TCategory): Integer;
@@ -1195,15 +1205,31 @@ begin
        //\83c\81[\83\8b\83{\83^\83\93\93Ç\82Ý\8d\9e\82Ý
        ReadToolBarSetting(ActionList, StdToolBar);
        ReadToolBarSetting(ActionList, ListToolBar);
-  for i := ListToolBar.ControlCount - 1 downto 0 do
-  begin
-          if ListToolBar.Controls[ i ].Action = SelectItemAction then
-          begin
-                  ListToolBar.Controls[ i ].Visible := False;
-                  SelectComboBox.Left := ListToolBar.Controls[ i ].Left;
-                  SelectComboBox.Parent := ListToolBar;
-                  break;
-          end;
+  try
+    for i := ListToolBar.ControlCount - 1 downto 0 do
+    begin
+      if ListToolBar.Controls[ i ].Action = SelectItemAction then
+      begin
+        // \83X\83\8c\83b\83h\8di\8d\9e\82Ì\97×\82É\83Z\83p\83\8c\81[\83^\82ª\82 \82é\8fê\8d\87\82Í\89B\82·
+        if (i + 1) < ListToolBar.ControlCount then
+          if ListToolBar.Controls[ i + 1 ] is TToolButton then
+            if TToolButton( ListToolBar.Controls[ i + 1 ] ).Style = tbsSeparator then
+              ListToolBar.Controls[ i + 1 ].Visible := False;
+
+        // \83X\83\8c\83b\83h\8di\8d\9e\83{\83^\83\93\82ð\89B\82·
+        ListToolBar.Controls[ i ].Visible := False;
+        // \83X\83\8c\83b\83h\8di\8d\9e\83t\83B\81[\83\8b\83h\82ð\91}\93ü
+        SelectComboBox.Left := ListToolBar.Controls[ i ].Left;
+        SelectComboBox.Width := GikoSys.Setting.SelectComboBoxWidth;
+        SelectComboBox.Parent := ListToolBar;
+        // \83X\83\8c\83b\83h\8di\8d\9e\97p\93Æ\8e©\83Z\83p\83\8c\81[\83^\82ð\91}\93ü
+        SelectComboBoxSplitter.Left := SelectComboBox.Left + SelectComboBox.Width;
+        SelectComboBoxSplitter.Parent := ListToolBar;
+
+        break;
+      end;
+    end;
+  except
   end;
        ReadToolBarSetting(ActionList, BrowserToolBar);
        SetToolBarPopup;
@@ -3627,7 +3653,8 @@ begin
     // SelectComboBox \82Ì\97\9a\97ð\82ð\8dX\90V\82µ\82Ä\82¨\82­
     ModifySelectList;
     // SelectComboBox \82Ì\92l\82ð\83N\83\8a\83A
-    SelectComboBox.Text := '';
+    if SelectComboBox.Parent <> nil then
+      SelectComboBox.Text := '';
   except
   end;
 end;
@@ -3644,7 +3671,8 @@ begin
     // SelectComboBox \82Ì\97\9a\97ð\82ð\8dX\90V\82µ\82Ä\82¨\82­
     ModifySelectList;
     // SelectComboBox \82Ì\92l\82ð\83N\83\8a\83A
-    SelectComboBox.Text := '';
+    if SelectComboBox.Parent <> nil then
+      SelectComboBox.Text := '';
   except
   end;
 end;
@@ -3652,6 +3680,7 @@ end;
 procedure TGikoForm.NewItemActionExecute(Sender: TObject);
 begin
   try
+
     if ViewType <> gvtNew then
       SetListViewType(gvtNew);
     AllItemAction.Checked := False;
@@ -3661,7 +3690,8 @@ begin
     // SelectComboBox \82Ì\97\9a\97ð\82ð\8dX\90V\82µ\82Ä\82¨\82­
     ModifySelectList;
     // SelectComboBox \82Ì\92l\82ð\83N\83\8a\83A
-    SelectComboBox.Text := '';
+    if SelectComboBox.Parent <> nil then
+      SelectComboBox.Text := '';
   except
   end;
 end;
@@ -3671,23 +3701,22 @@ var
        idx: Integer;
        Dlg: TListSelectDialog;
 begin
-  if SelectComboBox.Owner <> nil then begin
-    // \90e\82ð\8e\9d\82Á\82Ä\82È\82¢\95È\82É nil \82É\82È\82ç\82È\82¢\8fê\8d\87\82ª\82 \82é\82©\82ç except \82Å\89ñ\94ð
-    try
+  try
+    if SelectComboBox.Parent <> nil then begin
       if SelectComboBox.Left + SelectComboBox.Width < ListToolBar.Width then begin
         // SelectComboBox \82ª\82 \82é\8fê\8d\87\82Í\83t\83H\81[\83J\83X\82ð\88Ú\82·
         SelectComboBox.SetFocus;
         exit;
       end;
-    except
     end;
+  except
   end;
 
   AllItemAction.Checked := False;
   LogItemAction.Checked := False;
   NewItemAction.Checked := False;
   //SelectItemAction.Checked := True;
-        ModifySelectList;
+  ModifySelectList;
   Dlg := TListSelectDialog.Create(Self);
   try
     Dlg.SelectComboBox.Items.Assign(GikoSys.Setting.SelectTextList);
@@ -6545,16 +6574,29 @@ begin
                        end;
                        SaveToolBarSetting(StdToolBar);
                        SaveToolBarSetting(ListToolBar);
-                        for i := ListToolBar.ControlCount - 1 downto 0 do
-                        begin
-                                if ListToolBar.Controls[ i ].Action = SelectItemAction then
-                                begin
-                                        ListToolBar.Controls[ i ].Visible := False;
-                                        SelectComboBox.Left := ListToolBar.Controls[ i ].Left;
-                                        SelectComboBox.Parent := ListToolBar;
-                                        break;
-                                end;
-                        end;
+      for i := ListToolBar.ControlCount - 1 downto 0 do
+      begin
+        if ListToolBar.Controls[ i ].Action = SelectItemAction then
+        begin
+          // \83X\83\8c\83b\83h\8di\8d\9e\82Ì\97×\82É\83Z\83p\83\8c\81[\83^\82ª\82 \82é\8fê\8d\87\82Í\89B\82·
+          if (i + 1) < ListToolBar.ControlCount then
+            if ListToolBar.Controls[ i + 1 ] is TToolButton then
+              if TToolButton( ListToolBar.Controls[ i + 1 ] ).Style = tbsSeparator then
+                ListToolBar.Controls[ i + 1 ].Visible := False;
+
+          // \83X\83\8c\83b\83h\8di\8d\9e\83{\83^\83\93\82ð\89B\82·
+          ListToolBar.Controls[ i ].Visible := False;
+          // \83X\83\8c\83b\83h\8di\8d\9e\83t\83B\81[\83\8b\83h\82ð\91}\93ü
+          SelectComboBox.Left := ListToolBar.Controls[ i ].Left;
+          SelectComboBox.Width := GikoSys.Setting.SelectComboBoxWidth;
+          SelectComboBox.Parent := ListToolBar;
+          // \83X\83\8c\83b\83h\8di\8d\9e\97p\93Æ\8e©\83Z\83p\83\8c\81[\83^\82ð\91}\93ü
+          SelectComboBoxSplitter.Left := SelectComboBox.Left + SelectComboBox.Width;
+          SelectComboBoxSplitter.Parent := ListToolBar;
+
+          break;
+        end;
+      end;
                        SaveToolBarSetting(BrowserToolBar);
                end;
        finally
@@ -6629,30 +6671,30 @@ procedure TGikoForm.SelectComboBoxKeyDown(Sender: TObject; var Key: Word;
   Shift: TShiftState);
 begin
 
-        if Key = VK_Return then
-        begin
-                ModifySelectList;
-        end else if Length( SelectComboBox.Text ) = 0 then
-        begin
-                AllItemAction.Checked := True;
-                LogItemAction.Checked := False;
-                NewItemAction.Checked := False;
-        end else begin
-                // \83`\83\89\82Â\82­\82Æ\8c\99\82¾\82©\82ç\81A\88ê\89\9e\89\9f\82µ\82Ä\82 \82é\82Æ\82«\82¾\82¯\8f\88\97\9d\82·\82é
-                if AllItemAction.Checked then
-                        AllItemAction.Checked := False;
-                if LogItemAction.Checked then
-                        LogItemAction.Checked := False;
-                if NewItemAction.Checked then
-                        NewItemaction.Checked := False;
-        end;
+  if Key = VK_Return then
+  begin
+    ModifySelectList;
+  end else if Length( SelectComboBox.Text ) = 0 then
+  begin
+    AllItemAction.Checked := True;
+    LogItemAction.Checked := False;
+    NewItemAction.Checked := False;
+  end else begin
+    // \83`\83\89\82Â\82­\82Æ\8c\99\82¾\82©\82ç\81A\88ê\89\9e\89\9f\82µ\82Ä\82 \82é\82Æ\82«\82¾\82¯\8f\88\97\9d\82·\82é
+    if AllItemAction.Checked then
+      AllItemAction.Checked := False;
+    if LogItemAction.Checked then
+      LogItemAction.Checked := False;
+    if NewItemAction.Checked then
+      NewItemaction.Checked := False;
+  end;
 
 end;
 
 procedure TGikoForm.SelectComboBoxExit(Sender: TObject);
 begin
 
-        ModifySelectList;
+  ModifySelectList;
 
 end;
 
@@ -6664,6 +6706,9 @@ var
 begin
 
   try
+    if SelectComboBox.Parent = nil then
+      exit;
+
     if Length( SelectComboBox.Text ) > 0 then
     begin
       oldText := SelectComboBox.Text;
@@ -6905,6 +6950,42 @@ begin
   MainCoolBarPopupMenu.Popup( pos.X, pos.Y );
 end;
 
+procedure TGikoForm.SelectComboBoxSplitterMouseMove(Sender: TObject;
+  Shift: TShiftState; X, Y: Integer);
+var
+  pos : TPoint;
+  w : Integer;
+begin
+  If (SelectComboBox.Parent <> nil) and (IsDraggingSelectComboBox) Then begin
+    pos.X := X;
+    pos.Y := Y;
+    pos := SelectComboBoxSplitter.ClientToScreen( pos );
+    w := SelectComboBox.Width + (pos.X - DraggingSelectComboBoxPosition.X);
+    If w >= 50 Then begin
+      SelectComboBox.Width := w;
+      GikoSys.Setting.SelectComboBoxWidth := w;
+      DraggingSelectComboBoxPosition := pos;
+    End;
+  End;
+end;
+
+procedure TGikoForm.SelectComboBoxSplitterMouseDown(Sender: TObject;
+  Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
+var
+  pos : TPoint;
+begin
+  IsDraggingSelectComboBox := True;
+  pos.X := X;
+  pos.Y := Y;
+  DraggingSelectComboBoxPosition := SelectComboBoxSplitter.ClientToScreen( pos );
+end;
+
+procedure TGikoForm.SelectComboBoxSplitterMouseUp(Sender: TObject;
+  Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
+begin
+  IsDraggingSelectComboBox := False;
+end;
+
 initialization
         OleInitialize(nil);
 finalization