diff --git a/.gitattributes b/.gitattributes index 79e7995071..4335da55dd 100644 --- a/.gitattributes +++ b/.gitattributes @@ -2197,6 +2197,7 @@ images/components/ttogglebox.xpm -text svneol=native#image/x-xpixmap images/components/ttoolbar.xpm -text svneol=native#image/x-xpixmap images/components/ttoolbutton.xpm -text svneol=native#image/x-xpixmap images/components/ttrackbar.xpm -text svneol=native#image/x-xpixmap +images/components/ttrayicon.xpm -text images/components/ttreeview.xpm -text svneol=native#image/x-xpixmap images/components/tupdown.xpm -text svneol=native#image/x-xpixmap images/components/txmlconfig.xpm svneol=native#text/plain @@ -2559,6 +2560,7 @@ lcl/include/custompage.inc svneol=native#text/pascal lcl/include/custompanel.inc svneol=native#text/pascal lcl/include/customsplitter.inc svneol=native#text/pascal lcl/include/customstatictext.inc svneol=native#text/pascal +lcl/include/customtrayicon.inc -text lcl/include/customupdown.inc svneol=native#text/pascal lcl/include/dbcalendar.inc svneol=native#text/pascal lcl/include/dbcheckbox.inc svneol=native#text/pascal diff --git a/images/components/ttrayicon.xpm b/images/components/ttrayicon.xpm new file mode 100644 index 0000000000..0f1c6bd1ad --- /dev/null +++ b/images/components/ttrayicon.xpm @@ -0,0 +1,31 @@ +/* XPM */ +static char *trayicon[]={ +"23 23 5 1", +". c None", +"c c #000000", +"a c #808080", +"b c #ffff00", +"# c #ffffff", +".......................", +".......................", +".......................", +".......................", +".......................", +".......................", +".......................", +".......................", +".......................", +".......................", +".......................", +".......................", +".......................", +".......................", +"#######################", +".......................", +"...........aaaaaaaaaa..", +"...........a..bb....#..", +"...........a.bbb.c.c#..", +"...........a.bbb.c.c#..", +"...........a..bb....#..", +"...........a#########..", +"......................."}; diff --git a/images/components_images.lrs b/images/components_images.lrs index d3ee827696..68a556dc04 100644 --- a/images/components_images.lrs +++ b/images/components_images.lrs @@ -197,6 +197,25 @@ LazarusResources.Add('tbitbtn','XPM',[ +'..............",'#10'".......................",'#10'"......................' +'.",'#10'"......................."}'#10 ]); +LazarusResources.Add('tbutton','XPM',[ + '/* XPM */'#10'static char *graphic[] = {'#10'"23 23 27 1",'#10'". c None",' + +#10'", c #FFFFFF",'#10'"- c #424242",'#10'"* c #D6D6CE",'#10'"a c #848484",' + +#10'"b c #D6CEC6",'#10'"c c #565752",'#10'"d c #4B4A47",'#10'"e c #000000",' + +#10'"f c #8F8C87",'#10'"g c #635F5B",'#10'"h c #77736F",'#10'"i c #736F6B",' + +#10'"j c #A7A59E",'#10'"k c #5A5A57",'#10'"l c #141413",'#10'"m c #C7BDB7",' + +#10'"n c #AFA7A5",'#10'"o c #524E4B",'#10'"p c #353533",'#10'"q c #A59D97",' + +#10'"r c #2B2B29",'#10'"s c #96948E",'#10'"t c #252523",'#10'"u c #8C8685",' + +#10'"v c #21211F",'#10'"w c #7B7773",'#10'".......................",'#10'"..' + +'.....................",'#10'".......................",'#10'"...............' + +'........",'#10'",,,,,,,,,,,,,,,,,,,,,,-",'#10'",********************a-",'#10 + +'",********************a-",'#10'",****bcddcb*e**fg****a-",'#10'",****gh**ig*' + +'e*jk*****a-",'#10'",****lm**ml*enob*****a-",'#10'",****e****e*epq******a-",' + +#10'",****lm**ml*emrs*****a-",'#10'",****gh**ig*e*mtu****a-",'#10'",****bcdd' + +'cb*e**mvw***a-",'#10'",********************a-",'#10'",********************a' + +'-",'#10'",aaaaaaaaaaaaaaaaaaaaa-",'#10'"-----------------------",'#10'"....' + +'...................",'#10'".......................",'#10'".................' + +'......",'#10'".......................",'#10'"......................."}'#10 +]); LazarusResources.Add('tbuttonpanel','XPM',[ '/* XPM */'#10'static char * tbuttonpanel_xpm[] = {'#10'"23 23 213 2",'#10'" ' +' '#9'c None",'#10'". '#9'c #98A5A8",'#10'"+ '#9'c #5F839F",'#10'"@ '#9'c #5' @@ -282,25 +301,6 @@ LazarusResources.Add('tbuttonpanel','XPM',[ +'/+(+_+_+_+:+<+[+}+|+_+_+_+_+_+_+_+_+_+_+_+",'#10'" ' +' "};'#10 ]); -LazarusResources.Add('tbutton','XPM',[ - '/* XPM */'#10'static char *graphic[] = {'#10'"23 23 27 1",'#10'". c None",' - +#10'", c #FFFFFF",'#10'"- c #424242",'#10'"* c #D6D6CE",'#10'"a c #848484",' - +#10'"b c #D6CEC6",'#10'"c c #565752",'#10'"d c #4B4A47",'#10'"e c #000000",' - +#10'"f c #8F8C87",'#10'"g c #635F5B",'#10'"h c #77736F",'#10'"i c #736F6B",' - +#10'"j c #A7A59E",'#10'"k c #5A5A57",'#10'"l c #141413",'#10'"m c #C7BDB7",' - +#10'"n c #AFA7A5",'#10'"o c #524E4B",'#10'"p c #353533",'#10'"q c #A59D97",' - +#10'"r c #2B2B29",'#10'"s c #96948E",'#10'"t c #252523",'#10'"u c #8C8685",' - +#10'"v c #21211F",'#10'"w c #7B7773",'#10'".......................",'#10'"..' - +'.....................",'#10'".......................",'#10'"...............' - +'........",'#10'",,,,,,,,,,,,,,,,,,,,,,-",'#10'",********************a-",'#10 - +'",********************a-",'#10'",****bcddcb*e**fg****a-",'#10'",****gh**ig*' - +'e*jk*****a-",'#10'",****lm**ml*enob*****a-",'#10'",****e****e*epq******a-",' - +#10'",****lm**ml*emrs*****a-",'#10'",****gh**ig*e*mtu****a-",'#10'",****bcdd' - +'cb*e**mvw***a-",'#10'",********************a-",'#10'",********************a' - +'-",'#10'",aaaaaaaaaaaaaaaaaaaaa-",'#10'"-----------------------",'#10'"....' - +'...................",'#10'".......................",'#10'".................' - +'......",'#10'".......................",'#10'"......................."}'#10 -]); LazarusResources.Add('tcalcedit','XPM',[ '/* XPM */'#10'static char *tcalcedit[] = {'#10'/* columns rows colors chars-' +'per-pixel */'#10'"24 24 17 1",'#10'" c black",'#10'". c #800000",'#10'"X c' @@ -349,6 +349,30 @@ LazarusResources.Add('tcalculatordialog','XPM',[ +'I566MO789@#;Ar",'#10'"AAAAAAAAAAAAAAAAAAAAAAr",'#10'".rrrrrrrrrrrrrrrrrrrrr' +'r",'#10'"......................."}'#10 ]); +LazarusResources.Add('tcalendar','XPM',[ + '/* XPM */'#10'static char *tcalendar[]={'#10'"20 19 53 1",'#10'"k c #000000"' + +','#10'"A c #000004",'#10'"a c #000005",'#10'"M c #000007",'#10'"X c #000009' + +'",'#10'"N c #00000b",'#10'"R c #00000c",'#10'"Y c #00000e",'#10'"P c #00000' + +'f",'#10'"T c #000014",'#10'"# c #000100",'#10'"Q c #00020f",'#10'"u c #0101' + +'01",'#10'"b c #020005",'#10'"z c #030207",'#10'"S c #040519",'#10'"L c #050' + +'40c",'#10'"s c #050503",'#10'"f c #060405",'#10'"U c #060513",'#10'"O c #07' + +'0614",'#10'"W c #070705",'#10'"V c #070904",'#10'". c #ab172f",'#10'"h c #e' + +'ef0ff",'#10'"E c #f2f1ff",'#10'"o c #f2f4ff",'#10'"B c #f3f3ff",'#10'"n c #' + +'f3f5ff",'#10'"m c #f3f6ff",'#10'"p c #f4f6ff",'#10'"v c #f5f7ff",'#10'"w c ' + +'#f5f9ff",'#10'"e c #f6f5fd",'#10'"t c #f6f8ff",'#10'"x c #f7f4ff",'#10'"C c' + +' #f7f6ff",'#10'"r c #f7f7ff",'#10'"y c #f8f1ff",'#10'"q c #f8f5ff",'#10'"D ' + +'c #f8f8ff",'#10'"l c #f8fcff",'#10'"i c #f9f7ff",'#10'"g c #f9f8ff",'#10'"K' + +' c #fbf9ff",'#10'"F c #fbfbff",'#10'"d c #fcf9ff",'#10'"G c #fcfeff",'#10'"' + +'j c #fcffff",'#10'"I c #fdfdff",'#10'"J c #fefeff",'#10'"H c #fefffa",'#10 + +'"c c #fffdff",'#10'"....................",'#10'"#..#..#..#..#..#...a",'#10 + +'"#..#..#..#..#..#...b",'#10'"####################",'#10'"#cd#ee#ce#ee#ee#ee' + +'ef",'#10'"#g.#h.#c.#i.#j.#e..k",'#10'"####################",'#10'"#lm#no#po' + +'#qr#ee#eees",'#10'"#t.#e.#e.#e.#e.#c..u",'#10'"####################",'#10'"' + +'#ee#vw#xy#ee#ee#eeez",'#10'"#e.#e.#e.#e.#e.#e..A",'#10'"###################' + +'#",'#10'"#BC#nD#Eg#iF#ce#eeek",'#10'"#G.#c.#c.#e.#c.#H..s",'#10'"##########' + +'##########",'#10'"#Ie#ee#ce#..#..#...A",'#10'"#J.#e.#K.#..#..#...L",'#10'"#' + +'MNOPQNRSTUM#V#WXYYX"};'#10 +]); LazarusResources.Add('tcalendardialog','XPM',[ '/* XPM */'#10'static char *graphic[] = {'#10'"23 23 100 2",'#10'".. c None",' +#10'"., c #9DFFFF",'#10'".- c #84E7FF",'#10'".* c #73DFFF",'#10'".a c #6FD6F' @@ -395,30 +419,6 @@ LazarusResources.Add('tcalendardialog','XPM',[ +'A.A.A.A.A.A.A.A.A.A.A.A.A.A.A.A.A.r",'#10'"...r.r.r.r.r.r.r.r.r.r.r.r.r.r.r' +'.r.r.r.r.r.r.r",'#10'".............................................."}'#10 ]); -LazarusResources.Add('tcalendar','XPM',[ - '/* XPM */'#10'static char *tcalendar[]={'#10'"20 19 53 1",'#10'"k c #000000"' - +','#10'"A c #000004",'#10'"a c #000005",'#10'"M c #000007",'#10'"X c #000009' - +'",'#10'"N c #00000b",'#10'"R c #00000c",'#10'"Y c #00000e",'#10'"P c #00000' - +'f",'#10'"T c #000014",'#10'"# c #000100",'#10'"Q c #00020f",'#10'"u c #0101' - +'01",'#10'"b c #020005",'#10'"z c #030207",'#10'"S c #040519",'#10'"L c #050' - +'40c",'#10'"s c #050503",'#10'"f c #060405",'#10'"U c #060513",'#10'"O c #07' - +'0614",'#10'"W c #070705",'#10'"V c #070904",'#10'". c #ab172f",'#10'"h c #e' - +'ef0ff",'#10'"E c #f2f1ff",'#10'"o c #f2f4ff",'#10'"B c #f3f3ff",'#10'"n c #' - +'f3f5ff",'#10'"m c #f3f6ff",'#10'"p c #f4f6ff",'#10'"v c #f5f7ff",'#10'"w c ' - +'#f5f9ff",'#10'"e c #f6f5fd",'#10'"t c #f6f8ff",'#10'"x c #f7f4ff",'#10'"C c' - +' #f7f6ff",'#10'"r c #f7f7ff",'#10'"y c #f8f1ff",'#10'"q c #f8f5ff",'#10'"D ' - +'c #f8f8ff",'#10'"l c #f8fcff",'#10'"i c #f9f7ff",'#10'"g c #f9f8ff",'#10'"K' - +' c #fbf9ff",'#10'"F c #fbfbff",'#10'"d c #fcf9ff",'#10'"G c #fcfeff",'#10'"' - +'j c #fcffff",'#10'"I c #fdfdff",'#10'"J c #fefeff",'#10'"H c #fefffa",'#10 - +'"c c #fffdff",'#10'"....................",'#10'"#..#..#..#..#..#...a",'#10 - +'"#..#..#..#..#..#...b",'#10'"####################",'#10'"#cd#ee#ce#ee#ee#ee' - +'ef",'#10'"#g.#h.#c.#i.#j.#e..k",'#10'"####################",'#10'"#lm#no#po' - +'#qr#ee#eees",'#10'"#t.#e.#e.#e.#e.#c..u",'#10'"####################",'#10'"' - +'#ee#vw#xy#ee#ee#eeez",'#10'"#e.#e.#e.#e.#e.#e..A",'#10'"###################' - +'#",'#10'"#BC#nD#Eg#iF#ce#eeek",'#10'"#G.#c.#c.#e.#c.#H..s",'#10'"##########' - +'##########",'#10'"#Ie#ee#ce#..#..#...A",'#10'"#J.#e.#K.#..#..#...L",'#10'"#' - +'MNOPQNRSTUM#V#WXYYX"};'#10 -]); LazarusResources.Add('tcheckbox','XPM',[ '/* XPM */'#10'static char *graphic[] = {'#10'"23 23 6 1",'#10'". c None",'#10 +'", c #848484",'#10'"- c #FFFFFF",'#10'"* c #424242",'#10'"a c #D6D6CE",'#10 @@ -1462,59 +1462,6 @@ LazarusResources.Add('tdrawgrid','XPM',[ +'.$$$$. .+@+@. ",'#10'" .$$$$. ...... ",'#10'" .... ' +' "};'#10 ]); -LazarusResources.Add('teditbutton','XPM',[ - '/* XPM */'#10'static char *teditbutton[]={'#10'"23 16 143 2",'#10'".p c #000' - +'000",'#10'"#o c #000103",'#10'"#i c #000105",'#10'"#y c #000201",'#10'".Z c' - +' #010103",'#10'".M c #020003",'#10'".q c #030303",'#10'".t c #040404",'#10 - +'"#C c #050503",'#10'".r c #050505",'#10'".s c #0a0a0a",'#10'".o c #0b0b0b",' - +#10'".n c #727272",'#10'".# c #747474",'#10'".d c #777777",'#10'".m c #78787' - +'8",'#10'".h c #7a7a7a",'#10'".j c #7b7b7b",'#10'".b c #7c7c7c",'#10'".c c #' - +'7d7d7d",'#10'".e c #7e7e7e",'#10'"#W c #7f7f7f",'#10'".x c #808080",'#10'".' - +'a c #818181",'#10'".i c #858585",'#10'".l c #868686",'#10'".f c #878787",' - +#10'".g c #888888",'#10'"#X c #898989",'#10'".k c #8a8a8a",'#10'"#L c #8d8d8' - +'d",'#10'"Qt c #929292",'#10'".T c #aa4747",'#10'"aa c #b5b5b5",'#10'"a. c #' - +'b7b7b5",'#10'"#8 c #b9b8b4",'#10'"#h c #b9b9b9",'#10'"#J c #bababa",'#10'"a' - +'b c #bbbbbb",'#10'"#6 c #bbbcb7",'#10'".J c #bcbcbc",'#10'"#7 c #bebebc",' - +#10'".y c #bebebe",'#10'"#4 c #bebfba",'#10'".K c #bfbfbf",'#10'"#n c #c0c0c' - +'0",'#10'".I c #c1c1c1",'#10'"#2 c #c2bfd0",'#10'"#1 c #c2c0cb",'#10'"#0 c #' - +'c2c1c6",'#10'"#Y c #c2c2c0",'#10'".L c #c2c2c2",'#10'"#9 c #c2c3be",'#10'"#' - +'Z c #c3c0c7",'#10'"#3 c #c3c1ce",'#10'"#B c #c4c4c4",'#10'".Y c #c5c5c5",' - +#10'".X c #c8c8c8",'#10'"#5 c #c9cbc0",'#10'"a# c #cacaca",'#10'".8 c #eeecf' - +'9",'#10'"#d c #f1efff",'#10'"#w c #f1f1ff",'#10'"#l c #f1f4ff",'#10'"## c #' - +'f2f2ff",'#10'"#r c #f3efff",'#10'"#s c #f3f6ff",'#10'"#k c #f4f3ff",'#10'"#' - +'a c #f4f6ff",'#10'"#q c #f4f8ff",'#10'"#e c #f5f1ff",'#10'"#t c #f5f2ff",' - +#10'"#m c #f5f3ff",'#10'"#b c #f5f5fd",'#10'"#f c #f5f7ff",'#10'"#I c #f5f8f' - +'f",'#10'".6 c #f6f8ff",'#10'".2 c #f6f9ff",'#10'"#x c #f7f1ff",'#10'"#A c #' - +'f7f6ff",'#10'"#j c #f7fbff",'#10'"#v c #f8f1ff",'#10'"#g c #f8f2ff",'#10'"a' - +'j c #f8f8f0",'#10'"#K c #f8f8f8",'#10'".S c #f8f8ff",'#10'"#. c #f8fbff",' - +#10'".v c #f9f9f9",'#10'"#T c #f9fafe",'#10'".4 c #f9faff",'#10'"#G c #f9fbf' - +'f",'#10'"#u c #f9feff",'#10'"al c #faf7fe",'#10'"ac c #fafafc",'#10'"#z c #' - +'fafaff",'#10'".W c #fafbf3",'#10'".5 c #fbf9ff",'#10'".1 c #fbfaff",'#10'".' - +'P c #fbfbfb",'#10'"#H c #fbfcff",'#10'"#F c #fbfdff",'#10'".3 c #fbfeff",' - +#10'"#p c #fbffff",'#10'"ah c #fcf8ff",'#10'"#c c #fcfbff",'#10'".w c #fcfcf' - +'c",'#10'"#E c #fcfcff",'#10'".U c #fcfdff",'#10'"#N c #fcfef9",'#10'"#Q c #' - +'fcfefb",'#10'"#P c #fcfefd",'#10'"#R c #fcfff2",'#10'"#S c #fcfff4",'#10'"#' - +'U c #fcfff6",'#10'".R c #fcffff",'#10'"ag c #fdf9ff",'#10'"ad c #fdfaff",' - +#10'"af c #fdfbfc",'#10'".E c #fdfbff",'#10'"ae c #fdfcfa",'#10'"#O c #fdfdf' - +'b",'#10'"am c #fdfdfd",'#10'".D c #fdfdff",'#10'"#M c #fdfef9",'#10'".C c #' - +'fdfeff",'#10'".B c #fdfffe",'#10'".O c #fefcfd",'#10'".F c #fefcff",'#10'"a' - +'i c #fefdf9",'#10'".9 c #fefdff",'#10'".A c #fefefe",'#10'".G c #fefeff",' - +#10'"#V c #fefff4",'#10'"#D c #fefffb",'#10'".V c #fefffd",'#10'".Q c #fefff' - +'f",'#10'".N c #fffaff",'#10'".0 c #fffbff",'#10'".z c #fffdff",'#10'"ak c #' - +'fffefc",'#10'".7 c #fffeff",'#10'".H c #fffffd",'#10'".u c #ffffff",'#10'"Q' - +'t.#.a.a.a.a.a.a.a.a.b.b.c.d.e.f.g.h.i.j.k.l.m",'#10'".n.o.p.p.p.p.p.p.p.p.q' - +'.r.p.s.p.p.p.q.p.t.p.p.u",'#10'".a.p.u.u.u.u.u.u.u.u.u.v.u.w.u.x.x.x.x.x.x.' - +'y.u",'#10'".a.p.z.z.A.A.A.B.C.D.E.F.G.v.H.x.I.J.I.K.x.L.u",'#10'".e.M.N.z.O' - +'.P.Q.R.R.S.T.T.U.V.W.x.X.y.I.K.x.Y.u",'#10'".e.Z.z.0.z.1.U.2.3.4.T.T.5.6.H.' - +'x.J.I.I.K.x.Y.u",'#10'".e.Z.7.8.9.T.T.T#.##.T.T.T.T#a.x.K.Y.I.K.x.Y.u",'#10 - +'".e.Z#b.U#c#d#e.T.T#f.T.T#g.T.u.x.K#h.I.K.x.Y.u",'#10'".e#i.R#j#k.T.T.T.T#l' - +'.T.T#m.T.u.x.J#n.I.K.x.Y.u",'#10'".e#o#p#q.T.T#r.T.T#s.T.T#t.T.u.x.K.y.I.K.' - +'x.Y.u",'#10'".e#o.3#u.T.T#v.T.T#w.T.T#x.T.u.x.J#n.I.K.x.Y.u",'#10'".e#y.R#j' - +'#z.T.T.T.T.S.T.T.T.T#A.x.X#B.I.K.x.Y.u",'#10'".##C#D.R.R.U#E#F#p#p#G#H#F#I.' - +'R.x.I#J.I.K.x.Y#K",'#10'"#L.p#M#N#O#P.U#Q#R#S.Q#T#D#U#V.x.b#W.g.c#X.J.u",' - +#10'".k.p#Y.L#Z#0#Y#Y#0#1#2#3#4#5#6#7#8#9a.a#aaab.u",'#10'".bacadadad.Eaeafa' - +'dagahadaiajak.7.zal.u.u.u.uam"};'#10 -]); LazarusResources.Add('tedit','XPM',[ '/* XPM */'#10'static char * tedit_xpm[] = {'#10'"23 16 157 2",'#10'" '#9'c ' +'None",'#10'". '#9'c #929292",'#10'"+ '#9'c #747474",'#10'"@ '#9'c #818181",' @@ -1578,6 +1525,59 @@ LazarusResources.Add('tedit','XPM',[ +'e.f.g.h.i.j.k.l.m.n.o.p._ ",'#10'"# q.r.r.r.5 s.t.r.u.v.r.w.x.y.0 | z._ _ _' +' _ [ "};'#10 ]); +LazarusResources.Add('teditbutton','XPM',[ + '/* XPM */'#10'static char *teditbutton[]={'#10'"23 16 143 2",'#10'".p c #000' + +'000",'#10'"#o c #000103",'#10'"#i c #000105",'#10'"#y c #000201",'#10'".Z c' + +' #010103",'#10'".M c #020003",'#10'".q c #030303",'#10'".t c #040404",'#10 + +'"#C c #050503",'#10'".r c #050505",'#10'".s c #0a0a0a",'#10'".o c #0b0b0b",' + +#10'".n c #727272",'#10'".# c #747474",'#10'".d c #777777",'#10'".m c #78787' + +'8",'#10'".h c #7a7a7a",'#10'".j c #7b7b7b",'#10'".b c #7c7c7c",'#10'".c c #' + +'7d7d7d",'#10'".e c #7e7e7e",'#10'"#W c #7f7f7f",'#10'".x c #808080",'#10'".' + +'a c #818181",'#10'".i c #858585",'#10'".l c #868686",'#10'".f c #878787",' + +#10'".g c #888888",'#10'"#X c #898989",'#10'".k c #8a8a8a",'#10'"#L c #8d8d8' + +'d",'#10'"Qt c #929292",'#10'".T c #aa4747",'#10'"aa c #b5b5b5",'#10'"a. c #' + +'b7b7b5",'#10'"#8 c #b9b8b4",'#10'"#h c #b9b9b9",'#10'"#J c #bababa",'#10'"a' + +'b c #bbbbbb",'#10'"#6 c #bbbcb7",'#10'".J c #bcbcbc",'#10'"#7 c #bebebc",' + +#10'".y c #bebebe",'#10'"#4 c #bebfba",'#10'".K c #bfbfbf",'#10'"#n c #c0c0c' + +'0",'#10'".I c #c1c1c1",'#10'"#2 c #c2bfd0",'#10'"#1 c #c2c0cb",'#10'"#0 c #' + +'c2c1c6",'#10'"#Y c #c2c2c0",'#10'".L c #c2c2c2",'#10'"#9 c #c2c3be",'#10'"#' + +'Z c #c3c0c7",'#10'"#3 c #c3c1ce",'#10'"#B c #c4c4c4",'#10'".Y c #c5c5c5",' + +#10'".X c #c8c8c8",'#10'"#5 c #c9cbc0",'#10'"a# c #cacaca",'#10'".8 c #eeecf' + +'9",'#10'"#d c #f1efff",'#10'"#w c #f1f1ff",'#10'"#l c #f1f4ff",'#10'"## c #' + +'f2f2ff",'#10'"#r c #f3efff",'#10'"#s c #f3f6ff",'#10'"#k c #f4f3ff",'#10'"#' + +'a c #f4f6ff",'#10'"#q c #f4f8ff",'#10'"#e c #f5f1ff",'#10'"#t c #f5f2ff",' + +#10'"#m c #f5f3ff",'#10'"#b c #f5f5fd",'#10'"#f c #f5f7ff",'#10'"#I c #f5f8f' + +'f",'#10'".6 c #f6f8ff",'#10'".2 c #f6f9ff",'#10'"#x c #f7f1ff",'#10'"#A c #' + +'f7f6ff",'#10'"#j c #f7fbff",'#10'"#v c #f8f1ff",'#10'"#g c #f8f2ff",'#10'"a' + +'j c #f8f8f0",'#10'"#K c #f8f8f8",'#10'".S c #f8f8ff",'#10'"#. c #f8fbff",' + +#10'".v c #f9f9f9",'#10'"#T c #f9fafe",'#10'".4 c #f9faff",'#10'"#G c #f9fbf' + +'f",'#10'"#u c #f9feff",'#10'"al c #faf7fe",'#10'"ac c #fafafc",'#10'"#z c #' + +'fafaff",'#10'".W c #fafbf3",'#10'".5 c #fbf9ff",'#10'".1 c #fbfaff",'#10'".' + +'P c #fbfbfb",'#10'"#H c #fbfcff",'#10'"#F c #fbfdff",'#10'".3 c #fbfeff",' + +#10'"#p c #fbffff",'#10'"ah c #fcf8ff",'#10'"#c c #fcfbff",'#10'".w c #fcfcf' + +'c",'#10'"#E c #fcfcff",'#10'".U c #fcfdff",'#10'"#N c #fcfef9",'#10'"#Q c #' + +'fcfefb",'#10'"#P c #fcfefd",'#10'"#R c #fcfff2",'#10'"#S c #fcfff4",'#10'"#' + +'U c #fcfff6",'#10'".R c #fcffff",'#10'"ag c #fdf9ff",'#10'"ad c #fdfaff",' + +#10'"af c #fdfbfc",'#10'".E c #fdfbff",'#10'"ae c #fdfcfa",'#10'"#O c #fdfdf' + +'b",'#10'"am c #fdfdfd",'#10'".D c #fdfdff",'#10'"#M c #fdfef9",'#10'".C c #' + +'fdfeff",'#10'".B c #fdfffe",'#10'".O c #fefcfd",'#10'".F c #fefcff",'#10'"a' + +'i c #fefdf9",'#10'".9 c #fefdff",'#10'".A c #fefefe",'#10'".G c #fefeff",' + +#10'"#V c #fefff4",'#10'"#D c #fefffb",'#10'".V c #fefffd",'#10'".Q c #fefff' + +'f",'#10'".N c #fffaff",'#10'".0 c #fffbff",'#10'".z c #fffdff",'#10'"ak c #' + +'fffefc",'#10'".7 c #fffeff",'#10'".H c #fffffd",'#10'".u c #ffffff",'#10'"Q' + +'t.#.a.a.a.a.a.a.a.a.b.b.c.d.e.f.g.h.i.j.k.l.m",'#10'".n.o.p.p.p.p.p.p.p.p.q' + +'.r.p.s.p.p.p.q.p.t.p.p.u",'#10'".a.p.u.u.u.u.u.u.u.u.u.v.u.w.u.x.x.x.x.x.x.' + +'y.u",'#10'".a.p.z.z.A.A.A.B.C.D.E.F.G.v.H.x.I.J.I.K.x.L.u",'#10'".e.M.N.z.O' + +'.P.Q.R.R.S.T.T.U.V.W.x.X.y.I.K.x.Y.u",'#10'".e.Z.z.0.z.1.U.2.3.4.T.T.5.6.H.' + +'x.J.I.I.K.x.Y.u",'#10'".e.Z.7.8.9.T.T.T#.##.T.T.T.T#a.x.K.Y.I.K.x.Y.u",'#10 + +'".e.Z#b.U#c#d#e.T.T#f.T.T#g.T.u.x.K#h.I.K.x.Y.u",'#10'".e#i.R#j#k.T.T.T.T#l' + +'.T.T#m.T.u.x.J#n.I.K.x.Y.u",'#10'".e#o#p#q.T.T#r.T.T#s.T.T#t.T.u.x.K.y.I.K.' + +'x.Y.u",'#10'".e#o.3#u.T.T#v.T.T#w.T.T#x.T.u.x.J#n.I.K.x.Y.u",'#10'".e#y.R#j' + +'#z.T.T.T.T.S.T.T.T.T#A.x.X#B.I.K.x.Y.u",'#10'".##C#D.R.R.U#E#F#p#p#G#H#F#I.' + +'R.x.I#J.I.K.x.Y#K",'#10'"#L.p#M#N#O#P.U#Q#R#S.Q#T#D#U#V.x.b#W.g.c#X.J.u",' + +#10'".k.p#Y.L#Z#0#Y#Y#0#1#2#3#4#5#6#7#8#9a.a#aaab.u",'#10'".bacadadad.Eaeafa' + +'dagahadaiajak.7.zal.u.u.u.uam"};'#10 +]); LazarusResources.Add('teventlog','XPM',[ '/* XPM */'#10'static char * tmemo_xpm[] = {'#10'"16 18 107 2",'#10'" '#9'c ' +'None",'#10'". '#9'c #848484",'#10'"+ '#9'c #7F7F81",'#10'"@ '#9'c #818088",' @@ -2060,6 +2060,18 @@ LazarusResources.Add('tidletimer','XPM',[ +','#10'" .+@@+@@@@@+@@+. ",'#10'" .+@@@@+@@@@+. ",'#10'" .++@@@@@++' +'. ",'#10'" ..+++++.. ",'#10'" ..... "};'#10 ]); +LazarusResources.Add('timage','XPM',[ + '/* XPM */'#10'static char *timage[]={'#10'"20 20 5 1",'#10'"c c #0058c0",'#10 + +'"b c #008000",'#10'". c #a8dcff",'#10'"# c #ffff00",'#10'"a c #ffffff",'#10 + +'"....................",'#10'"....................",'#10'".#....#...........' + +'..",'#10'"..#..#......a.a.aa..",'#10'"...##.......a..a..a.",'#10'"...##....' + +'....a.aa...",'#10'"..#..#............a.",'#10'".#....#.............",'#10'"' + +'....................",'#10'"....................",'#10'"...................' + +'.",'#10'"...................b",'#10'"..................bb",'#10'"cccccccccc' + +'cccccccbbb",'#10'"ccccccccccccccccbbbb",'#10'"cccccccccccccccbbbbb",'#10'"c' + +'cccccccccccccbbbbbb",'#10'"cccccccccccccbbbbbbb",'#10'"ccccccccccccbbbbbbbb' + +'",'#10'"cccccccccccbbbbbbbbb"};'#10 +]); LazarusResources.Add('timagelist','XPM',[ '/* XPM */'#10'static char *graphic[] = {'#10'"23 23 39 1",'#10'". c #C6C6C6"' +','#10'", c #B7B7B7",'#10'"- c #AFAFAF",'#10'"* c #A7A7A7",'#10'"a c #9F9F9F' @@ -2082,18 +2094,6 @@ LazarusResources.Add('timagelist','XPM',[ +'aeyy*errrrrrrrrrrBC",'#10'"ddddbfzA*esssssssssDEFG",'#10'"ddddcggg*ettttttt' +'ttttHI",'#10'"dddddddd*evvvvvvvvvvvvv",'#10'"ddddddddaeyyyyyyyyyyyyy"}'#10 ]); -LazarusResources.Add('timage','XPM',[ - '/* XPM */'#10'static char *timage[]={'#10'"20 20 5 1",'#10'"c c #0058c0",'#10 - +'"b c #008000",'#10'". c #a8dcff",'#10'"# c #ffff00",'#10'"a c #ffffff",'#10 - +'"....................",'#10'"....................",'#10'".#....#...........' - +'..",'#10'"..#..#......a.a.aa..",'#10'"...##.......a..a..a.",'#10'"...##....' - +'....a.aa...",'#10'"..#..#............a.",'#10'".#....#.............",'#10'"' - +'....................",'#10'"....................",'#10'"...................' - +'.",'#10'"...................b",'#10'"..................bb",'#10'"cccccccccc' - +'cccccccbbb",'#10'"ccccccccccccccccbbbb",'#10'"cccccccccccccccbbbbb",'#10'"c' - +'cccccccccccccbbbbbb",'#10'"cccccccccccccbbbbbbb",'#10'"ccccccccccccbbbbbbbb' - +'",'#10'"cccccccccccbbbbbbbbb"};'#10 -]); LazarusResources.Add('tinipropstorage','XPM',[ '/* XPM */'#10'static char *tinistorage[] = {'#10'/* columns rows colors char' +'s-per-pixel */'#10'"24 24 8 1",'#10'" c black",'#10'". c navy",'#10'"X c c' @@ -2110,6 +2110,20 @@ LazarusResources.Add('tinipropstorage','XPM',[ +' O",'#10'"O+@@o@@@o@@o@o@@@o@@@@ O",'#10'"O o o oo o O",'#10'"O' +'OOOoOOOoOOOooOOOoOOOOOO",'#10'"OOOoooOoooOOoooOoooOOOOO"'#10'};'#10 ]); +LazarusResources.Add('tlabel','XPM',[ + '/* XPM */'#10'static char * tlabel16_xpm[] = {'#10'"23 23 3 1",'#10'" '#9'c ' + +'None",'#10'".'#9'c #848484",'#10'"+'#9'c #000000",'#10'" ' + +' ",'#10'" ",'#10'" ",'#10'" ' + +' ",'#10'" ",'#10'" . ' + +' ",'#10'" .+. ",'#10'" +++ ",' + +#10'" .+++. ",'#10'" ++.++ ",'#10'" .+' + +'. ++. ",'#10'" ++ .++ ",'#10'" .+++++++. ' + +' ",'#10'" ++ .++ ",'#10'" .+ ++. ",'#10'" ' + +'++++ +++++ ",'#10'" ",'#10'" ' + +' ",'#10'" ",'#10'" ",'#10 + +'" ",'#10'" ",'#10'" ' + +' "};'#10 +]); LazarusResources.Add('tlabelededit','XPM',[ '/* XPM */'#10'static char * tlabelededit_xpm[] = {'#10'"23 23 143 2",'#10'" ' +' '#9'c None",'#10'". '#9'c #000000",'#10'"+ '#9'c #929292",'#10'"@ '#9'c #7' @@ -2174,20 +2188,6 @@ LazarusResources.Add('tlabelededit','XPM',[ +'.6.7.8.9.0.a.b._ ",'#10'"$ c.d.d.d.1 e.f.d.g.h.d.i.j.k.k : l._ _ _ _ 7 "};' +#10 ]); -LazarusResources.Add('tlabel','XPM',[ - '/* XPM */'#10'static char * tlabel16_xpm[] = {'#10'"23 23 3 1",'#10'" '#9'c ' - +'None",'#10'".'#9'c #848484",'#10'"+'#9'c #000000",'#10'" ' - +' ",'#10'" ",'#10'" ",'#10'" ' - +' ",'#10'" ",'#10'" . ' - +' ",'#10'" .+. ",'#10'" +++ ",' - +#10'" .+++. ",'#10'" ++.++ ",'#10'" .+' - +'. ++. ",'#10'" ++ .++ ",'#10'" .+++++++. ' - +' ",'#10'" ++ .++ ",'#10'" .+ ++. ",'#10'" ' - +'++++ +++++ ",'#10'" ",'#10'" ' - +' ",'#10'" ",'#10'" ",'#10 - +'" ",'#10'" ",'#10'" ' - +' "};'#10 -]); LazarusResources.Add('tlazcomponentqueue','XPM',[ '/* XPM */'#10'static char * tlazcomponentqueue_xpm[] = {'#10'"23 23 245 2",' +#10'" '#9'c None",'#10'". '#9'c #000000",'#10'"+ '#9'c #072A07",'#10'"@ '#9 @@ -2821,6 +2821,29 @@ LazarusResources.Add('tpicture','XPM',[ +'gggggggggggg..",'#10'".......................",'#10'"......................' +'.",'#10'"......................."}'#10 ]); +LazarusResources.Add('tpopup','XPM',[ + '/* XPM */'#10'static char *graphic[] = {'#10'"23 23 40 1",'#10'". c None",' + +#10'", c #EFEFEF",'#10'"- c #D6D6D6",'#10'"* c #C7C7C7",'#10'"a c #BDBDBD",' + +#10'"b c #5E5E5E",'#10'"c c #FFFFFF",'#10'"d c #424242",'#10'"e c #000000",' + +#10'"f c #3F3F3F",'#10'"g c #C6C6FF",'#10'"h c #070246",'#10'"i c #00002D",' + +#10'"j c #000031",'#10'"k c #F7F7F7",'#10'"l c #0C0C2F",'#10'"m c #00001E",' + +#10'"n c #000010",'#10'"o c #000009",'#10'"p c #02050A",'#10'"q c #000200",' + +#10'"r c #B7B7B7",'#10'"s c #070908",'#10'"t c #636363",'#10'"u c #000100",' + +#10'"v c #000002",'#10'"w c #000004",'#10'"x c #0B0B0B",'#10'"y c #030208",' + +#10'"z c #07060E",'#10'"A c #000005",'#10'"B c #08080A",'#10'"C c #040406",' + +#10'"D c #08050E",'#10'"E c #010000",'#10'"F c #020003",'#10'"G c #090803",' + +#10'"H c #040301",'#10'"I c #010100",'#10'"J c #020200",'#10'"..............' + +'.........",'#10'"...,-*****ab...........",'#10'"...-cccccccd...........",' + +#10'"...*ceececcf...........",'#10'"...*cccccccf...........",'#10'"...*cecee' + +'ecf...........",'#10'"...*gggggggf...........",'#10'"...*geeeeghf..........' + +'.",'#10'"...*ggggggij...........",'#10'"...*keececlcm..........",'#10'"...*' + +'ccccccncco.........",'#10'"...*ceceecpcccq........",'#10'"...rccccccsccccq.' + +'......",'#10'"...tdfffffucccccu......",'#10'"..........vccccccv.....",'#10 + +'"..........wccccxvwy....",'#10'"..........zccccv.......",'#10'"..........zc' + +'wvccw......",'#10'"..........oA.BccC......",'#10'"..........D...EccF.....",' + +#10'"..............GccH.....",'#10'"...............IJ......",'#10'".........' + +'.............."}'#10 +]); LazarusResources.Add('tpopupmenu','XPM',[ '/* XPM */'#10'static char * tpopupmenu_xpm[] = {'#10'"23 23 151 2",'#10'" ' +#9'c None",'#10'". '#9'c #777978",'#10'"+ '#9'c #888C8F",'#10'"@ '#9'c #7D80' @@ -2887,29 +2910,6 @@ LazarusResources.Add('tpopupmenu','XPM',[ +' s.t. ",'#10'" ' +' "};'#10 ]); -LazarusResources.Add('tpopup','XPM',[ - '/* XPM */'#10'static char *graphic[] = {'#10'"23 23 40 1",'#10'". c None",' - +#10'", c #EFEFEF",'#10'"- c #D6D6D6",'#10'"* c #C7C7C7",'#10'"a c #BDBDBD",' - +#10'"b c #5E5E5E",'#10'"c c #FFFFFF",'#10'"d c #424242",'#10'"e c #000000",' - +#10'"f c #3F3F3F",'#10'"g c #C6C6FF",'#10'"h c #070246",'#10'"i c #00002D",' - +#10'"j c #000031",'#10'"k c #F7F7F7",'#10'"l c #0C0C2F",'#10'"m c #00001E",' - +#10'"n c #000010",'#10'"o c #000009",'#10'"p c #02050A",'#10'"q c #000200",' - +#10'"r c #B7B7B7",'#10'"s c #070908",'#10'"t c #636363",'#10'"u c #000100",' - +#10'"v c #000002",'#10'"w c #000004",'#10'"x c #0B0B0B",'#10'"y c #030208",' - +#10'"z c #07060E",'#10'"A c #000005",'#10'"B c #08080A",'#10'"C c #040406",' - +#10'"D c #08050E",'#10'"E c #010000",'#10'"F c #020003",'#10'"G c #090803",' - +#10'"H c #040301",'#10'"I c #010100",'#10'"J c #020200",'#10'"..............' - +'.........",'#10'"...,-*****ab...........",'#10'"...-cccccccd...........",' - +#10'"...*ceececcf...........",'#10'"...*cccccccf...........",'#10'"...*cecee' - +'ecf...........",'#10'"...*gggggggf...........",'#10'"...*geeeeghf..........' - +'.",'#10'"...*ggggggij...........",'#10'"...*keececlcm..........",'#10'"...*' - +'ccccccncco.........",'#10'"...*ceceecpcccq........",'#10'"...rccccccsccccq.' - +'......",'#10'"...tdfffffucccccu......",'#10'"..........vccccccv.....",'#10 - +'"..........wccccxvwy....",'#10'"..........zccccv.......",'#10'"..........zc' - +'wvccw......",'#10'"..........oA.BccC......",'#10'"..........D...EccF.....",' - +#10'"..............GccH.....",'#10'"...............IJ......",'#10'".........' - +'.............."}'#10 -]); LazarusResources.Add('tprinterdialog','XPM',[ '/* XPM */'#10'static char * tprinterdialog_xpm[] = {'#10'"22 20 9 1",'#10'" ' +#9'c None",'#10'".'#9'c #848484",'#10'"+'#9'c #FFFFFF",'#10'"@'#9'c #000000"' @@ -3804,6 +3804,20 @@ LazarusResources.Add('ttrackbar','XPM',[ +'...........",'#10'".......................",'#10'".......................",' +#10'"......................."}'#10 ]); +LazarusResources.Add('ttrayicon','XPM',[ + '/* XPM */'#10'static char *trayicon[]={'#10'"23 23 5 1",'#10'". c None",'#10 + +'"c c #000000",'#10'"a c #808080",'#10'"b c #ffff00",'#10'"# c #ffffff",'#10 + +'".......................",'#10'".......................",'#10'"............' + +'...........",'#10'".......................",'#10'".......................",' + +#10'".......................",'#10'".......................",'#10'".........' + +'..............",'#10'".......................",'#10'"......................' + +'.",'#10'".......................",'#10'".......................",'#10'"....' + +'...................",'#10'".......................",'#10'"#################' + +'######",'#10'".......................",'#10'"...........aaaaaaaaaa..",'#10 + +'"...........a..bb....#..",'#10'"...........a.bbb.c.c#..",'#10'"...........a' + +'.bbb.c.c#..",'#10'"...........a..bb....#..",'#10'"...........a#########..",' + +#10'"......................."};'#10 +]); LazarusResources.Add('ttreeview','XPM',[ '/* XPM */'#10'static char * ttreeview_xpm[] = {'#10'"21 21 9 1",'#10'" '#9'c' +' None",'#10'".'#9'c #808080",'#10'"+'#9'c #000000",'#10'"@'#9'c #FFFFFF",' diff --git a/lcl/extctrls.pp b/lcl/extctrls.pp index 673ec312c5..d1ab4549cc 100644 --- a/lcl/extctrls.pp +++ b/lcl/extctrls.pp @@ -34,7 +34,8 @@ interface uses SysUtils, Classes, LCLStrConsts, LCLType, LCLProc, LResources, Controls, - Forms, StdCtrls, lMessages, GraphType, Graphics, LCLIntf, CustomTimer, Themes; + Forms, StdCtrls, lMessages, GraphType, Graphics, LCLIntf, CustomTimer, Themes, + LCLClasses, Menus; type { workaround problem with fcl } @@ -1061,6 +1062,59 @@ type property OnStartDrag; end; + { TCustomTrayIcon } + + TCustomTrayIcon = class(TLCLComponent) + private + FPopUpMenu: TPopupMenu; + FIcon: TIcon; + FHint: string; + FVisible, FShowIcon, FShowHint: Boolean; + FOnPaint, FOnClick, FOnDblClick: TNotifyEvent; + FOnMouseDown, FOnMouseUp: TMouseEvent; + FOnMouseMove: TMouseMoveEvent; + function GetCanvas: TCanvas; + procedure SetVisible(Value: Boolean); + public + Handle: PtrInt; + constructor Create(TheOwner: TComponent); override; + destructor Destroy; override; + function Hide: Boolean; + function Show: Boolean; + procedure InternalUpdate; + function GetPosition: TPoint; + property Canvas: TCanvas read GetCanvas; + property PopUpMenu: TPopupMenu read FPopUpMenu write FPopUpMenu; + property Icon: TIcon read FIcon write FIcon; + property Hint: string read FHint write FHint; + property ShowHint: Boolean read FShowHint write FShowHint; + property ShowIcon: Boolean read FShowIcon write FShowIcon; + property Visible: Boolean read FVisible write SetVisible; + property OnClick: TNotifyEvent read FOnClick write FOnClick; + property OnDblClick: TNotifyEvent read FOnDblClick write FOnDblClick; + property OnMouseDown: TMouseEvent read FOnMouseDown write FOnMouseDown; + property OnMouseUp: TMouseEvent read FOnMouseUp write FOnMouseUp; + property OnMouseMove: TMouseMoveEvent read FOnMouseMove write FOnMouseMove; + property OnPaint: TNotifyEvent read FOnPaint write FOnPaint; + end; + + { TTrayIcon } + + TTrayIcon = class(TCustomTrayIcon) + published + property PopUpMenu; + property Icon; + property Hint; + property ShowHint; + property ShowIcon; + property Visible; + property OnClick; + property OnDblClick; + property OnMouseDown; + property OnMouseUp; + property OnMouseMove; + property OnPaint; + end; const TCN_First = 0-550; @@ -1079,7 +1133,7 @@ procedure Register; begin RegisterComponents('Standard',[TRadioGroup,TCheckGroup,TPanel]); RegisterComponents('Additional',[TImage,TShape,TBevel,TPaintBox,TNotebook, - TLabeledEdit,TSplitter]); + TLabeledEdit,TSplitter,TTrayIcon]); RegisterComponents('System',[TTimer,TIdleTimer]); RegisterNoIcon([TPage]); end; @@ -1100,6 +1154,7 @@ end; {$I radiogroup.inc} {$I bevel.inc} {$I customimage.inc} +{$I customtrayicon.inc} initialization DockSplitterClass:=TSplitter; diff --git a/lcl/include/customtrayicon.inc b/lcl/include/customtrayicon.inc new file mode 100644 index 0000000000..ef7463991a --- /dev/null +++ b/lcl/include/customtrayicon.inc @@ -0,0 +1,169 @@ +{%MainUnit ../extctrls.pp} + +{****************************************************************************** + TCustomTrayIcon + ****************************************************************************** + + ***************************************************************************** + * * + * This file is part of the Lazarus Component Library (LCL) * + * * + * See the file COPYING.modifiedLGPL, included in this distribution, * + * for details about the copyright. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * * + ***************************************************************************** +} +{ + + Delphi compatibility: + + - TCustomTrayIcon is partially compatible with Delphi implementation +} + +{******************************************************************* +* TCustomTrayIcon.Create () +* +* DESCRIPTION: Creates an object from the TCustomTrayIcon class +* +* PARAMETERS: TheOwner - The owner of the component (this may be nil) +* +* RETURNS: A pointer to the newly created object +* +*******************************************************************} +constructor TCustomTrayIcon.Create(TheOwner : TComponent); +begin + inherited Create(TheOwner); + + FIcon := TIcon.Create; + + FShowIcon := True; +end; + +{******************************************************************* +* TCustomTrayIcon.Destroy () +* +* DESCRIPTION: Destroys an object derived from the TCustomTrayIcon class +* +* PARAMETERS: None +* +* RETURNS: Nothing +* +*******************************************************************} +destructor TCustomTrayIcon.Destroy; +begin + FIcon.Free; + + inherited Destroy; +end; + +{******************************************************************* +* TCustomTrayIcon.Hide () +* +* DESCRIPTION: Hides the Icon +* +* PARAMETERS: None +* +* RETURNS: If successfull +* +*******************************************************************} +function TCustomTrayIcon.Hide: Boolean; +begin + if not FVisible then Exit; + + FVisible := False; + +// InternalUpdate; + + Result := TWSCustomTrayIconClass(WidgetSetClass).Hide(Self); +end; + +{******************************************************************* +* TCustomTrayIcon.Show () +* +* DESCRIPTION: Shows the Icon +* +* PARAMETERS: None +* +* RETURNS: If successfull +* +*******************************************************************} +function TCustomTrayIcon.Show: Boolean; +begin + if FVisible then Exit; + + FVisible := True; + + InternalUpdate; + + Result := TWSCustomTrayIconClass(WidgetSetClass).Show(Self); +end; + +{******************************************************************* +* TCustomTrayIcon.SetVisible () +* +* DESCRIPTION: Setter method of the Visible property +* +* PARAMETERS: None +* +* RETURNS: If successfull +* +*******************************************************************} +procedure TCustomTrayIcon.SetVisible(Value: Boolean); +begin + if Value then Show + else Hide; +end; + +{******************************************************************* +* TCustomTrayIcon.InternalUpdate () +* +* DESCRIPTION: Makes modifications to the Icon while running +* i.e. without hiding it and showing again +* +* PARAMETERS: None +* +* RETURNS: Nothing +* +*******************************************************************} +procedure TCustomTrayIcon.InternalUpdate; +begin + TWSCustomTrayIconClass(WidgetSetClass).InternalUpdate(Self); +end; + +{******************************************************************* +* TCustomTrayIcon.GetPosition () +* +* DESCRIPTION: Returns the position of the tray icon on the display. +* This function is utilized to show message boxes near +* the icon +* +* PARAMETERS: None +* +* RETURNS: Nothing +* +*******************************************************************} +function TCustomTrayIcon.GetPosition: TPoint; +begin + Result := TWSCustomTrayIconClass(WidgetSetClass).GetPosition(Self); +end; + +{******************************************************************* +* TCustomTrayIcon.GetCanvas () +* +* DESCRIPTION: Getter method of the Canvas property +* +* PARAMETERS: None +* +* RETURNS: The canvas of the underlaying Widgetset component +* +*******************************************************************} +function TCustomTrayIcon.GetCanvas: TCanvas; +begin + Result := TWSCustomTrayIconClass(WidgetSetClass).GetCanvas(Self); +end; + +// included by extctrls.pp diff --git a/lcl/interfaces/qt/qtobjects.pas b/lcl/interfaces/qt/qtobjects.pas index 4f9c3e1177..a8bba8be72 100644 --- a/lcl/interfaces/qt/qtobjects.pas +++ b/lcl/interfaces/qt/qtobjects.pas @@ -332,10 +332,12 @@ type private public Handle: QSystemTrayIconH; + IconHandle: QIconH; // For external use public constructor Create(vIcon: QIconH); virtual; destructor Destroy; override; public + class function TIconToQIconH(const AIcon: TIcon): QIconH; // Helper function for TTrayIcon procedure setContextMenu(menu: QMenuH); procedure setIcon(icon: QIconH); procedure setToolTip(tip: WideString); @@ -2072,6 +2074,27 @@ begin inherited Destroy; end; +{******************************************************************* +* TQtSystemTrayIcon.TIconToQIconH () +* +* DESCRIPTION: Converts a TIcon to a QIconH +*******************************************************************} +class function TQtSystemTrayIcon.TIconToQIconH(const AIcon: TIcon): QIconH; +var + Pixmap: QPixmapH; +begin + if (AIcon <> nil) and (AIcon.Handle <> 0) then + begin + Pixmap := QPixmap_create(); + QPixmap_fromImage(Pixmap, TQtImage(AIcon.Handle).Handle); + + Result := QIcon_create(Pixmap); + QPixmap_destroy(Pixmap); + end + else + Result := QIcon_create(); +end; + procedure TQtSystemTrayIcon.setContextMenu(menu: QMenuH); begin QSystemTrayIcon_setContextMenu(handle, menu); diff --git a/lcl/interfaces/qt/qtwsextctrls.pp b/lcl/interfaces/qt/qtwsextctrls.pp index 2b0511f8d5..a88cd436de 100644 --- a/lcl/interfaces/qt/qtwsextctrls.pp +++ b/lcl/interfaces/qt/qtwsextctrls.pp @@ -219,6 +219,16 @@ type public end; + { TQtWSCustomTrayIcon } + + TQtWSCustomTrayIcon = class(TWSCustomTrayIcon) + public + class function Hide(const ATrayIcon: TCustomTrayIcon): Boolean; override; + class function Show(const ATrayIcon: TCustomTrayIcon): Boolean; override; + class procedure InternalUpdate(const ATrayIcon: TCustomTrayIcon); override; + class function GetPosition(const ATrayIcon: TCustomTrayIcon): TPoint; override; + class function GetCanvas(const ATrayIcon: TCustomTrayIcon): TCanvas; override; + end; implementation @@ -493,6 +503,84 @@ begin Result := THandle(QtGroupBox); end; +{ TQtWSCustomTrayIcon } + +class function TQtWSCustomTrayIcon.Hide(const ATrayIcon: TCustomTrayIcon): Boolean; +var + SystemTrayIcon: TQtSystemTrayIcon; +begin + Result := False; + + SystemTrayIcon := TQtSystemTrayIcon(ATrayIcon.Handle); + + SystemTrayIcon.Hide; + + QIcon_destroy(SystemTrayIcon.IconHandle); + + SystemTrayIcon.IconHandle := nil; + + SystemTrayIcon.Free; + + ATrayIcon.Handle := 0; + + Result := True; +end; + +class function TQtWSCustomTrayIcon.Show(const ATrayIcon: TCustomTrayIcon): Boolean; +var + Text: WideString; + SystemTrayIcon: TQtSystemTrayIcon; +begin + Result := False; + + SystemTrayIcon.IconHandle := TQtSystemTrayIcon.TIconToQIconH(ATrayIcon.Icon); + + SystemTrayIcon := TQtSystemTrayIcon.Create(SystemTrayIcon.IconHandle); + + ATrayIcon.Handle := PtrInt(SystemTrayIcon); + + Text := UTF8Decode(ATrayIcon.Hint); + SystemTrayIcon.setToolTip(Text); + + if Assigned(ATrayIcon.PopUpMenu) then + if TQtMenu(ATrayIcon.PopUpMenu.Handle).Widget <> nil then + SystemTrayIcon.setContextMenu(QMenuH(TQtMenu(ATrayIcon.PopUpMenu.Handle).Widget)); + + SystemTrayIcon.show; + + Result := True; +end; + +{******************************************************************* +* TQtWSCustomTrayIcon.InternalUpdate () +* +* DESCRIPTION: Makes modifications to the Icon while running +* i.e. without hiding it and showing again +*******************************************************************} +class procedure TQtWSCustomTrayIcon.InternalUpdate(const ATrayIcon: TCustomTrayIcon); +var + SystemTrayIcon: TQtSystemTrayIcon; +begin + if (ATrayIcon.Handle = 0) then Exit; + + SystemTrayIcon := TQtSystemTrayIcon(ATrayIcon.Handle); + + { PopUpMenu } + if Assigned(ATrayIcon.PopUpMenu) then + if TQtMenu(ATrayIcon.PopUpMenu.Handle).Widget <> nil then + SystemTrayIcon.setContextMenu(QMenuH(TQtMenu(ATrayIcon.PopUpMenu.Handle).Widget)); +end; + +class function TQtWSCustomTrayIcon.GetPosition(const ATrayIcon: TCustomTrayIcon): TPoint; +begin + Result := Point(0, 0); +end; + +class function TQtWSCustomTrayIcon.GetCanvas(const ATrayIcon: TCustomTrayIcon): TCanvas; +begin + Result := ATrayIcon.Icon.Canvas; +end; + initialization //////////////////////////////////////////////////// @@ -520,5 +608,6 @@ initialization // RegisterWSComponent(TLabeledEdit, TQtWSLabeledEdit); RegisterWSComponent(TCustomPanel, TQtWSCustomPanel); // RegisterWSComponent(TPanel, TQtWSPanel); + RegisterWSComponent(TCustomTrayIcon, TQtWSCustomTrayIcon); //////////////////////////////////////////////////// end. diff --git a/lcl/widgetset/wsextctrls.pp b/lcl/widgetset/wsextctrls.pp index 64bbcc0d32..631494899a 100644 --- a/lcl/widgetset/wsextctrls.pp +++ b/lcl/widgetset/wsextctrls.pp @@ -44,7 +44,7 @@ uses // To get as little as posible circles, // uncomment only when needed for registration //////////////////////////////////////////////////// - LCLProc, Controls, ExtCtrls, Classes, ImgList, + LCLProc, Controls, ExtCtrls, Classes, ImgList, Graphics, //////////////////////////////////////////////////// WSLCLClasses, WSControls, WSStdCtrls; @@ -163,6 +163,18 @@ type TWSPanel = class(TWSCustomPanel) end; + { TWSCustomTrayIcon } + + TWSCustomTrayIcon = class(TWSLCLComponent) + public + class function Hide(const ATrayIcon: TCustomTrayIcon): Boolean; virtual; + class function Show(const ATrayIcon: TCustomTrayIcon): Boolean; virtual; + class procedure InternalUpdate(const ATrayIcon: TCustomTrayIcon); virtual; + class function GetPosition(const ATrayIcon: TCustomTrayIcon): TPoint; virtual; + class function GetCanvas(const ATrayIcon: TCustomTrayIcon): TCanvas; virtual; + end; + TWSCustomTrayIconClass = class of TWSCustomTrayIcon; + implementation @@ -284,6 +296,67 @@ begin debugln('TWSCustomSplitter.DrawSplitter TODO'); end; +{ TWSCustomTrayIcon } + +{******************************************************************* +* TWSCustomTrayIcon.Hide () +* +* DESCRIPTION: Hides the Icon +* +* RETURNS: If successfull +* +*******************************************************************} +class function TWSCustomTrayIcon.Hide(const ATrayIcon: TCustomTrayIcon): Boolean; +begin + Result := False; +end; + +{******************************************************************* +* TWSCustomTrayIcon.Show () +* +* DESCRIPTION: Shows the Icon +* +* RETURNS: If successfull +* +*******************************************************************} +class function TWSCustomTrayIcon.Show(const ATrayIcon: TCustomTrayIcon): Boolean; +begin + Result := False; +end; + +{******************************************************************* +* TWSCustomTrayIcon.InternalUpdate () +* +* DESCRIPTION: Makes modifications to the Icon while running +* i.e. without hiding it and showing again +*******************************************************************} +class procedure TWSCustomTrayIcon.InternalUpdate(const ATrayIcon: TCustomTrayIcon); +begin + +end; + +{******************************************************************* +* TWSCustomTrayIcon.GetPosition () +* +* DESCRIPTION: Returns the position of the tray icon on the display. +* This function is utilized to show message boxes near +* the icon +*******************************************************************} +class function TWSCustomTrayIcon.GetPosition(const ATrayIcon: TCustomTrayIcon): TPoint; +begin + Result := Point(0, 0); +end; + +{******************************************************************* +* TWSCustomTrayIcon.GetCanvas () +* +* DESCRIPTION: Getter method of the Canvas property +*******************************************************************} +class function TWSCustomTrayIcon.GetCanvas(const ATrayIcon: TCustomTrayIcon): TCanvas; +begin + Result := nil; +end; + initialization //////////////////////////////////////////////////// @@ -309,5 +382,6 @@ initialization // RegisterWSComponent(TLabeledEdit, TWSLabeledEdit); // RegisterWSComponent(TCustomPanel, TWSCustomPanel); // RegisterWSComponent(TPanel, TWSPanel); + RegisterWSComponent(TCustomTrayIcon, TWSCustomTrayIcon); //////////////////////////////////////////////////// end.