Skip to content

Commit e29ed43

Browse files
committed
1) Реализован нумерованный список.
2) fix. Исправлено выравнивание по ширине. Добавлена отдельная кнопка "Выровнять текст по ширине". 3) fix. В меню "Файл", пункт "Сохранить" меняет иконку при смене набора иконок.
1 parent ece07db commit e29ed43

File tree

9 files changed

+1669
-1194
lines changed

9 files changed

+1669
-1194
lines changed

GradientControl/GradientControl.csproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@
5454
<Compile Include="StatusStripGradient.cs">
5555
<SubType>Component</SubType>
5656
</Compile>
57+
<Compile Include="ToolStripSplitButtonWithCheck.cs">
58+
<SubType>Component</SubType>
59+
</Compile>
5760
<Compile Include="ToolStripGradient.cs">
5861
<SubType>Component</SubType>
5962
</Compile>
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
using System;
2+
using System.ComponentModel;
3+
using System.Windows.Forms;
4+
using System.Drawing;
5+
using System.Drawing.Drawing2D;
6+
7+
namespace GradientControls
8+
{
9+
10+
/// <summary>
11+
/// ToolStripSplitCheckButton adds a Check property to a ToolStripSplitButton.
12+
/// </summary>
13+
public partial class ToolStripSplitCheckButton : ToolStripSplitButton
14+
{
15+
private bool _checked;
16+
private static ProfessionalColorTable _professionalColorTable;
17+
18+
19+
public bool Checked
20+
{
21+
get
22+
{
23+
return _checked;
24+
}
25+
set
26+
{
27+
_checked = value;
28+
Invalidate();
29+
}
30+
}
31+
32+
33+
private void RenderCheckedButtonFill(Graphics g, Rectangle bounds)
34+
{
35+
if ((bounds.Width == 0) || (bounds.Height == 0))
36+
{
37+
return;
38+
}
39+
40+
if (!UseSystemColors)
41+
{
42+
using (Brush b = new LinearGradientBrush(bounds, ColorTable.ButtonCheckedGradientBegin, ColorTable.ButtonCheckedGradientEnd, LinearGradientMode.Vertical))
43+
{
44+
g.FillRectangle(b, bounds);
45+
}
46+
}
47+
else
48+
{
49+
Color fillColor = ColorTable.ButtonCheckedHighlight;
50+
51+
using (Brush b = new SolidBrush(fillColor))
52+
{
53+
g.FillRectangle(b, bounds);
54+
}
55+
}
56+
}
57+
58+
private bool UseSystemColors
59+
{
60+
get { return (ColorTable.UseSystemColors || !ToolStripManager.VisualStylesEnabled); }
61+
}
62+
63+
64+
private static ProfessionalColorTable ColorTable
65+
{
66+
get
67+
{
68+
if (_professionalColorTable == null)
69+
{
70+
_professionalColorTable = new ProfessionalColorTable();
71+
}
72+
return _professionalColorTable;
73+
}
74+
}
75+
76+
protected override void OnPaint(PaintEventArgs e)
77+
{
78+
if (_checked)
79+
{
80+
Graphics g = e.Graphics;
81+
Rectangle bounds = new Rectangle(Point.Empty, Size);
82+
83+
RenderCheckedButtonFill(g, bounds);
84+
85+
using (Pen p = new Pen(ColorTable.ButtonSelectedBorder))
86+
{
87+
g.DrawRectangle(p, bounds.X, bounds.Y, bounds.Width - 1, bounds.Height - 1);
88+
}
89+
}
90+
base.OnPaint(e);
91+
}
92+
}
93+
}
94+

WordEditor/AppSettingsForm.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1171,9 +1171,9 @@ private bool LoadIconsFromDir(string iconDirPath)
11711171
case "align_right":
11721172
mf.ImageAlignRight = Image.FromFile(file);
11731173
break;
1174-
//case "align_justify":
1175-
// mf.ImageAlignJustify = Image.FromFile(file);
1176-
// break;
1174+
case "align_justify":
1175+
mf.ImageAlignJustify = Image.FromFile(file);
1176+
break;
11771177
case "line_spacing":
11781178
mf.ImageLineSpacing = Image.FromFile(file);
11791179
break;

WordEditor/LastUpdateInfo.xml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<VersionConfig>
33
<!--Последняя доступная версия-->
4-
<LastVersion>2.10.0.0</LastVersion>
4+
<LastVersion>2.11.0.0</LastVersion>
55
<!--Описание изменений-->
6-
<LatestChanges>1) На вкладке "Поиск" реализован глобальный поиск. Добавлены кнопки поиска вверх и вниз по найденным заметкам. При этом дополнительные настройки локального поиска (Ctrl+F) "С учетом регистра", "Только слово целиком" действуют и на глобальный поиск
7-
2) Реализован быстрый скроллинг (по умолчанию отключен), который можно включить/отключить в настройках
8-
3) Обновлена иконка приложения
9-
4) Добавлен набор иконок "Gnome (24x24)"
6+
<LatestChanges>1) Реализован нумерованный список
7+
2) fix. Исправлено выравнивание по ширине. Добавлена отдельная кнопка "Выровнять текст по ширине"
8+
3) fix. В меню "Файл", пункт "Сохранить" меняет иконку при смене набора иконок
9+
4) Добавлен набор иконок "WPS Office (24x24)"
1010
</LatestChanges>
1111
<!--Ширина окна с информацией об обновлении-->
1212
<Width>334</Width>

0 commit comments

Comments
 (0)