Re: [lazarus] TrayIcon preview

2006-01-25 Thread Mattias Gaertner
On Wed, 25 Jan 2006 20:35:30 +0100
Danny Milosavljevic [EMAIL PROTECTED] wrote:

 Hi,
 
 Am Dienstag, den 24.01.2006, 07:19 -0200 schrieb Felipe Monteiro de
 Carvalho:
  On 1/21/06, Danny Milosavljevic [EMAIL PROTECTED] wrote:
   I would guess you only need to realize the window (so that it has a
   GDK - i.e. X - drawable, for example)
  
   You could also connect to the realize signal to only be notified
   when the window is realized and save the drawable there.
  
 
  Well . fell free to try those things and submit a patch if they work
  =)
 
 Right after I did the ~4000 other things in my TODO queue ;)
 
 (f.e. I do not have a system tray anymore so it would be quite some
 work)
 
 I do answer questions quickly though :)
 
  
  I don´t know much about Gtk and X11. I just copyed the GtkTrayIcon
  component form Andrew Heines and adapted it to my interface, changing
  the code until it worked =P
 
 I see :)
 
  
   If anything is unclear with gtk2 stuff, just ask me :)
  
  The following lines on gtk1 interface:
  
  procedure TWidgetTrayIcon.CreateForm(id: Integer);
  begin
  .
fDisplay :=
GDK_WINDOW_XDISPLAY(Pointer(PGtkWidget(GtkForm.Handle)^.window));
  //  SHowMessage(IntToStr(Integer(fDisplay)));
fWindow := GDK_WINDOW_XWINDOW
(Pointer(PGtkWidget(GtkForm.Handle)^.window)); fScreen :=
XDefaultScreenOfDisplay(fDisplay); // get the screen fScreenID :=
XScreenNumberOfScreen(fScreen); // and it's number
  end;
  
  GDK_WINDOW_XDISPLAY doesn´t exist on the Gtk2 interface. It´s a X11
  specific MACRO. I tryed to substitute this with:
 
 It does exist in gtk2 itself... though it's a little bit TOO low-level
 for my taste :)
 
 Better just use gtk_widget_get_screen and then
 gdk_x11_screen_get_xscreen, the latter being missing from the
 bindings there is no gdkx.pas in the bindings yet (not many people
 use the pascal gtk2 bindings for X interfacing it seems), 

They are not yet in the FPC sources, because I had not the time to test
them:

lazarus/components/opengl/gtk2x11/gdk2x11.lpk
unit gdk2x.pas

Mattias

[...]

_
 To unsubscribe: mail [EMAIL PROTECTED] with
unsubscribe as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] TrayIcon preview

2006-01-21 Thread Danny Milosavljevic
Hi,

Am Donnerstag, den 19.01.2006, 23:44 -0200 schrieb Felipe Monteiro de
Carvalho:
 New version of the TrayIcon component.
 
 The SystrayIcon object is much more stable, and works very well under:
 Win32, Gtk1 and Gnome. It works, but the image isn´t painted under
 Gtk2, only a grey icon appears =(

Can you give me a quick overview of the architecture? I can help with
the gtk2 stuff...

A quick look:

wsgtk2trayicon.pas
procedure TWidgetTrayIcon.CreateForm(id: Integer);
...
  // needed because some things aparently don't get fully initialized
until
  // visible at least once!  This is Gtk related NOT LCL related.
  GtkForm.Visible :=True;
  GtkForm.Width := 22;
  GtkForm.Height := 22;
  GtkForm.Visible := False;

Depending on why you do that, what you want is either realizing or
mapping the window.

Realizing means that X will create the real window (not show).
Mapping means that X will show the window (if all it's parents are
there, otherwise flags for later).

I would guess you only need to realize the window (so that it has a GDK
- i.e. X - drawable, for example)

You could also connect to the realize signal to only be notified when
the window is realized and save the drawable there.

If anything is unclear with gtk2 stuff, just ask me :)

cheers,
   Danny

 
 Documentation being constructed here:
 http://wiki.lazarus.freepascal.org/index.php/TrayIcon
 
 thanks,
 --
 Felipe Monteiro de Carvalho


_
 To unsubscribe: mail [EMAIL PROTECTED] with
unsubscribe as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] TrayIcon preview

2006-01-20 Thread Mattias Gaertner
On Thu, 19 Jan 2006 23:44:23 -0200
Felipe Monteiro de Carvalho [EMAIL PROTECTED] wrote:

 New version of the TrayIcon component.

Thanks. Can you create a diff next time?

 
 The SystrayIcon object is much more stable, and works very well under:
 Win32, Gtk1 and Gnome. It works, but the image isn´t painted under
 Gtk2, only a grey icon appears =(
 
 Documentation being constructed here:
 http://wiki.lazarus.freepascal.org/index.php/TrayIcon

Mattias

_
 To unsubscribe: mail [EMAIL PROTECTED] with
unsubscribe as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] TrayIcon preview

2006-01-19 Thread Felipe Monteiro de Carvalho
New version of the TrayIcon component.

The SystrayIcon object is much more stable, and works very well under:
Win32, Gtk1 and Gnome. It works, but the image isn´t painted under
Gtk2, only a grey icon appears =(

Documentation being constructed here:
http://wiki.lazarus.freepascal.org/index.php/TrayIcon

thanks,
--
Felipe Monteiro de Carvalho


TrayIcon.winzip
Description: Binary data


Re: [lazarus] TrayIcon preview

2006-01-18 Thread Mattias Gaertner
On Wed, 18 Jan 2006 10:04:40 +0200
Simeon Mitev [EMAIL PROTECTED] wrote:

 
 I've got an error when trying install TrayIcon package.
 It seams the Register procedure is missed in TrayIcon unit.
 
 ../trayiconlaz.pas(16,38) Error: Identifier not found Register

Fixed.

Mattias


 
 
 
 Christian Ulrich wrote:
  real nice work, i have tested it today and have some hints.
  
  1. tooltips are mostly known as hints in lazarus/delphi so maybe you
  should rename the 2 properties
  
  2. i think this component is visual better useable so its easyer to
  generate the events ...
  
  3. its not easy to generate an icon handle in win32 i will try to make
  an function that generates an handle from an bitmap so the
  handle can be created from TIcom (witch is an TBitmap) it not
  avalible
  
  
  regards
  Christian
  
  _
   To unsubscribe: mail [EMAIL PROTECTED] with
  unsubscribe as the Subject
 archives at http://www.lazarus.freepascal.org/mailarchives
  
 

_
 To unsubscribe: mail [EMAIL PROTECTED] with
unsubscribe as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] TrayIcon preview

2006-01-17 Thread A.J. Venter
Hi Felipe,
Thank you for this, something I've been VERY much wanting in lazarus was 
trayicon support.

A few quick questions though
1) Is it a component ? Visual ? Nonvisual ? I admit I've only had a cursory 
glance at your sources, not a sufficient study yet.
2) Is there a README or a short howto available ?

And one for Mattias et all - this is SUCH a widely useable thing and since 
Felipe made it nicely multiplatform for ALL the currently active Lazarus 
platforms, shouldn't it go into Lazarus itself ?

Ciao
A.J.
On Monday 16 January 2006 23:49, Felipe Monteiro de Carvalho wrote:
 The test program works on Linux (tested on Gnome, KDE, IceWM) and
 Windows (tested on XP).
 --
 Felipe Monteiro de Carvalho

-- 
80% Of a hardware engineer's job is application of the uncertainty principle.
80% of a software engineer's job is pretending this isn't so.
A.J. Venter
Chief Software Architect
OpenLab International
http://www.getopenlab.com   | +27 82 726 5103 (South Africa)
http://www.silentcoder.co.za| +55 118 162 2079 (Brazil)

_
 To unsubscribe: mail [EMAIL PROTECTED] with
unsubscribe as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] TrayIcon preview

2006-01-17 Thread Mattias Gaertner
On Mon, 16 Jan 2006 19:49:04 -0200
Felipe Monteiro de Carvalho [EMAIL PROTECTED] wrote:

 The test program works on Linux (tested on Gnome, KDE, IceWM) and
 Windows (tested on XP).

Thanks. I created a package TrayIconLaz.lpk and added it to svn.

Mattias

_
 To unsubscribe: mail [EMAIL PROTECTED] with
unsubscribe as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] TrayIcon preview

2006-01-17 Thread Mattias Gaertner
On Tue, 17 Jan 2006 13:02:06 +0200
A.J. Venter [EMAIL PROTECTED] wrote:

 Hi Felipe,
 Thank you for this, something I've been VERY much wanting in lazarus was 
 trayicon support.
 
 A few quick questions though
 1) Is it a component ? Visual ? Nonvisual ? I admit I've only had a
 cursory  glance at your sources, not a sufficient study yet.

Nonvisual. But you can put it onto a form, like TOpenDialog.


 2) Is there a README or a short howto available ?

There is an example.

 
 And one for Mattias et all - this is SUCH a widely useable thing and since
 
 Felipe made it nicely multiplatform for ALL the currently active Lazarus 
 platforms, shouldn't it go into Lazarus itself ?

It's in Lazarus now.
To add it to the LCL we must reorder/rename a few things.


Mattias



 
 Ciao
 A.J.
 On Monday 16 January 2006 23:49, Felipe Monteiro de Carvalho wrote:
  The test program works on Linux (tested on Gnome, KDE, IceWM) and
  Windows (tested on XP).
  --
  Felipe Monteiro de Carvalho
 

_
 To unsubscribe: mail [EMAIL PROTECTED] with
unsubscribe as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] TrayIcon preview

2006-01-17 Thread Christian Ulrich
real nice work, i have tested it today and have some hints.

1. tooltips are mostly known as hints in lazarus/delphi so maybe you should
rename the 2 properties

2. i think this component is visual better useable so its easyer to generate
the events ...

3. its not easy to generate an icon handle in win32 i will try to make an
function that generates an handle from an bitmap so the
handle can be created from TIcom (witch is an TBitmap) it not avalible


regards
Christian

_
 To unsubscribe: mail [EMAIL PROTECTED] with
unsubscribe as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] TrayIcon preview

2006-01-17 Thread Felipe Monteiro de Carvalho
On 1/17/06, A.J. Venter [EMAIL PROTECTED] wrote:
 2) Is there a README or a short howto available ?

Documentation is being constructed here:
http://wiki.lazarus.freepascal.org/index.php/TrayIcon


--
Felipe Monteiro de Carvalho

_
 To unsubscribe: mail [EMAIL PROTECTED] with
unsubscribe as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives