• R/O
  • HTTP
  • SSH
  • HTTPS

winbottle: Commit

SSTP Bottle Client 本体


Commit MetaInfo

Revision969f9dc7ccc1dc10a02f3544a94d8dfea9c72fc4 (tree)
Time2006-02-15 18:49:54
AuthorC.Ponapalt <ponapalt@shil...>
CommiterC.Ponapalt

Log Message

ログ窓でEnterを押すと、カーソルが最新の瓶に移動してしまう問題修正(ID=431)
(リストコントロールをサブクラス化しています。もっとスマートな方法あるかも)

Change Summary

Incremental Difference

--- a/bottleclient/LogForm.dfm
+++ b/bottleclient/LogForm.dfm
@@ -54,12 +54,12 @@ object frmLog: TfrmLog
5454 OnClick = mnSaveLogXMLClick
5555 end
5656 object tbtnDownloadLog: TToolButton
57- Left = 80
57+ Left = 82
5858 Top = 0
5959 Action = frmSender.actDownloadLog
6060 end
6161 object ToolButton1: TToolButton
62- Left = 103
62+ Left = 105
6363 Top = 0
6464 Width = 8
6565 Caption = 'ToolButton1'
@@ -67,12 +67,12 @@ object frmLog: TfrmLog
6767 Style = tbsSeparator
6868 end
6969 object tbtnInsertCue: TToolButton
70- Left = 111
70+ Left = 113
7171 Top = 0
7272 Action = frmSender.actInsertCue
7373 end
7474 object tbtnFindBottle: TToolButton
75- Left = 134
75+ Left = 136
7676 Top = 0
7777 Hint = #12508#12488#12523#12434#26908#32034#12377#12427
7878 Caption = #26908#32034'(&F)'
@@ -80,7 +80,7 @@ object frmLog: TfrmLog
8080 OnClick = tbtnFindBottleClick
8181 end
8282 object tbtnPreviewStyle: TToolButton
83- Left = 157
83+ Left = 159
8484 Top = 0
8585 Hint = #12525#12464#12503#12524#12499#12517#12540#12398#34920#31034#24418#24335#12434#22793#26356#12375#12414#12377
8686 Caption = #12503#12524#12499#12517#12540#12473#12479#12452#12523
@@ -90,7 +90,7 @@ object frmLog: TfrmLog
9090 OnClick = tbtnPreviewStyleClick
9191 end
9292 object tbtnListPreviewStyle: TToolButton
93- Left = 191
93+ Left = 195
9494 Top = 0
9595 Hint = #12522#12473#12488#12398#12473#12463#12522#12503#12488#34920#31034#24418#24335#12434#22793#26356#12375#12414#12377
9696 Caption = #12473#12463#12522#12503#12488#34920#31034#24418#24335
@@ -100,7 +100,7 @@ object frmLog: TfrmLog
100100 OnClick = tbtnListPreviewStyleClick
101101 end
102102 object ToolButton2: TToolButton
103- Left = 225
103+ Left = 231
104104 Top = 0
105105 Width = 8
106106 Caption = 'ToolButton2'
@@ -108,17 +108,17 @@ object frmLog: TfrmLog
108108 Style = tbsSeparator
109109 end
110110 object tbtnVoteMessage: TToolButton
111- Left = 233
111+ Left = 239
112112 Top = 0
113113 Action = frmSender.actVoteMessage
114114 end
115115 object tbtnAgreeMessage: TToolButton
116- Left = 256
116+ Left = 262
117117 Top = 0
118118 Action = frmSender.actAgreeMessage
119119 end
120120 object tbtnSendEditor: TToolButton
121- Left = 279
121+ Left = 285
122122 Top = 0
123123 Action = frmSender.actSendToEditor
124124 end
@@ -127,13 +127,13 @@ object frmLog: TfrmLog
127127 Left = 0
128128 Top = 22
129129 Width = 599
130- Height = 287
130+ Height = 294
131131 Align = alClient
132132 BevelOuter = bvNone
133133 TabOrder = 1
134134 object StatusBar: TStatusBar
135135 Left = 0
136- Top = 268
136+ Top = 275
137137 Width = 599
138138 Height = 19
139139 Panels = <
@@ -143,18 +143,19 @@ object frmLog: TfrmLog
143143 item
144144 Width = 50
145145 end>
146+ SimplePanel = False
146147 end
147148 object pnlPanel: TPanel
148149 Left = 0
149150 Top = 0
150151 Width = 599
151- Height = 268
152+ Height = 275
152153 Align = alClient
153154 BevelOuter = bvNone
154155 TabOrder = 1
155156 object Splitter: TSplitter
156157 Left = 0
157- Top = 156
158+ Top = 163
158159 Width = 599
159160 Height = 3
160161 Cursor = crVSplit
@@ -165,7 +166,7 @@ object frmLog: TfrmLog
165166 Left = 0
166167 Top = 0
167168 Width = 599
168- Height = 156
169+ Height = 163
169170 Align = alClient
170171 TabOrder = 0
171172 object tabBottleLog: TTabControl
@@ -189,6 +190,7 @@ object frmLog: TfrmLog
189190 Top = 27
190191 Width = 597
191192 Height = 16
193+ DragReorder = False
192194 Sections = <
193195 item
194196 Alignment = taRightJustify
@@ -230,7 +232,7 @@ object frmLog: TfrmLog
230232 Left = 1
231233 Top = 43
232234 Width = 597
233- Height = 112
235+ Height = 119
234236 Style = lbVirtualOwnerDraw
235237 Align = alClient
236238 DragMode = dmAutomatic
@@ -244,14 +246,13 @@ object frmLog: TfrmLog
244246 OnDragOver = lvwLogDragOver
245247 OnDrawItem = lvwLogDrawItem
246248 OnEndDrag = lvwLogEndDrag
247- OnKeyPress = lvwLogKeyPress
248249 OnMouseDown = lvwLogMouseDown
249250 OnStartDrag = lvwLogStartDrag
250251 end
251252 end
252253 object pnlPreviewArea: TPanel
253254 Left = 0
254- Top = 159
255+ Top = 166
255256 Width = 599
256257 Height = 109
257258 Align = alBottom
--- a/bottleclient/LogForm.pas
+++ b/bottleclient/LogForm.pas
@@ -82,7 +82,6 @@ type
8282 procedure tbtnClearClick(Sender: TObject);
8383 procedure FormCreate(Sender: TObject);
8484 procedure lvwLogDblClick(Sender: TObject);
85- procedure lvwLogKeyPress(Sender: TObject; var Key: Char);
8685 procedure FormDestroy(Sender: TObject);
8786 procedure lvwLogClick(Sender: TObject);
8887 procedure mnSaveLogClick(Sender: TObject);
@@ -143,6 +142,8 @@ type
143142 // リストビュードラッグドロップ関連
144143 FLVScrollDir: TLVScrollDir; // スクロール方向
145144 FLVDragDest: integer; //ドロップする位置(すぐ下にくるアイテムのIndex)
145+ // リストボックスのキーイベントフック用
146+ FLVWndMethod: TWndMethod;
146147 //
147148 procedure UpdateScript(const Script: String);
148149 procedure UpdateScriptConversationColor(const Script: String);
@@ -162,6 +163,7 @@ type
162163 LogList, Result: TBottleLogList; UntilIndex: integer = -1);
163164 procedure DrawListSection(const SectionIndex, Top: Integer;
164165 const Text: string; const LeftMargin: Integer = 0);
166+ procedure lvwLogWindowProc(var Msg: TMessage);
165167 protected
166168 procedure CreateParams(var Params: TCreateParams); override;
167169 public
@@ -270,6 +272,9 @@ end;
270272 procedure TfrmLog.FormCreate(Sender: TObject);
271273 var i: integer;
272274 begin
275+ FLVWndMethod := lvwLog.WindowProc;
276+ lvwLog.WindowProc := lvwLogWindowProc;
277+
273278 FLVDragDest := -1; // リストビューのドラッグ中ではない
274279 FBottleLogList := TObjectList.Create;
275280
@@ -326,6 +331,8 @@ begin
326331 Pref.LogWindowDividerPos := pnlPreviewArea.Height;
327332
328333 FreeAndNil(FBottleLogList);
334+
335+ lvwLog.WindowProc := FLVWndMethod;
329336 end;
330337
331338 procedure TfrmLog.lvwLogDblClick(Sender: TObject);
@@ -420,11 +427,6 @@ begin
420427 end;
421428 end;
422429
423-procedure TfrmLog.lvwLogKeyPress(Sender: TObject; var Key: Char);
424-begin
425- if Key = #13 then lvwLogDblClick(Sender);
426-end;
427-
428430 procedure TfrmLog.CreateParams(var Params: TCreateParams);
429431 begin
430432 inherited;
@@ -1829,4 +1831,17 @@ begin
18291831 end;
18301832 end;
18311833
1834+procedure TfrmLog.lvwLogWindowProc(var Msg: TMessage);
1835+begin
1836+ if Msg.Msg = WM_CHAR then begin
1837+ if Msg.WParam = 13 then begin
1838+ lvwLogDblClick(lvwLog);
1839+ Msg.Result := 0;
1840+ end;
1841+ Exit;
1842+ end;
1843+
1844+ FLVWndMethod(Msg);
1845+end;
1846+
18321847 end.
Show on old repository browser