From 646e0dea2d284a77520378af15d5b1521c3fcd01 Mon Sep 17 00:00:00 2001 From: Curtis Wensley Date: Sat, 11 Mar 2023 09:34:56 -0800 Subject: [PATCH] Convert the remainder of character format icons to ansi - Use common ColourBox control for Rip/Character colour selection --- Source/Pablo/Drawing/ColourBox.cs | 22 +++++++++++ .../Character/Controls/ColourEditor.cs | 3 +- .../Formats/Character/Controls/ColourPad.cs | 13 ------- .../Formats/Character/Icons/ApplyColour.ans | Bin 0 -> 1531 bytes .../Formats/Character/Icons/ApplyColour.png | Bin 1004 -> 0 bytes .../Formats/Character/Icons/ColourBrush.ans | Bin 0 -> 1959 bytes .../Formats/Character/Icons/ColourBrush.png | Bin 1073 -> 0 bytes .../Character/Icons/DrawBackground.ans | Bin 0 -> 1504 bytes .../Character/Icons/DrawBackground.png | Bin 1004 -> 0 bytes .../Character/Icons/DrawForeground.ans | Bin 0 -> 1090 bytes .../Character/Icons/DrawForeground.png | Bin 998 -> 0 bytes .../Pablo/Formats/Character/Icons/Erase.ans | Bin 0 -> 1592 bytes .../Pablo/Formats/Character/Icons/Erase.png | Bin 1055 -> 0 bytes .../Formats/Character/Icons/Selection.ans | Bin 0 -> 752 bytes .../Formats/Character/Tools/BrushTool.cs | 8 ++-- .../Formats/Character/Tools/ColourBrush.cs | 35 ++++-------------- .../Formats/Character/Tools/EllipseTool.cs | 6 +-- .../Pablo/Formats/Character/Tools/LineTool.cs | 6 +-- .../Formats/Character/Tools/PencilTool.cs | 12 ++---- .../Formats/Character/Tools/RectangleTool.cs | 4 +- .../Formats/Character/Tools/Selection.cs | 28 +++----------- .../Pablo/Formats/Rip/Controls/ColourPad.cs | 15 +------- 22 files changed, 52 insertions(+), 100 deletions(-) create mode 100644 Source/Pablo/Drawing/ColourBox.cs create mode 100644 Source/Pablo/Formats/Character/Icons/ApplyColour.ans delete mode 100644 Source/Pablo/Formats/Character/Icons/ApplyColour.png create mode 100644 Source/Pablo/Formats/Character/Icons/ColourBrush.ans delete mode 100644 Source/Pablo/Formats/Character/Icons/ColourBrush.png create mode 100644 Source/Pablo/Formats/Character/Icons/DrawBackground.ans delete mode 100644 Source/Pablo/Formats/Character/Icons/DrawBackground.png create mode 100644 Source/Pablo/Formats/Character/Icons/DrawForeground.ans delete mode 100644 Source/Pablo/Formats/Character/Icons/DrawForeground.png create mode 100644 Source/Pablo/Formats/Character/Icons/Erase.ans delete mode 100644 Source/Pablo/Formats/Character/Icons/Erase.png create mode 100644 Source/Pablo/Formats/Character/Icons/Selection.ans diff --git a/Source/Pablo/Drawing/ColourBox.cs b/Source/Pablo/Drawing/ColourBox.cs new file mode 100644 index 0000000..cad5150 --- /dev/null +++ b/Source/Pablo/Drawing/ColourBox.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Eto.Drawing; +using Eto.Forms; + +namespace Pablo.Drawing +{ + public abstract class ColourBox : Drawable + { + public abstract Color Color { get; set; } + + protected override void OnPaint(PaintEventArgs pe) + { + base.OnPaint(pe); + var rect = new Rectangle(Size); + pe.Graphics.FillRectangle(Color, rect); + pe.Graphics.DrawButtonOutline(rect); + } + } +} \ No newline at end of file diff --git a/Source/Pablo/Formats/Character/Controls/ColourEditor.cs b/Source/Pablo/Formats/Character/Controls/ColourEditor.cs index 4e0a1dc..3b22dd8 100644 --- a/Source/Pablo/Formats/Character/Controls/ColourEditor.cs +++ b/Source/Pablo/Formats/Character/Controls/ColourEditor.cs @@ -2,6 +2,7 @@ using Eto.Forms; using Eto.Drawing; using Pablo.Controls; +using Pablo.Drawing; namespace Pablo.Formats.Character.Controls { @@ -16,7 +17,7 @@ public class ColourEditor : Dialog int SelectedIndex { get; set; } - class SelectColourBox : ColourPad.ColourBox + class SelectColourBox : ColourBox { public int Index { get; set; } diff --git a/Source/Pablo/Formats/Character/Controls/ColourPad.cs b/Source/Pablo/Formats/Character/Controls/ColourPad.cs index 779c347..d1ad61a 100644 --- a/Source/Pablo/Formats/Character/Controls/ColourPad.cs +++ b/Source/Pablo/Formats/Character/Controls/ColourPad.cs @@ -26,19 +26,6 @@ public Palette Palette { #region ColourBox - public abstract class ColourBox : Drawable - { - public abstract Color Color { get; set; } - - protected override void OnPaint(PaintEventArgs pe) - { - base.OnPaint(pe); - var rect = new Rectangle(Size); - pe.Graphics.FillRectangle(Color, rect); - pe.Graphics.DrawButtonOutline(rect); - } - } - class FBColourBox : ColourBox { public ColourPad Pad { get; set; } diff --git a/Source/Pablo/Formats/Character/Icons/ApplyColour.ans b/Source/Pablo/Formats/Character/Icons/ApplyColour.ans new file mode 100644 index 0000000000000000000000000000000000000000..5f0e7de65b9a15361c7f9ddd17299d73c1f3382f GIT binary patch literal 1531 zcmcgsyH3ME5OfNJgoK1dhnsxDJ>#IO0z!y_3PIyvX8>wYvTnB<4=9>4gR`q3sk)HU7S^rMeRu*t=Uq~NA`o)L5m8ir%kpiMq79BtYJ zd6bhkjBW>Jx3I5;rTBJ`Z0U$LC?#zT(EuBfRS5h2z8`~2L?Orpv*uJp%&{p11*Hs; z$4U*Lmf9pQ7)z;=wm^)A3TP1%A;OTn@IYS+%DO7r%!_by7MPZ(?25@7ZbzIq_j>S` zdqUfPRim(M0+A$aqWW0pQeFhQP(zMHy|h$9qPlgF3f*vKDfptDoFAUIV=fZOcGZUm zsCxXTW>Iif4>eh2B-+0Nop53Upr>vmCzP;+!l@z%QjxQaC{wF$Qc=oyR?%4PFI18a zpdbzFpv?!E25%CwU-|LR%m00fgc5Oo#4RH*0$iBzhza&OSsYo|>btEMD&LIZUaC6P!@tz&NztF_nITjKUq zRa`i5r#}M3okP$3g&u%^z=eC5O_P)ZVWs_;-S^(i&d$EC*Iq0wt}F_IuvFbO8!#_J ze|Rqii`PN5tvWJjM9`*$GY-ySlv5-nyOGc5*O7`9 zEMrwx)QpnXvZ{tLnlur-MQ%@Pn3ahyuyk?2Sg6VJa5$8PS&2q{St%3>TtihefXKur z0ke}#5U))YOcFbh7c!3qh%4G%ddzeYBE7zXAI@Zhc#BGu zjiaAZ@`j@i183K;;;=R*q-R8BpB2e?7C<8SeUhw$i`u2)14rN0g$8|)M($Q9s7CE(y4~srat^LxT6}<$(r^x=_`lB@m{CnSIj0fx5GNk9FkD5 zrx_-rEfnCVJ&X?NDy`cntP*uoQJfukp9IzQR?EAO?dS80QtR_wMj4|XjlI9>y2awA TyYBe9eS3Oef4y$wxAOlR%%b%G literal 0 HcmV?d00001 diff --git a/Source/Pablo/Formats/Character/Icons/ColourBrush.png b/Source/Pablo/Formats/Character/Icons/ColourBrush.png deleted file mode 100644 index 11a15045c7d19a9da0445e10ec8158238b067625..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1073 zcmaJ=L1@!Z7!HoXm=49m&{Cc`*KO8w(qQhB|E|U_TCso};Owz=22;^*i0Tq#MuH5*D#u=uI zwX`xRtJ9K!ZB7p{TwuGD%`oGWfvX#fh=4h?U^z0o|Ly||EK_D@M^&i0DO9nts~#$? z<~3t=(MXu=v%Iu-3vRVKs>>)79!H5B4 z5X1yd5J%$i_$3g90_0(o7org%E{RbILeOk1&E}c&Qc=k?bJ0j z1Ks5X4u(f+0af+?P}^>!eNse6e*Y=#Yb!3|i^#{zo@Tw~19G~cpfpUt>QU%VkOevFzjlrqpSZpMk5rnibCZ?y- zF#!rms3>AwXmJ&6EZfK-Ev|XQO?2djrC_@>vw}S9CNeV~wn5{_lGWKutfO9&Yj*Y$ z@5tq;89sd2zaF}^M5`y9w#$|V?ZQV6t#*%=_4k473;Ii3C`@bV?d|QMp&?aOYqi?u z<|f0`nR;Cm#l}dxu+{7JCo_{@=&X+v^CcR#8zb+r_vpseoRZXnuXjHQr)#iBnK_n$ z&wf3heGIqy-+sHJeZI9Zk<6Y4uM_LS?#rK#_Rg7I-M#($Tg>jp&hg*7C-%E%FCMHd p+1=N6nEUJbrNEwKBW5+u$XA zNneuHfCXS)HW_{KW3pPJEZs8Gi4fM>_I1r_jS_QUxKs+e#YW2#c^ZO259_@;z>NTb z6Un|iL_R#yZiqnGis?x#O2^L&qV@Rg@wNrOccV4(G=$TXz29=-Cr^9`EP{|1r6sdJ zWqBA8{G@_#Ofd=#2rx?N4GZ&4@eC)*2oZdz%251tHK7u4l|+3Zd?67X<3k>)NM4)5 zjYgP&;N~?H4dMVBkH}LMd(}t8rjy07I&HQ9L}I9+Kq*+M{4z?CG@T{mgvWfpK8W+K Idi=Tl4$?$xPyhe` literal 0 HcmV?d00001 diff --git a/Source/Pablo/Formats/Character/Icons/DrawBackground.png b/Source/Pablo/Formats/Character/Icons/DrawBackground.png deleted file mode 100644 index 0c74a079fa3474acc913e46b846615e5941b0a95..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1004 zcmaJ=y>HV%6u%NwRfPgV>HrHTmw|!UcTSTuRzpc+hX&PAF>-y*24H$7@=a@%Ft|ik94{~YeDy|vj-3}SrFEqHMbdQUHUm=ItkkW| zRV!x;Gw0xRq;LV3FcU`ZnincjUg+p5+>ehX0d^p4H81QH)zGW3NCN`XB1&2)gJ1@W zI5nBgX3s(yVI(10!g3O4m6WU?1iO#Gvjz6DVyLBVE*|BDCS$%LNv&2(Y^6jRtVlSQ z%f%Y9oaBgPxZyD~N_yc$PeCQ26*xX~s0U+3bBV6Ayud5nYr*yVvR>F76CaoqnZATY z6t~m^>iYkouG>e4%pm*q{!=)tZ}>zqNJ!TMi(lOGM4ZZ3iUBbh4eFGx^`=;DQbxlj z^0mSR4Sx1lX3}T4Ns-CSuKMRE+AD+ zWpR(IQfu8M9_w-KeQstTH(mwT=b2R!I9G^W3aAS^Ei2C8T2ce`x?Fp3Et3Pe5-&!I zFZQpC?j7;%iQWF%@}R%?#N*o@@U?z$bL%$$C5Ef>b&cD0yZ!j{{cqemz>G?*4R*HC zMIN0mtA%>><;K>>Q2<90+wJ!5@$l*R4{hr8wZ%gt?}w`3cjD!dQxBWpuU0>eKl}Rp lk&)QBbI@LR`{cvnp<%Fa58OTdE2D5NP}VByi`m8Ne*gesIdK30 diff --git a/Source/Pablo/Formats/Character/Icons/DrawForeground.ans b/Source/Pablo/Formats/Character/Icons/DrawForeground.ans new file mode 100644 index 0000000000000000000000000000000000000000..168edeb2623ffc714a8ef75ea048d1e2997e3203 GIT binary patch literal 1090 zcmb_b%?^Sv42F0yBqS!@++~k21_a1XNR08|$>?Rzz>OF5Ib6c4*i|jVgkjV&$Qs(O zU;mgEDibO#S_U_KI;Inq6!dm+#JRCzFE^%hm8evpLs=+1=#!TUPuE*4vKc_hy6^iq z0wYgQjFhOXc!hEqS%w3cAIKPBZylzgh&b92umROa5lZn)(qRKd@_W6Pkb;kr0_?dG z{wvH}6P$KWb8Rv0i2?dNWiJ=bVX%CCbUHWRy5G}cx@ur6#vAcvi7b{gPK3foQvrKp pb@~fiv^mx1W+w#ypGYC4sAPIw1VI?Cf@OfRK5UQtvacT+eebxw2vh(7 literal 0 HcmV?d00001 diff --git a/Source/Pablo/Formats/Character/Icons/DrawForeground.png b/Source/Pablo/Formats/Character/Icons/DrawForeground.png deleted file mode 100644 index 040cf45f66f79d366a21afadb04a25adff76ed04..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 998 zcmaJ=zi-n(6h2xBp*9s|L4xVzE(j6(&Tf+CRJTpzga*}7ltgMK6vw_aR%@TJuZ`QO zLJS~vWM={~K{o~l7LediC=w$J3nO9*=QK$f2$t;k-s$_k_v4 zo@^x;Iraj<24HnP4lH|*a@e7}uCGf!-+z#x>*&%>#zbaNq&;`*IHZl^YSTX6v-6I$ zz6MugA_P3jEf{n8h;ImUFq> zJ*Xm#6r?IxP2(KVRDuv3J(9>4I$csX%A;H&(xo2f0a28Gzc2SSnT5Lw&gb)qhN`9o zA{`z1+=|nFv@}*QXk>?Oz+L9UMA7Q71FlP=(u)?nU?S^BqcMqrDX|qOSVl=pW1wmN zAL@A%bj0iQvfh6RN6n*vDs>vMgU}Wi*Ii0d1*8~Ki?guF*#3BmwI1Uv>ahS88yRR? zw(BSH5O12K;z!)_ZCWvONhrv!>yUCeyMi_g%h_eMjByFCXr;|k79(6hhN0!~m}@Zm zz@t7NbDc|WW-2#X1uqbp4H~+K)G3F|gTt1IJG~Zls@{m}Os_?o%2h-$N^-G(UG(@! zY)|4&)>Z_Q#izd5_E4<#tHZM&;+MEu+isSG9SjC9&tH5K-VCo-8w2qD9eN-lQZWk6 z_-m(a%%)CLizhpvIG@$d<~DjyZoWSMJkvhi0p|SDHu!X7YbKTI-EFURHh!&boLm79 WTj1@--_M^46;LTvjW?U^$A19IPBDW3 diff --git a/Source/Pablo/Formats/Character/Icons/Erase.ans b/Source/Pablo/Formats/Character/Icons/Erase.ans new file mode 100644 index 0000000000000000000000000000000000000000..de69018bd8b0b4d9ac24c3c3b07bd1e3cfdfaf86 GIT binary patch literal 1592 zcmb_c%}#_c5M~c1#>B+Lo4xP|ZK1N8p4N>q9y}TM(r56-yZJDX@G4Gc+A=MWT@!(_ z%P>s8pJ|1Yww1Q&z6JclvlmWT)uqwj-wD^9gli-uDXSa0`cb%+zEg*18%93~XRw$y z#)jd8Fp2-3Pcl~;{Tv7)P3s{56!Vvf0}T!y$uM{W91ue!95ym55EG3^x2y#8jcvO~ zi_^to@w-dhH>lTjy(&40+wCo0r0k4hK`EjDv{$Gzp*k{}>3_Y=5Mcc<0He0_GD}zj zAGTO7Q@yUJe9loZt@&hVi`-j9qxbfLFN7}y{Y&CuqFww=ZWsE+6lKh_MDjna9V0DX zw0u~{g?iL+MKNv{AKxN6!m{rlA$8kmMmFGp2Qb<(hEE;d|P zY~)IMV@*#O^!yx{^(7);L97AaTDLvPm+6kKMC{<0r9lUR*JS!Isj`{}Y2-o>Ww?;e zi5w7lh8H5SSnNCqb3Dg#VU`bv_?RSwC5{8#MU!Z*QIQJDLN^xiWV(v6Be86~UT5k8 zgWOe?Pb3n7MmQWIh>*8sW6clQ-gHkvfu8P~4mObu0!3{F)v!#HOb<)2oW88>b+3tB z80%{e%QIY1QV*!A|A$&uAMN1+Jj(Z0%V9nr_;G-@&V@l(jvq**eTBGEEd1(=?<=JT9g(Vp5ER1)k6FaUnxo zp5v38q6jg*$5oJCv!IQ8T;qtF8psVs!E#7s1-j-YG!|TBflkSiIXIX2K)o*47@SLD zAeSY{ut8)0YIN_2Oiy6;$Cfz#!G|`Pc9)Fx{`k)v`6Z_EOQlS+*;G}v)oQidZ9x!r zcXun53i(LfjdS0x6Kez)az)~H7FE3DPmsgqtdcDGd-zjwVjB!!xXiWc?a8x1{PO-| zTYPx`<=w_xpZc}9v!6)1^?a%}H8QjFV7vM4hkPu0CbIYF06d<&T6+3!_{!_ApPwB( fxjA=m;vO|bm9HJ&yz_j!MM6;7Oip=`x^e3dqrX?% diff --git a/Source/Pablo/Formats/Character/Icons/Selection.ans b/Source/Pablo/Formats/Character/Icons/Selection.ans new file mode 100644 index 0000000000000000000000000000000000000000..6802b218caa1391eb76bf6f71015ca736f7f751d GIT binary patch literal 752 zcmb1+Hn27^ur@Z&l?JlFutYlA(Av-(j!SsC6oBCV{W~BDV*{W{pq!Br442#iN`ORh z>A!Oyq{GA3_yG;0V4w=BLhn#<9sFt21Z5!1`Y-=5cYKP MRS0u;gz(@b0IcG%=>Px# literal 0 HcmV?d00001 diff --git a/Source/Pablo/Formats/Character/Tools/BrushTool.cs b/Source/Pablo/Formats/Character/Tools/BrushTool.cs index 773105d..3a19c2a 100644 --- a/Source/Pablo/Formats/Character/Tools/BrushTool.cs +++ b/Source/Pablo/Formats/Character/Tools/BrushTool.cs @@ -87,9 +87,9 @@ protected override void Draw(Point location, MouseEventArgs e) Control InvertButton() { - var control = new ImageButton + var control = new AnsiButton { - Image = ImageCache.BitmapFromResource("Pablo.Formats.Character.Icons.Erase.png"), + Document = ImageCache.CharacterFromResource("Pablo.Formats.Character.Icons.Erase.ans", false), Toggle = true, Pressed = Inverted, ToolTip = "Erase mode (shift)" @@ -104,9 +104,9 @@ Control InvertButton() Control ColourButton() { - var control = new ImageButton + var control = new AnsiButton { - Image = ImageCache.BitmapFromResource("Pablo.Formats.Character.Icons.ApplyColour.png"), + Document = ImageCache.CharacterFromResource("Pablo.Formats.Character.Icons.ApplyColour.ans", false), Toggle = true, Pressed = ApplyColour, ToolTip = "Draw with color (alt)" diff --git a/Source/Pablo/Formats/Character/Tools/ColourBrush.cs b/Source/Pablo/Formats/Character/Tools/ColourBrush.cs index 70d808a..53eb0a1 100644 --- a/Source/Pablo/Formats/Character/Tools/ColourBrush.cs +++ b/Source/Pablo/Formats/Character/Tools/ColourBrush.cs @@ -26,28 +26,13 @@ public override CharacterHandler Handler } } - public override Cursor MouseCursor - { - get { return new Cursor(CursorType.Crosshair); } - } + public override Cursor MouseCursor => new Cursor(CursorType.Crosshair); - public override Eto.Drawing.Image Image - { - get { return ImageCache.BitmapFromResource("Pablo.Formats.Character.Icons.ColourBrush.png"); } - } + public override CharacterDocument DocumentImage => ImageCache.CharacterFromResource("Pablo.Formats.Character.Icons.ColourBrush.ans", false); - public override string Description - { - get { return "Color Brush - paint only foreground and/or background colour"; } - } + public override string Description => "Color Brush - paint only foreground and/or background colour"; - public override Keys Accelerator - { - get - { - return Keys.B | Keys.Shift | (Handler.Generator.IsMac ? Keys.Control : Keys.Alt); - } - } + public override Keys Accelerator => Keys.B | Keys.Shift | (Handler.Generator.IsMac ? Keys.Control : Keys.Alt); public ColourBrush() @@ -86,14 +71,12 @@ protected override void Draw(Point location, Eto.Forms.MouseEventArgs e) Control FGButton() { - var control = new ImageButton + var control = new AnsiButton { - Image = ImageCache.BitmapFromResource("Pablo.Formats.Character.Icons.DrawForeground.png"), + Document = ImageCache.CharacterFromResource("Pablo.Formats.Character.Icons.DrawForeground.ans"), Toggle = true, Pressed = PaintForeground, -#if DESKTOP ToolTip = "Paint foreground (shift)" -#endif }; control.Click += delegate @@ -105,14 +88,12 @@ Control FGButton() Control BGButton() { - var control = new ImageButton + var control = new AnsiButton { - Image = ImageCache.BitmapFromResource("Pablo.Formats.Character.Icons.DrawBackground.png"), + Document = ImageCache.CharacterFromResource("Pablo.Formats.Character.Icons.DrawBackground.ans"), Toggle = true, Pressed = PaintBackground, -#if DESKTOP ToolTip = "Paint background (alt)" -#endif }; control.Click += delegate diff --git a/Source/Pablo/Formats/Character/Tools/EllipseTool.cs b/Source/Pablo/Formats/Character/Tools/EllipseTool.cs index f30f58e..128ed4a 100644 --- a/Source/Pablo/Formats/Character/Tools/EllipseTool.cs +++ b/Source/Pablo/Formats/Character/Tools/EllipseTool.cs @@ -147,14 +147,12 @@ protected override void UpdateWithLocation(Rectangle rect, Keys modifiers, Point Control ApplyColourButton() { - var control = new ImageButton + var control = new AnsiButton { - Image = ImageCache.BitmapFromResource("Pablo.Formats.Character.Icons.ApplyColour.png"), + Document = ImageCache.CharacterFromResource("Pablo.Formats.Character.Icons.ApplyColour.ans", false), Toggle = true, Pressed = ApplyColour, -#if DESKTOP ToolTip = "Draw with color" -#endif }; control.Click += delegate diff --git a/Source/Pablo/Formats/Character/Tools/LineTool.cs b/Source/Pablo/Formats/Character/Tools/LineTool.cs index 5aa200f..1d8227b 100644 --- a/Source/Pablo/Formats/Character/Tools/LineTool.cs +++ b/Source/Pablo/Formats/Character/Tools/LineTool.cs @@ -155,14 +155,12 @@ protected override void UpdateWithLocation(Rectangle rect, Keys modifiers, Point Control ApplyColourButton() { - var control = new ImageButton + var control = new AnsiButton { - Image = ImageCache.BitmapFromResource("Pablo.Formats.Character.Icons.ApplyColour.png"), + Document = ImageCache.CharacterFromResource("Pablo.Formats.Character.Icons.ApplyColour.ans", false), Toggle = true, Pressed = ApplyColour, -#if DESKTOP ToolTip = "Draw with color" -#endif }; control.Click += delegate diff --git a/Source/Pablo/Formats/Character/Tools/PencilTool.cs b/Source/Pablo/Formats/Character/Tools/PencilTool.cs index 76c0003..2041fa5 100644 --- a/Source/Pablo/Formats/Character/Tools/PencilTool.cs +++ b/Source/Pablo/Formats/Character/Tools/PencilTool.cs @@ -98,14 +98,12 @@ protected override void Draw(Point location, Eto.Forms.MouseEventArgs e) Control InvertButton() { - var control = new ImageButton + var control = new AnsiButton { - Image = ImageCache.BitmapFromResource("Pablo.Formats.Character.Icons.Erase.png"), + Document = ImageCache.CharacterFromResource("Pablo.Formats.Character.Icons.Erase.ans", false), Toggle = true, Pressed = Inverted, -#if DESKTOP ToolTip = "Erase mode (shift)" -#endif }; control.Click += delegate @@ -117,14 +115,12 @@ Control InvertButton() Control ColourButton() { - var control = new ImageButton + var control = new AnsiButton { - Image = ImageCache.BitmapFromResource("Pablo.Formats.Character.Icons.ApplyColour.png"), + Document = ImageCache.CharacterFromResource("Pablo.Formats.Character.Icons.ApplyColour.ans", false), Toggle = true, Pressed = ApplyColour, -#if DESKTOP ToolTip = "Draw with color (alt)" -#endif }; control.Click += delegate diff --git a/Source/Pablo/Formats/Character/Tools/RectangleTool.cs b/Source/Pablo/Formats/Character/Tools/RectangleTool.cs index f5c578f..e80a6ee 100644 --- a/Source/Pablo/Formats/Character/Tools/RectangleTool.cs +++ b/Source/Pablo/Formats/Character/Tools/RectangleTool.cs @@ -140,9 +140,9 @@ public override void Cancel() Control ApplyColourButton() { - var control = new ImageButton + var control = new AnsiButton { - Image = ImageCache.BitmapFromResource("Pablo.Formats.Character.Icons.ApplyColour.png"), + Document = ImageCache.CharacterFromResource("Pablo.Formats.Character.Icons.ApplyColour.ans", false), Toggle = true, Pressed = ApplyColour, ToolTip = "Draw with color" diff --git a/Source/Pablo/Formats/Character/Tools/Selection.cs b/Source/Pablo/Formats/Character/Tools/Selection.cs index 70b0a71..7b835a2 100644 --- a/Source/Pablo/Formats/Character/Tools/Selection.cs +++ b/Source/Pablo/Formats/Character/Tools/Selection.cs @@ -21,33 +21,15 @@ public class Selection : CenterAspectTool Rectangle? selectedRegion; Canvas pasteCanvas; - public override Eto.Drawing.Image Image - { - get { return ImageCache.BitmapFromResource("Pablo.Formats.Rip.Icons.Copy.png"); } - } + public override CharacterDocument DocumentImage => ImageCache.CharacterFromResource("Pablo.Formats.Character.Icons.Selection.ans"); - public override string Description - { - get { return "Selection - Select text and position the cursor with the mouse"; } - } + public override string Description => "Selection - Select text and position the cursor with the mouse"; - public override Keys Accelerator - { - get - { - return Keys.E | (Handler.Generator.IsMac ? Keys.Control : Keys.Alt); - } - } + public override Keys Accelerator => Keys.E | (Handler.Generator.IsMac ? Keys.Control : Keys.Alt); - public override Cursor MouseCursor - { - get { return new Cursor(CursorType.IBeam); } - } + public override Cursor MouseCursor => new Cursor(CursorType.IBeam); - public override bool AllowKeyboard - { - get { return drawMode == DrawMode.Normal; } - } + public override bool AllowKeyboard => drawMode == DrawMode.Normal; public override void Unselected() { diff --git a/Source/Pablo/Formats/Rip/Controls/ColourPad.cs b/Source/Pablo/Formats/Rip/Controls/ColourPad.cs index 39c88d5..b749d8a 100644 --- a/Source/Pablo/Formats/Rip/Controls/ColourPad.cs +++ b/Source/Pablo/Formats/Rip/Controls/ColourPad.cs @@ -4,6 +4,7 @@ using Eto; using System.Collections.Generic; using Pablo.Controls; +using Pablo.Drawing; namespace Pablo.Formats.Rip.Controls { @@ -23,20 +24,6 @@ public Palette Palette { #region ColourBox - public abstract class ColourBox : Drawable - { - public abstract Color Color { get; set; } - - protected override void OnPaint (PaintEventArgs pe) - { - base.OnPaint (pe); - var rect = new Rectangle (Point.Empty, this.Size); - pe.Graphics.DrawInsetRectangle (Colors.Gray, Colors.White, rect); - rect.Inflate (-1, -1); - pe.Graphics.FillRectangle (Color, rect); - } - } - class FBColourBox : ColourBox { public ColourPad Pad { get; set; }