サムネイル表示対応
@@ -58,6 +58,14 @@ | ||
58 | 58 | } else { |
59 | 59 | system.Option.FileView.IconDisplay = SCFiler2System.OptionClass.FileViewOption.FileIconDisp.Nothing; |
60 | 60 | } |
61 | + try { | |
62 | + system.Option.FileView.ThumbnailWidth = Math.Min(Math.Max(80, int.Parse(this.ThumbnailWidthTextbox.Text)), 300); | |
63 | + system.Option.FileView.ThumbnailHeight = Math.Min(Math.Max(80, int.Parse(this.ThumbnailHeightTextbox.Text)), 300); | |
64 | + } catch { | |
65 | + //変換に失敗したらデフォルト値に戻す | |
66 | + system.Option.FileView.ThumbnailWidth = 120; | |
67 | + system.Option.FileView.ThumbnailHeight = 120; | |
68 | + } | |
61 | 69 | |
62 | 70 | //■色タブ |
63 | 71 | system.Option.Color.ActiveViewTitleText = colorActiveViewTitle.ForegroundColor; |
@@ -177,6 +185,8 @@ | ||
177 | 185 | this.FileIconAllDisplayRadioBUtton.Checked = true; |
178 | 186 | break; |
179 | 187 | } |
188 | + this.ThumbnailWidthTextbox.Text = system.Option.FileView.ThumbnailWidth.ToString(); | |
189 | + this.ThumbnailHeightTextbox.Text = system.Option.FileView.ThumbnailHeight.ToString(); | |
180 | 190 | |
181 | 191 | //■履歴タブ |
182 | 192 | historyview1ValidExtensionsString.Text = MainForm.Instance.FileHistoryManager1.GetValidExtension(); |
@@ -0,0 +1,36 @@ | ||
1 | +using System; | |
2 | +using System.Collections.Generic; | |
3 | +using System.Text; | |
4 | +using SCFiler2.ViewInterface; | |
5 | + | |
6 | +namespace SCFiler2.Operation { | |
7 | + public class ThumbnailMode : Action { | |
8 | + public override string DisplayString { | |
9 | + get { return "サムネイル表示"; } | |
10 | + } | |
11 | + | |
12 | + public override ActionType Type { | |
13 | + get { return ActionType.View; } | |
14 | + } | |
15 | + | |
16 | + public override void Execute() { | |
17 | + if (ViewInterfaces.CurrentItemView.Type != ViewType.FileView) { | |
18 | + SCFiler2System.ShowTempMessage(Messages.COMMAND_IS_NOT_VALID_IN_THIS_VIEW); | |
19 | + return; | |
20 | + } | |
21 | + | |
22 | + IFileView view = ViewInterfaces.LastFocusedFileView; | |
23 | + if (view.CurrentPath == "") { | |
24 | + SCFiler2System.ShowTempMessage(Messages.COMMAND_IS_NOT_VALID_FOR_DRIVE_CATALOGUE); | |
25 | + return; | |
26 | + } | |
27 | + | |
28 | + if (view.ViewMode != ViewMode.ThumbnailMode) { | |
29 | + view.ViewMode = ViewMode.ThumbnailMode; | |
30 | + } else { | |
31 | + //すでにサムネイル表示中だったら元に戻す | |
32 | + view.ViewMode = ViewMode.Normal; | |
33 | + } | |
34 | + } | |
35 | + } | |
36 | +} |
@@ -16,8 +16,8 @@ | ||
16 | 16 | using SCFiler2.ItemInterface; |
17 | 17 | using SCFiler2.EventInterface; |
18 | 18 | using System.Runtime.InteropServices; |
19 | +using System.Drawing.Imaging; | |
19 | 20 | |
20 | - | |
21 | 21 | namespace SCFiler2 { |
22 | 22 | /// <summary> |
23 | 23 | /// ファイル一覧を表示するためのビュー(SCFilerのメインとなるビュー) |
@@ -142,42 +142,81 @@ | ||
142 | 142 | /// </summary> |
143 | 143 | /// <param name="type"></param> |
144 | 144 | public void setViewMode(ViewMode type) { |
145 | - if (type == viewMode) { | |
145 | + if (type == viewMode) { //変更なしだったら何もしないで抜ける | |
146 | 146 | return; |
147 | 147 | } |
148 | 148 | |
149 | + //まず現在の状態を終了する | |
150 | + switch (this.viewMode) { | |
151 | + case ViewMode.PreviewInPreviewMode: | |
152 | + this.exitPreview(); | |
153 | + break; | |
154 | + case ViewMode.ThumbnailMode: | |
155 | + this.exitThumbnailMode(); | |
156 | + break; | |
157 | + } | |
158 | + | |
149 | 159 | FileView anotherView = MainForm.Instance.GetAnotherFileView(this); |
150 | 160 | |
151 | 161 | switch (type) { |
152 | 162 | case ViewMode.Normal: |
153 | - if (this.viewMode == ViewMode.PreviewInPreviewMode) { | |
154 | - //現在プレビュー状態だったらやめる | |
155 | - this.exitPreview(); | |
156 | - } | |
163 | + this.listView.View = View.Details; | |
157 | 164 | this.listView.Visible = true; |
158 | 165 | this.listView.Dock = DockStyle.Fill; |
159 | 166 | this.previewPictureBox.Visible = false; |
160 | 167 | this.viewMode = ViewMode.Normal; |
161 | - anotherView.setViewMode(ViewMode.Normal); | |
162 | 168 | break; |
163 | - case ViewMode.ListInPreviewMode: | |
164 | - this.listView.Visible = true; | |
165 | - this.listView.Dock = DockStyle.Fill; | |
166 | - this.previewPictureBox.Visible = false; | |
167 | - this.viewMode = ViewMode.ListInPreviewMode; | |
168 | - anotherView.setViewMode(ViewMode.PreviewInPreviewMode); | |
169 | - break; | |
169 | + //case ViewMode.ListInPreviewMode: | |
170 | + // this.listView.Visible = true; | |
171 | + // this.listView.Dock = DockStyle.Fill; | |
172 | + // this.listView.View = View.Details; | |
173 | + // this.previewPictureBox.Visible = false; | |
174 | + // this.viewMode = ViewMode.ListInPreviewMode; | |
175 | + // anotherView.setViewMode(ViewMode.PreviewInPreviewMode); | |
176 | + // break; | |
170 | 177 | case ViewMode.PreviewInPreviewMode: |
171 | 178 | this.previewPictureBox.Visible = true; |
172 | 179 | this.previewPictureBox.Dock = DockStyle.Fill; |
173 | 180 | this.listView.Visible = false; |
174 | 181 | this.viewMode = ViewMode.PreviewInPreviewMode; |
175 | - anotherView.setViewMode(ViewMode.ListInPreviewMode); | |
182 | + //anotherView.setViewMode(ViewMode.ListInPreviewMode); | |
176 | 183 | this.drawPreview(anotherView.FocusedFilerItem); |
177 | 184 | break; |
185 | + case ViewMode.ThumbnailMode: | |
186 | + this.listView.Visible = true; | |
187 | + this.listView.Dock = DockStyle.Fill; | |
188 | + this.listView.View = View.LargeIcon; | |
189 | + this.previewPictureBox.Visible = false; | |
190 | + this.viewMode = ViewMode.ThumbnailMode; | |
191 | + this.enterThumbnailMode(); | |
192 | + break; | |
178 | 193 | } |
179 | 194 | } |
180 | 195 | |
196 | + private Image getSizeTransformedImage(Image source, int width, int height, bool IsDoNothingWhenSmall) { | |
197 | + //サイズを合わせる | |
198 | + if (IsDoNothingWhenSmall && source.Width < width && source.Height < height) { | |
199 | + return source; | |
200 | + } else { | |
201 | + Image output = new Bitmap(width, height); | |
202 | + //うまく収まるサイズの計算 | |
203 | + float rateX = (float)width / (float)source.Width; | |
204 | + float rateY = (float)height / (float)source.Height; | |
205 | + int newWidth, newHeight; | |
206 | + if (rateX < rateY) { //より小さくなる方にあわせないといけない | |
207 | + newWidth = (int)(source.Width * rateX); | |
208 | + newHeight = (int)(source.Height * rateX); | |
209 | + } else { | |
210 | + newWidth = (int)(source.Width * rateY); | |
211 | + newHeight = (int)(source.Height * rateY); | |
212 | + } | |
213 | + Graphics g = Graphics.FromImage(output); | |
214 | + g.FillRectangle( new SolidBrush(Color.White) , 0, 0, width, height); | |
215 | + g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.Bilinear; | |
216 | + g.DrawImage(source, 0, 0, newWidth, newHeight); | |
217 | + return output; | |
218 | + } | |
219 | + } | |
181 | 220 | |
182 | 221 | #region プレビュー関係 |
183 | 222 |
@@ -187,14 +226,38 @@ | ||
187 | 226 | /// プレビュー領域にtargetItemを描画する(今は画像のプレビューのみ) |
188 | 227 | /// </summary> |
189 | 228 | /// <param name="targetItem"></param> |
190 | - public void drawPreview(IFilerItem targetItem) { | |
229 | + private void drawPreview(IFilerItem targetItem) { | |
230 | + this.currentPathText.Text = "プレビューモード"; | |
231 | + | |
232 | + if (targetItem.Type != ItemType.File) { //ファイル以外は表示しない | |
233 | + previewPictureBox.Image = null;//画像を消去 | |
234 | + return; | |
235 | + } | |
236 | + | |
191 | 237 | if (previewingItem != null && previewingItem.FullName == targetItem.FullName) { |
192 | 238 | return; |
193 | 239 | } |
194 | 240 | |
195 | 241 | Bitmap srcBitmap = susie.GetPicture(targetItem.FullName); |
242 | + | |
243 | + //Susieで表示できないときはWindowsの標準デコーダで表示を試みる | |
196 | 244 | if (srcBitmap == null) { |
197 | - srcBitmap = (Bitmap)Bitmap.FromFile(targetItem.FullName); | |
245 | + try { | |
246 | + ImageCodecInfo[] codecs = ImageCodecInfo.GetImageDecoders(); | |
247 | + foreach (ImageCodecInfo info in codecs) { | |
248 | + string[] extensions = info.FilenameExtension.Split(';'); | |
249 | + foreach (string ext in extensions) { | |
250 | + if (String.Compare(targetItem.Extension, 0, ext, 1, ext.Length, true) == 0) { | |
251 | + srcBitmap = (Bitmap)Bitmap.FromFile(targetItem.FullName); | |
252 | + break; | |
253 | + } | |
254 | + } | |
255 | + } | |
256 | + } catch (OutOfMemoryException) { | |
257 | + SCFiler2System.ShowTempMessage("OutOfMemoryエラーです。ファイルが壊れている、または、拡張子が正しくない可能性があります。"); | |
258 | + previewPictureBox.Image = null; | |
259 | + return; | |
260 | + } | |
198 | 261 | } |
199 | 262 | |
200 | 263 | if (srcBitmap != null) { |
@@ -230,13 +293,72 @@ | ||
230 | 293 | } |
231 | 294 | } |
232 | 295 | |
233 | - public void exitPreview() { | |
296 | + private void exitPreview() { | |
234 | 297 | previewingItem = null; |
298 | + this.currentPathText.Text = this.currentPath; | |
235 | 299 | } |
236 | 300 | |
237 | 301 | #endregion プレビュー関係 |
238 | 302 | |
303 | + #region サムネイル関係 | |
304 | + | |
305 | + private void enterThumbnailMode() { | |
306 | + int thumbnailWidth = SCFiler2System.Instance.Option.FileView.ThumbnailWidth; | |
307 | + int thumbnailHeight = SCFiler2System.Instance.Option.FileView.ThumbnailHeight; | |
308 | + | |
309 | + this.listView.View = View.LargeIcon; | |
310 | + this.listView.LargeImageList = new ImageList(); | |
311 | + | |
312 | + this.listView.LargeImageList.ImageSize = new Size(thumbnailWidth, thumbnailHeight); | |
313 | + | |
314 | + Bitmap folderIcon = Icons.Folder.ToBitmap(); | |
315 | + Image folderThumbnail = getSizeTransformedImage(folderIcon, thumbnailWidth, thumbnailHeight, false); | |
316 | + foreach (VirtualListViewItem item in this.virtualListView.Items) { | |
317 | + switch (item.FilerItem.Type) { | |
318 | + case ItemType.Folder: | |
319 | + this.listView.LargeImageList.Images.Add(folderThumbnail); | |
320 | + item.Item.ImageIndex = this.listView.LargeImageList.Images.Count - 1; | |
321 | + break; | |
322 | + case ItemType.File: | |
323 | + Bitmap image = null; | |
324 | + try { | |
325 | + image = (Bitmap)ImageUtil.getImage(item.FilerItem); | |
326 | + } catch (OutOfMemoryException) { | |
327 | + SCFiler2System.ShowHistoryMessage(item.FilerItem.Name + "は読み込めません"); | |
328 | + } | |
329 | + if (image != null) { | |
330 | + this.listView.LargeImageList.Images.Add(getSizeTransformedImage(image, thumbnailWidth, thumbnailHeight, false)); | |
331 | + item.Item.ImageIndex = this.listView.LargeImageList.Images.Count - 1; | |
332 | + image.Dispose(); | |
333 | + break; | |
334 | + } else { | |
335 | + item.Item.ImageIndex = -1; | |
336 | + break; | |
337 | + } | |
338 | + default: | |
339 | + item.Item.ImageIndex = -1; | |
340 | + break; | |
341 | + } | |
342 | + | |
343 | + } | |
344 | + } | |
345 | + | |
239 | 346 | /// <summary> |
347 | + /// サムネイル表示を終了するときの処理 | |
348 | + /// </summary> | |
349 | + private void exitThumbnailMode() { | |
350 | + if (this.viewMode != ViewMode.ThumbnailMode) { | |
351 | + return; | |
352 | + } | |
353 | + | |
354 | + foreach (VirtualListViewItem item in this.virtualListView.Items) { | |
355 | + item.Item.ImageIndex = item.SmallImageIndex; | |
356 | + } | |
357 | + } | |
358 | + | |
359 | + #endregion サムネイル関係 | |
360 | + | |
361 | + /// <summary> | |
240 | 362 | /// 終了時にMainFormから呼ばれる |
241 | 363 | /// </summary> |
242 | 364 | public void Terminate() { |
@@ -281,6 +403,12 @@ | ||
281 | 403 | SCFiler2System.ShowDialogMessage(fullName+"は存在しないか、アクセスできません"); |
282 | 404 | return; |
283 | 405 | } |
406 | + | |
407 | + if (this.viewMode == ViewMode.ThumbnailMode) { | |
408 | + exitThumbnailMode(); | |
409 | + setViewMode(ViewMode.Normal); | |
410 | + } | |
411 | + | |
284 | 412 | previousPath = currentPath; |
285 | 413 | currentPath = fullName; |
286 | 414 | NarrowDownTextBox.Text = ""; |
@@ -561,6 +689,11 @@ | ||
561 | 689 | /// <param name="sender"></param> |
562 | 690 | /// <param name="e"></param> |
563 | 691 | private void fileListView_KeyDown(object sender, KeyEventArgs e) { |
692 | + if (this.listView.View == View.LargeIcon && (e.KeyCode == Keys.Left || e.KeyCode == Keys.Right) && | |
693 | + !e.Shift && !e.Control && !e.Alt) { | |
694 | + return; | |
695 | + } | |
696 | + | |
564 | 697 | //ListViewコントローラの優先処理 |
565 | 698 | ListViewController.Result result = currentListViewController.KeyProcessingBeforeKeyCommand(e); |
566 | 699 | switch (result) { |
@@ -923,15 +1056,6 @@ | ||
923 | 1056 | |
924 | 1057 | } |
925 | 1058 | |
926 | - /// <summary> | |
927 | - /// フォーカスしているアイテムが替わった時の処理 | |
928 | - /// </summary> | |
929 | - public void FocusedItemChanged() { | |
930 | - if (ViewMode == ViewMode.ListInPreviewMode) { | |
931 | - MainForm.Instance.GetAnotherFileView(this).drawPreview(this.FocusedFilerItem); | |
932 | - } | |
933 | - } | |
934 | - | |
935 | 1059 | private void fileSystemWatcher_Changed(object sender, System.IO.FileSystemEventArgs e) { |
936 | 1060 | this.isNeedToUpdateView = true; |
937 | 1061 | } |
@@ -958,10 +1082,6 @@ | ||
958 | 1082 | if (e.Button == MouseButtons.Left || e.Button == MouseButtons.Right) { |
959 | 1083 | int index = this.listView.GetItemAt(e.X, e.Y).Index; |
960 | 1084 | this.virtualListView.Items[index].Focused = true; |
961 | - //ControlキーもShiftキーも押されていないなら、選択開始アイテムをクリックされたアイテムに変更 | |
962 | - if ((Control.ModifierKeys & Keys.Shift) != Keys.Shift && (Control.ModifierKeys & Keys.Control) != Keys.Control) { | |
963 | - this.virtualListView.SelectionStartItem = this.virtualListView.Items[index]; | |
964 | - } | |
965 | 1085 | } |
966 | 1086 | } |
967 | 1087 |
@@ -1111,8 +1231,10 @@ | ||
1111 | 1231 | } |
1112 | 1232 | |
1113 | 1233 | private void focusChangedEvent(int index) { |
1114 | - if (this.viewMode == ViewMode.ListInPreviewMode) { | |
1115 | - MainForm.Instance.GetAnotherFileView(this).drawPreview(this.virtualListView.FocusedItem.FilerItem); | |
1234 | + FileView anotherview = MainForm.Instance.GetAnotherFileView(this); | |
1235 | + if (anotherview.viewMode == ViewMode.PreviewInPreviewMode) { | |
1236 | + IFilerItem item = this.virtualListView.FocusedItem.FilerItem; | |
1237 | + anotherview.drawPreview(item); | |
1116 | 1238 | } |
1117 | 1239 | } |
1118 | 1240 | } |
@@ -42,14 +42,10 @@ | ||
42 | 42 | this.selectedIndexCollection = new SelectedIndexCollection(this); |
43 | 43 | this.sorter = new VirtualListViewComparer(0); |
44 | 44 | this.targetView.SmallImageList = new ImageList(); |
45 | - this.InitializeSmallImageList(); | |
45 | + this.targetView.LargeImageList = new ImageList(); | |
46 | + this.InitializeImageList(); | |
46 | 47 | } |
47 | 48 | |
48 | - private VirtualListViewItem selectionStartItem; | |
49 | - public VirtualListViewItem SelectionStartItem { | |
50 | - get { return this.selectionStartItem; } | |
51 | - set { this.selectionStartItem = value; } | |
52 | - } | |
53 | 49 | |
54 | 50 | /// <summary> |
55 | 51 | /// VirtualListViewが管理する対象のListViewを取得する |
@@ -63,9 +59,8 @@ | ||
63 | 59 | /// </summary> |
64 | 60 | public void Clear() { |
65 | 61 | this.itemCollection.Clear(); |
66 | - this.InitializeSmallImageList(); | |
62 | + this.InitializeImageList(); | |
67 | 63 | this.targetView.VirtualListSize = 0; |
68 | - this.selectionStartItem = null; | |
69 | 64 | } |
70 | 65 | |
71 | 66 | /// <summary> |
@@ -80,18 +75,28 @@ | ||
80 | 75 | /// </summary> |
81 | 76 | public VirtualListViewItem FocusedItem { |
82 | 77 | get { |
83 | - foreach (VirtualListViewItem item in this.Items) { | |
84 | - if (item.Focused) { | |
85 | - return item; | |
86 | - } | |
78 | + if (this.targetView.FocusedItem == null) { | |
79 | + return null; | |
80 | + } else { | |
81 | + return this.itemList[this.targetView.FocusedItem.Index]; | |
87 | 82 | } |
88 | - return null; | |
83 | + //foreach (VirtualListViewItem item in this.Items) { | |
84 | + // if (item.Focused) { | |
85 | + // return item; | |
86 | + // } | |
87 | + //} | |
88 | + //return null; | |
89 | 89 | } |
90 | 90 | set { |
91 | - if (this.focusedItem != null && this.focusedItem == value) { | |
92 | - this.focusedItem.Focused = false; | |
91 | + if (value == null) { | |
92 | + this.targetView.FocusedItem = null; | |
93 | + } else { | |
94 | + this.targetView.FocusedItem = value.Item; | |
93 | 95 | } |
94 | - this.focusedItem = value; | |
96 | + //if (this.focusedItem != null && this.focusedItem == value) { | |
97 | + // this.focusedItem.Focused = false; | |
98 | + //} | |
99 | + //this.focusedItem = value; | |
95 | 100 | } |
96 | 101 | } |
97 | 102 |
@@ -194,9 +199,9 @@ | ||
194 | 199 | } |
195 | 200 | |
196 | 201 | #region Imageindex関係 |
197 | - private Dictionary<string, int> imageKeyToIndex = new Dictionary<string, int>(); | |
202 | + private Dictionary<string, System.Drawing.Icon> smallImageListDictionary = new Dictionary<string, System.Drawing.Icon>(); | |
198 | 203 | |
199 | - internal void InitializeSmallImageList() { | |
204 | + internal void InitializeImageList() { | |
200 | 205 | this.targetView.SmallImageList.Images.Clear(); |
201 | 206 | this.targetView.SmallImageList.Images.Add(Icons.Folder); |
202 | 207 | this.targetView.SmallImageList.Images.Add(Icons.Hdd); |
@@ -203,33 +208,15 @@ | ||
203 | 208 | this.targetView.SmallImageList.Images.Add(Icons.CDROM); |
204 | 209 | this.targetView.SmallImageList.Images.Add(Icons.RemovableDrive); |
205 | 210 | this.targetView.SmallImageList.Images.Add(Icons.NetworkDrive); |
206 | - this.imageKeyToIndex.Clear(); | |
207 | 211 | } |
208 | 212 | |
209 | 213 | |
210 | - internal void RegistImage(string key, System.Drawing.Icon icon) { | |
214 | + internal int RegistSmallImage(string key, System.Drawing.Icon icon) { | |
211 | 215 | string keyUpper = key.ToUpper(); |
212 | - if (!this.targetView.SmallImageList.Images.ContainsKey(keyUpper)) { | |
213 | - this.targetView.SmallImageList.Images.Add(keyUpper, icon); | |
214 | - this.imageKeyToIndex[keyUpper] = this.targetView.SmallImageList.Images.Count - 1; | |
215 | - } | |
216 | + this.targetView.SmallImageList.Images.Add(icon); | |
217 | + return this.targetView.SmallImageList.Images.Count - 1; | |
216 | 218 | } |
217 | 219 | |
218 | - internal bool IsContainsImage(string key) { | |
219 | - return this.imageKeyToIndex.ContainsKey(key.ToUpper()); | |
220 | - } | |
221 | - | |
222 | - internal int GetImageIndex(string key) { | |
223 | - return this.imageKeyToIndex[key.ToUpper()]; | |
224 | - } | |
225 | - | |
226 | - /// <summary> | |
227 | - /// フォルダのImageIndexを取得する(ListViewItemのImageIndex) | |
228 | - /// </summary> | |
229 | - /// <returns></returns> | |
230 | - internal int GetFolderImageIndex() { | |
231 | - return (int)IconListIndex.Folder; | |
232 | - } | |
233 | 220 | #endregion |
234 | 221 | |
235 | 222 | /// <summary> |
@@ -66,6 +66,8 @@ | ||
66 | 66 | public bool IsDisplayDriveToolbar = true; |
67 | 67 | public bool IsDisplayHistoryView = true; |
68 | 68 | public FileIconDisp IconDisplay = FileIconDisp.Nothing; |
69 | + public int ThumbnailWidth = 120; | |
70 | + public int ThumbnailHeight = 120; | |
69 | 71 | |
70 | 72 | public void Save() { |
71 | 73 | OptionUtil.Save("FileViewOption", this); |
@@ -42,6 +42,10 @@ | ||
42 | 42 | this.tabPage3 = new System.Windows.Forms.TabPage(); |
43 | 43 | this.changeDriveByNumkeyCheckbox = new System.Windows.Forms.CheckBox(); |
44 | 44 | this.tabPage7 = new System.Windows.Forms.TabPage(); |
45 | + this.groupBox2 = new System.Windows.Forms.GroupBox(); | |
46 | + this.FileIconAllDisplayRadioBUtton = new System.Windows.Forms.RadioButton(); | |
47 | + this.FileIconOnlyExeDisplayRadioButton = new System.Windows.Forms.RadioButton(); | |
48 | + this.FileIconNotDisplayRadioButton = new System.Windows.Forms.RadioButton(); | |
45 | 49 | this.IsHideHistoryViewCheckbox = new System.Windows.Forms.CheckBox(); |
46 | 50 | this.IsHideDriveToolbarCheckbox = new System.Windows.Forms.CheckBox(); |
47 | 51 | this.label6 = new System.Windows.Forms.Label(); |
@@ -108,15 +112,16 @@ | ||
108 | 112 | this.externalToolAssignControl3 = new SCFiler2.ExternalToolAssignControl(); |
109 | 113 | this.externalToolAssignControl2 = new SCFiler2.ExternalToolAssignControl(); |
110 | 114 | this.externalToolAssignControl1 = new SCFiler2.ExternalToolAssignControl(); |
111 | - this.groupBox2 = new System.Windows.Forms.GroupBox(); | |
112 | - this.FileIconNotDisplayRadioButton = new System.Windows.Forms.RadioButton(); | |
113 | - this.FileIconOnlyExeDisplayRadioButton = new System.Windows.Forms.RadioButton(); | |
114 | - this.FileIconAllDisplayRadioBUtton = new System.Windows.Forms.RadioButton(); | |
115 | + this.label21 = new System.Windows.Forms.Label(); | |
116 | + this.ThumbnailWidthTextbox = new System.Windows.Forms.TextBox(); | |
117 | + this.ThumbnailHeightTextbox = new System.Windows.Forms.TextBox(); | |
118 | + this.label22 = new System.Windows.Forms.Label(); | |
115 | 119 | this.tabControl1.SuspendLayout(); |
116 | 120 | this.tabPage1.SuspendLayout(); |
117 | 121 | this.tabPage2.SuspendLayout(); |
118 | 122 | this.tabPage3.SuspendLayout(); |
119 | 123 | this.tabPage7.SuspendLayout(); |
124 | + this.groupBox2.SuspendLayout(); | |
120 | 125 | this.tabPage4.SuspendLayout(); |
121 | 126 | this.tabPage5.SuspendLayout(); |
122 | 127 | this.tabPage6.SuspendLayout(); |
@@ -124,7 +129,6 @@ | ||
124 | 129 | this.groupBox1.SuspendLayout(); |
125 | 130 | this.tabPage9.SuspendLayout(); |
126 | 131 | this.tabPage10.SuspendLayout(); |
127 | - this.groupBox2.SuspendLayout(); | |
128 | 132 | this.SuspendLayout(); |
129 | 133 | // |
130 | 134 | // tabControl1 |
@@ -335,6 +339,10 @@ | ||
335 | 339 | // |
336 | 340 | // tabPage7 |
337 | 341 | // |
342 | + this.tabPage7.Controls.Add(this.label22); | |
343 | + this.tabPage7.Controls.Add(this.ThumbnailHeightTextbox); | |
344 | + this.tabPage7.Controls.Add(this.ThumbnailWidthTextbox); | |
345 | + this.tabPage7.Controls.Add(this.label21); | |
338 | 346 | this.tabPage7.Controls.Add(this.groupBox2); |
339 | 347 | this.tabPage7.Controls.Add(this.IsHideHistoryViewCheckbox); |
340 | 348 | this.tabPage7.Controls.Add(this.IsHideDriveToolbarCheckbox); |
@@ -350,6 +358,51 @@ | ||
350 | 358 | this.tabPage7.Text = "表示"; |
351 | 359 | this.tabPage7.UseVisualStyleBackColor = true; |
352 | 360 | // |
361 | + // groupBox2 | |
362 | + // | |
363 | + this.groupBox2.Controls.Add(this.FileIconAllDisplayRadioBUtton); | |
364 | + this.groupBox2.Controls.Add(this.FileIconOnlyExeDisplayRadioButton); | |
365 | + this.groupBox2.Controls.Add(this.FileIconNotDisplayRadioButton); | |
366 | + this.groupBox2.Location = new System.Drawing.Point(422, 58); | |
367 | + this.groupBox2.Name = "groupBox2"; | |
368 | + this.groupBox2.Size = new System.Drawing.Size(134, 92); | |
369 | + this.groupBox2.TabIndex = 8; | |
370 | + this.groupBox2.TabStop = false; | |
371 | + this.groupBox2.Text = "ファイルのアイコン"; | |
372 | + // | |
373 | + // FileIconAllDisplayRadioBUtton | |
374 | + // | |
375 | + this.FileIconAllDisplayRadioBUtton.AutoSize = true; | |
376 | + this.FileIconAllDisplayRadioBUtton.Location = new System.Drawing.Point(7, 63); | |
377 | + this.FileIconAllDisplayRadioBUtton.Name = "FileIconAllDisplayRadioBUtton"; | |
378 | + this.FileIconAllDisplayRadioBUtton.Size = new System.Drawing.Size(68, 16); | |
379 | + this.FileIconAllDisplayRadioBUtton.TabIndex = 2; | |
380 | + this.FileIconAllDisplayRadioBUtton.TabStop = true; | |
381 | + this.FileIconAllDisplayRadioBUtton.Text = "全て表示"; | |
382 | + this.FileIconAllDisplayRadioBUtton.UseVisualStyleBackColor = true; | |
383 | + // | |
384 | + // FileIconOnlyExeDisplayRadioButton | |
385 | + // | |
386 | + this.FileIconOnlyExeDisplayRadioButton.AutoSize = true; | |
387 | + this.FileIconOnlyExeDisplayRadioButton.Location = new System.Drawing.Point(7, 41); | |
388 | + this.FileIconOnlyExeDisplayRadioButton.Name = "FileIconOnlyExeDisplayRadioButton"; | |
389 | + this.FileIconOnlyExeDisplayRadioButton.Size = new System.Drawing.Size(120, 16); | |
390 | + this.FileIconOnlyExeDisplayRadioButton.TabIndex = 1; | |
391 | + this.FileIconOnlyExeDisplayRadioButton.TabStop = true; | |
392 | + this.FileIconOnlyExeDisplayRadioButton.Text = "exeファイルのみ表示"; | |
393 | + this.FileIconOnlyExeDisplayRadioButton.UseVisualStyleBackColor = true; | |
394 | + // | |
395 | + // FileIconNotDisplayRadioButton | |
396 | + // | |
397 | + this.FileIconNotDisplayRadioButton.AutoSize = true; | |
398 | + this.FileIconNotDisplayRadioButton.Location = new System.Drawing.Point(7, 19); | |
399 | + this.FileIconNotDisplayRadioButton.Name = "FileIconNotDisplayRadioButton"; | |
400 | + this.FileIconNotDisplayRadioButton.Size = new System.Drawing.Size(76, 16); | |
401 | + this.FileIconNotDisplayRadioButton.TabIndex = 0; | |
402 | + this.FileIconNotDisplayRadioButton.TabStop = true; | |
403 | + this.FileIconNotDisplayRadioButton.Text = "表示しない"; | |
404 | + this.FileIconNotDisplayRadioButton.UseVisualStyleBackColor = true; | |
405 | + // | |
353 | 406 | // IsHideHistoryViewCheckbox |
354 | 407 | // |
355 | 408 | this.IsHideHistoryViewCheckbox.AutoSize = true; |
@@ -991,50 +1044,39 @@ | ||
991 | 1044 | this.externalToolAssignControl1.Size = new System.Drawing.Size(548, 29); |
992 | 1045 | this.externalToolAssignControl1.TabIndex = 0; |
993 | 1046 | // |
994 | - // groupBox2 | |
1047 | + // label21 | |
995 | 1048 | // |
996 | - this.groupBox2.Controls.Add(this.FileIconAllDisplayRadioBUtton); | |
997 | - this.groupBox2.Controls.Add(this.FileIconOnlyExeDisplayRadioButton); | |
998 | - this.groupBox2.Controls.Add(this.FileIconNotDisplayRadioButton); | |
999 | - this.groupBox2.Location = new System.Drawing.Point(422, 58); | |
1000 | - this.groupBox2.Name = "groupBox2"; | |
1001 | - this.groupBox2.Size = new System.Drawing.Size(134, 92); | |
1002 | - this.groupBox2.TabIndex = 8; | |
1003 | - this.groupBox2.TabStop = false; | |
1004 | - this.groupBox2.Text = "ファイルのアイコン"; | |
1049 | + this.label21.AutoSize = true; | |
1050 | + this.label21.Location = new System.Drawing.Point(420, 162); | |
1051 | + this.label21.Name = "label21"; | |
1052 | + this.label21.Size = new System.Drawing.Size(143, 12); | |
1053 | + this.label21.TabIndex = 9; | |
1054 | + this.label21.Text = "サムネイルの大きさ(80~300)"; | |
1005 | 1055 | // |
1006 | - // FileIconNotDisplayRadioButton | |
1056 | + // ThumbnailWidthTextbox | |
1007 | 1057 | // |
1008 | - this.FileIconNotDisplayRadioButton.AutoSize = true; | |
1009 | - this.FileIconNotDisplayRadioButton.Location = new System.Drawing.Point(7, 19); | |
1010 | - this.FileIconNotDisplayRadioButton.Name = "FileIconNotDisplayRadioButton"; | |
1011 | - this.FileIconNotDisplayRadioButton.Size = new System.Drawing.Size(76, 16); | |
1012 | - this.FileIconNotDisplayRadioButton.TabIndex = 0; | |
1013 | - this.FileIconNotDisplayRadioButton.TabStop = true; | |
1014 | - this.FileIconNotDisplayRadioButton.Text = "表示しない"; | |
1015 | - this.FileIconNotDisplayRadioButton.UseVisualStyleBackColor = true; | |
1058 | + this.ThumbnailWidthTextbox.ImeMode = System.Windows.Forms.ImeMode.Off; | |
1059 | + this.ThumbnailWidthTextbox.Location = new System.Drawing.Point(429, 177); | |
1060 | + this.ThumbnailWidthTextbox.Name = "ThumbnailWidthTextbox"; | |
1061 | + this.ThumbnailWidthTextbox.Size = new System.Drawing.Size(49, 19); | |
1062 | + this.ThumbnailWidthTextbox.TabIndex = 10; | |
1016 | 1063 | // |
1017 | - // OnlyExeIconDisplayRadioButton | |
1064 | + // ThumbnailHeightTextbox | |
1018 | 1065 | // |
1019 | - this.FileIconOnlyExeDisplayRadioButton.AutoSize = true; | |
1020 | - this.FileIconOnlyExeDisplayRadioButton.Location = new System.Drawing.Point(7, 41); | |
1021 | - this.FileIconOnlyExeDisplayRadioButton.Name = "OnlyExeIconDisplayRadioButton"; | |
1022 | - this.FileIconOnlyExeDisplayRadioButton.Size = new System.Drawing.Size(120, 16); | |
1023 | - this.FileIconOnlyExeDisplayRadioButton.TabIndex = 1; | |
1024 | - this.FileIconOnlyExeDisplayRadioButton.TabStop = true; | |
1025 | - this.FileIconOnlyExeDisplayRadioButton.Text = "exeファイルのみ表示"; | |
1026 | - this.FileIconOnlyExeDisplayRadioButton.UseVisualStyleBackColor = true; | |
1066 | + this.ThumbnailHeightTextbox.ImeMode = System.Windows.Forms.ImeMode.Off; | |
1067 | + this.ThumbnailHeightTextbox.Location = new System.Drawing.Point(507, 177); | |
1068 | + this.ThumbnailHeightTextbox.Name = "ThumbnailHeightTextbox"; | |
1069 | + this.ThumbnailHeightTextbox.Size = new System.Drawing.Size(49, 19); | |
1070 | + this.ThumbnailHeightTextbox.TabIndex = 11; | |
1027 | 1071 | // |
1028 | - // FileIconAllDisplayRadioBUtton | |
1072 | + // label22 | |
1029 | 1073 | // |
1030 | - this.FileIconAllDisplayRadioBUtton.AutoSize = true; | |
1031 | - this.FileIconAllDisplayRadioBUtton.Location = new System.Drawing.Point(7, 63); | |
1032 | - this.FileIconAllDisplayRadioBUtton.Name = "FileIconAllDisplayRadioBUtton"; | |
1033 | - this.FileIconAllDisplayRadioBUtton.Size = new System.Drawing.Size(68, 16); | |
1034 | - this.FileIconAllDisplayRadioBUtton.TabIndex = 2; | |
1035 | - this.FileIconAllDisplayRadioBUtton.TabStop = true; | |
1036 | - this.FileIconAllDisplayRadioBUtton.Text = "全て表示"; | |
1037 | - this.FileIconAllDisplayRadioBUtton.UseVisualStyleBackColor = true; | |
1074 | + this.label22.AutoSize = true; | |
1075 | + this.label22.Location = new System.Drawing.Point(485, 181); | |
1076 | + this.label22.Name = "label22"; | |
1077 | + this.label22.Size = new System.Drawing.Size(17, 12); | |
1078 | + this.label22.TabIndex = 12; | |
1079 | + this.label22.Text = "×"; | |
1038 | 1080 | // |
1039 | 1081 | // OptionDialog |
1040 | 1082 | // |
@@ -1057,6 +1099,8 @@ | ||
1057 | 1099 | this.tabPage3.PerformLayout(); |
1058 | 1100 | this.tabPage7.ResumeLayout(false); |
1059 | 1101 | this.tabPage7.PerformLayout(); |
1102 | + this.groupBox2.ResumeLayout(false); | |
1103 | + this.groupBox2.PerformLayout(); | |
1060 | 1104 | this.tabPage4.ResumeLayout(false); |
1061 | 1105 | this.tabPage4.PerformLayout(); |
1062 | 1106 | this.tabPage5.ResumeLayout(false); |
@@ -1069,8 +1113,6 @@ | ||
1069 | 1113 | this.tabPage9.PerformLayout(); |
1070 | 1114 | this.tabPage10.ResumeLayout(false); |
1071 | 1115 | this.tabPage10.PerformLayout(); |
1072 | - this.groupBox2.ResumeLayout(false); | |
1073 | - this.groupBox2.PerformLayout(); | |
1074 | 1116 | this.ResumeLayout(false); |
1075 | 1117 | |
1076 | 1118 | } |
@@ -1166,5 +1208,9 @@ | ||
1166 | 1208 | private System.Windows.Forms.RadioButton FileIconNotDisplayRadioButton; |
1167 | 1209 | private System.Windows.Forms.RadioButton FileIconAllDisplayRadioBUtton; |
1168 | 1210 | private System.Windows.Forms.RadioButton FileIconOnlyExeDisplayRadioButton; |
1211 | + private System.Windows.Forms.Label label21; | |
1212 | + private System.Windows.Forms.TextBox ThumbnailHeightTextbox; | |
1213 | + private System.Windows.Forms.TextBox ThumbnailWidthTextbox; | |
1214 | + private System.Windows.Forms.Label label22; | |
1169 | 1215 | } |
1170 | 1216 | } |
\ No newline at end of file |
@@ -73,11 +73,6 @@ | ||
73 | 73 | //何もしない |
74 | 74 | } |
75 | 75 | } |
76 | - if (this.parentView.SelectedItems.Count == 1) { | |
77 | - this.parentView.SelectionStartItem = this; | |
78 | - } else if (this.parentView.SelectedItems.Count == 0) { | |
79 | - this.parentView.SelectionStartItem = null; | |
80 | - } | |
81 | 76 | } |
82 | 77 | |
83 | 78 | get { |
@@ -90,20 +85,11 @@ | ||
90 | 85 | /// </summary> |
91 | 86 | public bool Focused { |
92 | 87 | set { |
93 | - if (this.viewItem != null) { | |
94 | - this.viewItem.Focused = value; | |
95 | - } else { | |
96 | - this.createListViewItem(); | |
97 | - this.viewItem.Focused = value; | |
98 | - } | |
88 | + this.parentView.AssignedListView.Items[this.Index].Focused = value; | |
99 | 89 | } |
100 | 90 | |
101 | 91 | get { |
102 | - if (this.viewItem == null) { | |
103 | - return false; | |
104 | - } else { | |
105 | - return this.viewItem.Focused; | |
106 | - } | |
92 | + return this.parentView.AssignedListView.Items[this.Index].Focused; | |
107 | 93 | } |
108 | 94 | } |
109 | 95 |
@@ -147,6 +133,17 @@ | ||
147 | 133 | this.parentView.EnsureVisible(this.Index); |
148 | 134 | } |
149 | 135 | |
136 | + private int smallImageIndex = -1; | |
137 | + public int SmallImageIndex { | |
138 | + get { return smallImageIndex; } | |
139 | + } | |
140 | + | |
141 | + private int largeImageIndex = -1; | |
142 | + public int LargeImageIndex { | |
143 | + get { return largeImageIndex;} | |
144 | + set { largeImageIndex = value; } | |
145 | + } | |
146 | + | |
150 | 147 | /// <summary> |
151 | 148 | /// このVirtualListViewItemが表すListViewItemを生成する |
152 | 149 | /// </summary> |
@@ -158,6 +155,7 @@ | ||
158 | 155 | switch (this.targetItem.Type) { |
159 | 156 | case ItemType.Folder: |
160 | 157 | this.viewItem.SubItems.Add("<dir>");//拡張子列 |
158 | + this.smallImageIndex = 0; | |
161 | 159 | this.viewItem.ImageIndex = 0; |
162 | 160 | break; |
163 | 161 | case ItemType.File: |
@@ -168,16 +166,11 @@ | ||
168 | 166 | //何も表示しない |
169 | 167 | } else { |
170 | 168 | if (targetItem.Extension.ToUpper() == ".EXE") { // exeはどちらのモードでも表示 |
171 | - this.parentView.RegistImage(targetItem.Name, System.Drawing.Icon.ExtractAssociatedIcon(targetItem.FullName)); | |
172 | - this.viewItem.ImageIndex = this.parentView.GetImageIndex(targetItem.Name); | |
169 | + this.smallImageIndex = this.parentView.RegistSmallImage(targetItem.Name, targetItem.Icon); | |
170 | + this.viewItem.ImageIndex = this.smallImageIndex; | |
173 | 171 | } else if (SCFiler2System.Instance.Option.FileView.IconDisplay == SCFiler2System.OptionClass.FileViewOption.FileIconDisp.All) { |
174 | - //登録済みだったらindexを取得、でなければ登録して登録したindexを取得 | |
175 | - if (this.parentView.IsContainsImage(targetItem.Extension)) { | |
176 | - this.viewItem.ImageIndex = this.parentView.GetImageIndex(targetItem.Extension); | |
177 | - } else { | |
178 | - this.parentView.RegistImage(targetItem.Extension, System.Drawing.Icon.ExtractAssociatedIcon(targetItem.FullName)); | |
179 | - this.viewItem.ImageIndex = this.parentView.GetImageIndex(targetItem.Extension); | |
180 | - } | |
172 | + this.smallImageIndex = this.parentView.RegistSmallImage(targetItem.Extension, targetItem.Icon); | |
173 | + this.viewItem.ImageIndex = this.smallImageIndex; | |
181 | 174 | } |
182 | 175 | } |
183 | 176 | break; |
@@ -185,21 +178,22 @@ | ||
185 | 178 | Drive drive = (Drive)targetItem; |
186 | 179 | switch (drive.DriveType) { |
187 | 180 | case System.IO.DriveType.Fixed: |
188 | - this.viewItem.ImageIndex = (int)VirtualListView.IconListIndex.Hdd; | |
181 | + this.smallImageIndex = (int)VirtualListView.IconListIndex.Hdd; | |
189 | 182 | break; |
190 | 183 | case System.IO.DriveType.CDRom: |
191 | - this.viewItem.ImageIndex = (int)VirtualListView.IconListIndex.CDROM; | |
184 | + this.smallImageIndex = (int)VirtualListView.IconListIndex.CDROM; | |
192 | 185 | break; |
193 | 186 | case System.IO.DriveType.Removable: |
194 | - this.viewItem.ImageIndex = (int)VirtualListView.IconListIndex.Removable; | |
187 | + this.smallImageIndex = (int)VirtualListView.IconListIndex.Removable; | |
195 | 188 | break; |
196 | 189 | case System.IO.DriveType.Network: |
197 | - this.viewItem.ImageIndex = (int)VirtualListView.IconListIndex.NetworkDrive; | |
190 | + this.smallImageIndex = (int)VirtualListView.IconListIndex.NetworkDrive; | |
198 | 191 | break; |
199 | 192 | default: |
200 | - this.viewItem.ImageIndex = (int)VirtualListView.IconListIndex.Hdd; | |
193 | + this.smallImageIndex = (int)VirtualListView.IconListIndex.Hdd; | |
201 | 194 | break; |
202 | 195 | } |
196 | + this.viewItem.ImageIndex = this.smallImageIndex; | |
203 | 197 | this.viewItem.SubItems.Add(""); |
204 | 198 | break; |
205 | 199 | } |
@@ -1,6 +1,7 @@ | ||
1 | 1 | 更新履歴 |
2 | 2 | |
3 | 3 | ■0.39 |
4 | +・サムネイル表示に対応した | |
4 | 5 | ・キー割り当てを以下のキーに対して可能にした |
5 | 6 | 矢印上下、Home, End, PageUp, PageDown, insert |
6 | 7 | 制約として、Ctrl+矢印およびCtrl+スペースキーに割り当てた機能は、「スペースで選択」モードではキーが効きません |
@@ -144,53 +144,19 @@ | ||
144 | 144 | this.targetListView.SelectedItems.Clear(); |
145 | 145 | destItem.Selected = true; |
146 | 146 | destItem.Focused = true; |
147 | - this.parentView.FocusedItemChanged(); | |
147 | + //this.parentView.FocusedItemChanged(); | |
148 | 148 | destItem.EnsureVisible(); |
149 | 149 | |
150 | - this.targetListView.SelectionStartItem = destItem; | |
151 | 150 | this.targetListView.Update(); |
152 | 151 | } |
153 | 152 | |
154 | 153 | /// <summary> |
155 | - /// 選択開始アイテムからdestItemまでを選択状態にし、destItemにフォーカスを移す | |
156 | - /// </summary> | |
157 | - /// <param name="destItem"></param> | |
158 | - protected void SelectingMove(VirtualListViewItem destItem) { | |
159 | - if (this.targetListView.SelectionStartItem == null) { | |
160 | - this.targetListView.SelectionStartItem = this.targetListView.FocusedItem; | |
161 | - } | |
162 | - | |
163 | - VirtualListViewItem start = this.targetListView.SelectionStartItem; | |
164 | - if (start == null && !targetListView.SelectedItems.Contains(this.targetListView.SelectionStartItem)) { | |
165 | - start = targetListView.SelectedItems[0]; | |
166 | - } | |
167 | - VirtualListViewItem from, to; | |
168 | - if (start.Index < destItem.Index) { | |
169 | - from = start; | |
170 | - to = destItem; | |
171 | - } else { | |
172 | - from = destItem; | |
173 | - to = start; | |
174 | - } | |
175 | - | |
176 | - this.targetListView.SelectedItems.Clear(); | |
177 | - for (int i = from.Index; i <= to.Index; i++) { | |
178 | - targetListView.Items[i].Selected = true; | |
179 | - } | |
180 | - destItem.Focused = true; | |
181 | - this.targetListView.SelectionStartItem = start; | |
182 | - this.parentView.FocusedItemChanged(); | |
183 | - destItem.EnsureVisible(); | |
184 | - this.targetListView.Update(); | |
185 | - } | |
186 | - | |
187 | - /// <summary> | |
188 | 154 | /// 現在の選択状態は一切変更せずに、フォーカスのみdestItemに移す |
189 | 155 | /// </summary> |
190 | 156 | /// <param name="destItem"></param> |
191 | 157 | protected void OnlyFocusMove(VirtualListViewItem destItem) { |
192 | 158 | destItem.Focused = true; |
193 | - this.parentView.FocusedItemChanged(); | |
159 | + //this.parentView.FocusedItemChanged(); | |
194 | 160 | destItem.EnsureVisible(); |
195 | 161 | this.targetListView.Update(); |
196 | 162 | } |
@@ -18,12 +18,10 @@ | ||
18 | 18 | IFileView focusedView = ViewInterfaces.LastFocusedFileView; |
19 | 19 | IFileView unfocusedView = ViewInterfaces.OtherOfLastFocusedFileView; |
20 | 20 | |
21 | - if (focusedView.ViewMode == ViewMode.Normal) { | |
22 | - focusedView.ViewMode = ViewMode.ListInPreviewMode; | |
21 | + if (unfocusedView.ViewMode != ViewMode.PreviewInPreviewMode) { | |
23 | 22 | unfocusedView.ViewMode = ViewMode.PreviewInPreviewMode; |
24 | 23 | } else { |
25 | 24 | //すでにプレビュー中だったらプレビューモードを抜ける |
26 | - focusedView.ViewMode = ViewMode.Normal; | |
27 | 25 | unfocusedView.ViewMode = ViewMode.Normal; |
28 | 26 | } |
29 | 27 | } |