OSDN Git Service

ステータスバーのNGワード部分を固定サイズにした
authorhi_ <hi_>
Fri, 29 Aug 2003 17:52:18 +0000 (17:52 +0000)
committerhi_ <hi_>
Fri, 29 Aug 2003 17:52:18 +0000 (17:52 +0000)
Giko.dfm
Giko.pas

index 9d20a26..e24f0b2 100644 (file)
--- a/Giko.dfm
+++ b/Giko.dfm
@@ -44,6 +44,7 @@ object GikoForm: TGikoForm
         Width = 100
       end>
     SimplePanel = False
+    OnResize = StatusBarResize
   end
   object MainPanel: TPanel
     Left = 0
@@ -350,36 +351,36 @@ object GikoForm: TGikoForm
                 Style = tbsDropDown
               end
               object UpFolderButton: TToolButton
-                Left = 61
+                Left = 63
                 Top = 0
                 Action = UpFolderAction
               end
               object Sepa01ToolButton: TToolButton
-                Left = 86
+                Left = 88
                 Top = 0
                 Width = 8
                 Style = tbsSeparator
               end
               object AllItemToolButton: TToolButton
-                Left = 94
+                Left = 96
                 Top = 0
                 Action = AllItemAction
                 Style = tbsCheck
               end
               object LogItemToolButton: TToolButton
-                Left = 119
+                Left = 121
                 Top = 0
                 Action = LogItemAction
                 Style = tbsCheck
               end
               object NewItemToolButton: TToolButton
-                Left = 144
+                Left = 146
                 Top = 0
                 Action = NewItemAction
                 Style = tbsCheck
               end
               object SelectItemToolButton: TToolButton
-                Left = 169
+                Left = 171
                 Top = 0
                 Action = SelectItemAction
                 Style = tbsCheck
@@ -387,7 +388,7 @@ object GikoForm: TGikoForm
               end
               object SelectComboBox: TComboBox
                 Tag = 1
-                Left = 194
+                Left = 196
                 Top = 1
                 Width = 127
                 Height = 20
@@ -399,7 +400,7 @@ object GikoForm: TGikoForm
               end
               object SelectComboBoxSplitter: TImage
                 Tag = 1
-                Left = 321
+                Left = 323
                 Top = 0
                 Width = 8
                 Height = 22
@@ -409,12 +410,12 @@ object GikoForm: TGikoForm
                 OnMouseUp = SelectComboBoxSplitterMouseUp
               end
               object ToolButton8: TToolButton
-                Left = 329
+                Left = 331
                 Top = 0
                 Action = ThreadEditorAction
               end
               object ToolButton10: TToolButton
-                Left = 354
+                Left = 356
                 Top = 0
                 Width = 8
                 Caption = 'ToolButton10'
@@ -422,12 +423,12 @@ object GikoForm: TGikoForm
                 Style = tbsSeparator
               end
               object ToolButton12: TToolButton
-                Left = 362
+                Left = 364
                 Top = 0
                 Action = BoardIEAction
               end
               object ToolButton14: TToolButton
-                Left = 387
+                Left = 389
                 Top = 0
                 Width = 8
                 Caption = 'ToolButton14'
@@ -435,23 +436,23 @@ object GikoForm: TGikoForm
                 Style = tbsSeparator
               end
               object ListDownloadToolButton: TToolButton
-                Left = 395
+                Left = 397
                 Top = 0
                 Action = SelectListReloadAction
               end
               object ListThreadDownloadToolButton: TToolButton
-                Left = 420
+                Left = 422
                 Top = 0
                 Action = SelectThreadReloadAction
               end
               object ToolButton2: TToolButton
-                Left = 445
+                Left = 447
                 Top = 0
                 Width = 8
                 Style = tbsSeparator
               end
               object ToolButton1: TToolButton
-                Left = 453
+                Left = 455
                 Top = 0
                 Action = SelectReservAction
                 DropdownMenu = RoundNamePopupMenu
@@ -668,13 +669,13 @@ object GikoForm: TGikoForm
                 Style = tbsDropDown
               end
               object ToolButton5: TToolButton
-                Left = 293
+                Left = 295
                 Top = 0
                 Width = 8
                 Style = tbsSeparator
               end
               object ItemReloadButton: TToolButton
-                Left = 301
+                Left = 303
                 Top = 0
                 Action = ItemReloadAction
               end
index 4fa9e97..6b046c5 100644 (file)
--- a/Giko.pas
+++ b/Giko.pas
@@ -717,6 +717,7 @@ type
       Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
     procedure SelectComboBoxSplitterMouseUp(Sender: TObject;
       Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
+    procedure StatusBarResize(Sender: TObject);
        private
                { Private \90é\8c¾ }
 
@@ -936,8 +937,8 @@ var
        Style: DWORD;
        msg: string;
        i: Integer;
-//     CoolSet: TCoolSet;
        wp: TWindowPlacement;
+       s: string;
 begin
 {$IFDEF DEBUG}
        AllocConsole;
@@ -1227,7 +1228,7 @@ begin
         SelectComboBoxSplitter.Parent := ListToolBar;
 
         break;
-      end;
+                       end;
     end;
   except
   end;
@@ -1268,7 +1269,10 @@ begin
 //     SetStdToolBar;
 //     SetLinkBar;
 
-    StatusBar.Panels.Items[2].Text := GikoSys.FAbon.NGwordname;
+       s := GikoSys.FAbon.NGwordname;
+       StatusBar.Panels[2].Text := s;
+       StatusBar.Panels[2].Width := Max(StatusBar.Canvas.TextWidth(s), 100);
+       StatusBarResize(Sender);
 end;
 
 //
@@ -6912,33 +6916,41 @@ end;
 
 procedure TGikoForm.GoBackClick(Sender: TObject);
 var
-    ThreadItem : TThreadItem;
+               ThreadItem : TThreadItem;
+               s: string;
 begin
-    if GikoSys.FAbon.GoForward =false then begin
+               if GikoSys.FAbon.GoForward =false then begin
                MsgBox(Handle, '\88ê\82Â\91O\82ÌNG\83\8f\81[\83h\83t\83@\83C\83\8b\82Ì\93Ç\82Ý\8d\9e\82Ý\82É\8e¸\94s\82µ\82Ü\82µ\82½', '\83G\83\89\81[', MB_OK or MB_ICONEXCLAMATION);
-    end else begin
-        StatusBar.Panels.Items[2].Text := GikoSys.FAbon.NGwordname;
-        //\82±\82±\82Å\8c»\8dÝ\95\\8e¦\82³\82ê\82Ä\82¢\82é\83X\83\8c\83b\83h\82Ì\8dÄ\95`\89æ\82ð\8cÄ\82Ñ\8fo\82µ\82½\82¢\82ª\82â\82è\95û\95ª\82©\82ç\82¸¥¥¥\81B
-       ThreadItem := GetActiveContent;
-           if ThreadItem <> nil then
-                SetContent( ThreadItem );
-    end;
+               end else begin
+                               s := GikoSys.FAbon.NGwordname;
+                               StatusBar.Panels.Items[2].Text := s;
+                               StatusBar.Panels[2].Width := Max(StatusBar.Canvas.TextWidth(s), 100);
+                               StatusBarResize(Sender);
+                               //\82±\82±\82Å\8c»\8dÝ\95\\8e¦\82³\82ê\82Ä\82¢\82é\83X\83\8c\83b\83h\82Ì\8dÄ\95`\89æ\82ð\8cÄ\82Ñ\8fo\82µ\82½\82¢\82ª\82â\82è\95û\95ª\82©\82ç\82¸¥¥¥\81B
+                       ThreadItem := GetActiveContent;
+                       if ThreadItem <> nil then
+                                                               SetContent( ThreadItem );
+               end;
 
 end;
 
 procedure TGikoForm.GoFowardClick(Sender: TObject);
 var
-    ThreadItem : TThreadItem;
+               ThreadItem : TThreadItem;
+               s: string;
 begin
-    if GikoSys.FAbon.GoBack =false then begin
+               if GikoSys.FAbon.GoBack =false then begin
                MsgBox(Handle, '\88ê\82Â\8cã\82ë\82ÌNG\83\8f\81[\83h\83t\83@\83C\83\8b\82Ì\93Ç\82Ý\8d\9e\82Ý\82É\8e¸\94s\82µ\82Ü\82µ\82½', '\83G\83\89\81[', MB_OK or MB_ICONEXCLAMATION);
-    end else begin
-        //\82±\82±\82Å\8c»\8dÝ\95\\8e¦\82³\82ê\82Ä\82¢\82é\83X\83\8c\83b\83h\82Ì\8dÄ\95`\89æ\82ð\8cÄ\82Ñ\8fo\82µ\82½\82¢\82ª\82â\82è\95û\95ª\82©\82ç\82¸¥¥¥\81B
-        StatusBar.Panels.Items[2].Text := GikoSys.FAbon.NGwordname;
-           ThreadItem := GetActiveContent;
-           if ThreadItem <> nil then
-                SetContent( ThreadItem );
-    end;
+               end else begin
+                               //\82±\82±\82Å\8c»\8dÝ\95\\8e¦\82³\82ê\82Ä\82¢\82é\83X\83\8c\83b\83h\82Ì\8dÄ\95`\89æ\82ð\8cÄ\82Ñ\8fo\82µ\82½\82¢\82ª\82â\82è\95û\95ª\82©\82ç\82¸¥¥¥\81B
+                               s := GikoSys.FAbon.NGwordname;
+                               StatusBar.Panels.Items[2].Text := s;
+                               StatusBar.Panels[2].Width := Max(StatusBar.Canvas.TextWidth(s), 100);
+                               StatusBarResize(Sender);
+                       ThreadItem := GetActiveContent;
+                       if ThreadItem <> nil then
+                                                               SetContent( ThreadItem );
+               end;
 
 end;
 
@@ -7011,13 +7023,20 @@ begin
 end;
 
 procedure TGikoForm.SelectComboBoxSplitterMouseUp(Sender: TObject;
-  Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
+       Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
+begin
+       IsDraggingSelectComboBox := False;
+end;
+
+procedure TGikoForm.StatusBarResize(Sender: TObject);
 begin
-  IsDraggingSelectComboBox := False;
+       StatusBar.Panels[1].Width := StatusBar.Width -
+                                                                                                                        StatusBar.Panels[0].Width -
+                                                                                                                        StatusBar.Panels[2].Width;
 end;
 
 initialization
-        OleInitialize(nil);
+                               OleInitialize(nil);
 finalization
-        OleUninitialize;
+                               OleUninitialize;
 end.