Re: [lazarus] Editor issues

2007-09-11 Thread Søren Ager

Lepidosteus wrote:


 2 - act weirds with tabs


Disable Smart tabs


Hilsen
  Søren


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


Re: [lazarus] Editor issues

2007-09-11 Thread Graeme Geldenhuys
On 11/09/2007, Lepidosteus [EMAIL PROTECTED] wrote:
  1 - lack some features
 For exemple, when typing begin, I've been used to delphi writing two
 new lines, end;, ans putting me on the middle line, just where I
 should type.
 I understand this is code templates or something like this, and
 there may even be a way to do it in lazarus yet. My issue is that you
 install, it doesn't do it.

Code templates in Lazarus can only do so much and a little bit more
using the available macros. There was talks about implementing
something like the  'Code Templates' introduced in Delphi 2005
onwards. The user can define a lot more advanced features and behavior
inside a code template xml file.

I'm not sure if anybody has started implementing something like this
in Lazarus yet.

  2 - act weirds with tabs
 This got me completly off of it and I went back to fpcgui to edit my files.
 I don't remember the setting I changed, I know I have tried the
 default ones, they were painfull, I tried using everything available,
 and it never worked great.

The last time I tried Tabs in the Lazarus Editor (a few months back) I
noticed and it was confirmed that a lot is missing from the editor for
full tab support. Save and loading files containing tabs got corrupted
plus a few more.  I have no idea what the state is of Tab support in
the editor now - Lazarus development moves quite fast.

Graeme.

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


Re: Icons run and pause for Lazarus

2007-09-11 Thread Graeme Geldenhuys
Hi,

Thanks for the effort.  My personal opinion (and I don't have any
official say in what goes in Lazarus) is that it doesn't quite fit
with the rest of the images. The style is different.  If you look at
the others (like in the File or Project menus) you will have noticed
that we used pastel type colors. No bright colors or glossy effects
have been used.

Yes it's better looking than the existing Pause and Run images (which
is very bland), but I think adjusting them to use the same color
(pastel) palette like the other images would be a better fit.

Just my 0.02c worth.

Regards,
  - Graeme -



On 10/09/2007, wile64 [EMAIL PROTECTED] wrote:

 2007/9/10, wile64 [EMAIL PROTECTED]:
  Hello,
 
  I have create images for Lazarus, made as you want ;)
 
  Regard,
 

 With the files its better !!! :D


  --
 Laurent.
 
 My Web : http://wile64.neuf.fr/
 French Forum : http://lazforum-fr.tuxfamily.org/index.php


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


[lazarus] FPC 2.2 article made it onto OSNews.com

2007-09-11 Thread Graeme Geldenhuys
Nicely done Joost!

http://www4.osnews.com/story/18592/Cross-Platform_Development_with_Free_Pascal_2.2.0

... or a shorter link:   http://tinyurl.com/ywzyvr


Regards,
  - Graeme -

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


Re: [lazarus] Editor issues

2007-09-11 Thread Mattias Gaertner
On Tue, 11 Sep 2007 08:41:10 +0200
Graeme Geldenhuys [EMAIL PROTECTED] wrote:

 Save and loading files containing tabs got corrupted plus a few more. 

Can you give more details?

Mattias

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


Re: [lazarus] FPC 2.2 article made it onto OSNews.com

2007-09-11 Thread ik
On 9/11/07, Graeme Geldenhuys [EMAIL PROTECTED] wrote:
 Nicely done Joost!

 http://www4.osnews.com/story/18592/Cross-Platform_Development_with_Free_Pascal_2.2.0

 ... or a shorter link:   http://tinyurl.com/ywzyvr

I have translated the article to Hebrew, if there are anyone that interested :)
http://idkn.blogli.co.il/archives/69



 Regards,
   - Graeme -


Ido
-- 
http://ik.homelinux.org/

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


Re: [lazarus] Editor issues

2007-09-11 Thread Mattias Gaertner
On Tue, 11 Sep 2007 05:48:03 +0200
Lepidosteus [EMAIL PROTECTED] wrote:

 Hello,
 
 I haven't done a lot of pascal code lately, and even less free pascal
 code using lazarus. I wanted to make changes in some old software I
 made for my own usage.
 
 After trying the delphi 2007 trial a couple of month ago, I've been
 really surprised at how bad the lazarus editor feels, *at least with
 the default install*.
 
 I'm not speaking about the IDE, it's as fast as back when I used it,
 and looks more stable, I didn't get any issue with it while coding.
 
 But the editor seems to
  1 - lack some features
 For exemple, when typing begin, I've been used to delphi writing two
 new lines, end;, ans putting me on the middle line, just where I
 should type.
 I understand this is code templates or something like this, and
 there may even be a way to do it in lazarus yet. My issue is that you
 install, it doesn't do it.

Code templates currently misses this automatism. You have to activate
them manually with Ctrl+j. For example: Type b + Ctrl+j.

 
  2 - act weirds with tabs
 This got me completly off of it and I went back to fpcgui to edit my
 files. I don't remember the setting I changed, I know I have tried the
 default ones, they were painfull, I tried using everything available,
 and it never worked great.
 
 Right now my indent block is set to two.
 function blah(i: string): integer;
 begin
 d; // indent: 5
 if (true) then
dosomework; // indent: 8, 5 + 3 ...
 end;
 
 I could not get it to indent to less than 5 chars on the first tab,
 which is really too much (it starts *after* the begin word ...).

Disable 'smart tabs'.

 
 When you try to edit into the tab thing it gets even worse.
 If I put my caret after dosomework; press enter, i'm on the same
 column.

Yes, it is a ToDo to integrate a good beautifier in lazarus, which can
tell nice line indenting.


 So I need to unindent, i press backspace, it unindent back to
 column 0. Okay so I press tab to get to my column. It indent to
 column 8, not 5.

Disable 'smart tabs'.

 
 That's where it lost me.


Mattias

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


Re: Icons run and pause for Lazarus

2007-09-11 Thread Graeme Geldenhuys
On 10/09/2007, wile64 [EMAIL PROTECTED] wrote:
 
  I have create images for Lazarus, made as you want ;)
 


Below are some samples I think (again my opinion only) Lazarus is
going with... After all these links are mentioned in the Help - About
dialog.

http://tango.freedesktop.org/Tango_Icon_Library
http://tango.freedesktop.org/Tango_Icon_Theme_Guidelines

http://www.famfamfam.com/lab/icons/silk/


Regards,
  - Graeme -

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


Re: Icons run and pause for Lazarus

2007-09-11 Thread wile64
Thank you for your answer, this appear to you better?


2007/9/11, Graeme Geldenhuys [EMAIL PROTECTED]:

 On 10/09/2007, wile64 [EMAIL PROTECTED] wrote:
  
   I have create images for Lazarus, made as you want ;)
  


 Below are some samples I think (again my opinion only) Lazarus is
 going with... After all these links are mentioned in the Help - About
 dialog.

 http://tango.freedesktop.org/Tango_Icon_Library
 http://tango.freedesktop.org/Tango_Icon_Theme_Guidelines

 http://www.famfamfam.com/lab/icons/silk/


 Regards,
   - Graeme -

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




-- 
Laurent.

My Web : http://wile64.neuf.fr/
French Forum : http://lazforum-fr.tuxfamily.org/index.php
attachment: menu_run.png

Re: Icons run and pause for Lazarus

2007-09-11 Thread Graeme Geldenhuys
On 11/09/2007, wile64 [EMAIL PROTECTED] wrote:

 Thank you for your answer, this appear to you better?


Yes, that looks much better.  :)


Graeme.

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


Re: Icons run and pause for Lazarus

2007-09-11 Thread Graeme Geldenhuys
On 11/09/2007, wile64 [EMAIL PROTECTED] wrote:
 And for pause !

Perfect!  And all we still need is a greyed out Pause for the toolbar.

Regards,
  - Graeme -

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


Re: [lazarus] Lazarus on one window (aka SDI)

2007-09-11 Thread Marc Weustink

Graeme Geldenhuys wrote:

On 11/09/2007, Víctor R. Ruiz [EMAIL PROTECTED] wrote:

  Hi:

  I know some programmers prefer Lazarus IDE the way it is. However,
on my development environments, with little desktop space, working
with many windows is not a happy experience. I also read some threads
on the web forum requesting workspace integration, so I started
digging in the Lazarus code. Thanks to Mattias' fix to the Notebook



I think that screenshot looks quite nice.  After working for so long
with Lazarus I got so used to the IDE having separate windows. But by
looking at your screenshot, I noticed I have arranged my Lazarus
windows in the exact same order and next to each other to get the same
effect. :-)


I've the same layout in separate windows. I never can get used to delphi 
versions where they are placed in one window, since whin I want to edit 
some properties in the object inspector, the whole is covering my form 
so I cannot see the visual imapact. This means that I've to switch 
everytime between OI and form to see if it is OK.
So if you ask me, I won't invest time implementing a feature in Lazarus 
which I never would use.


Marc


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


Re: Icons run and pause for Lazarus

2007-09-11 Thread wile64
here!

2007/9/11, Graeme Geldenhuys [EMAIL PROTECTED]:

 On 11/09/2007, wile64 [EMAIL PROTECTED] wrote:
  And for pause !

 Perfect!  And all we still need is a greyed out Pause for the toolbar.

 Regards,
   - Graeme -

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




-- 
Laurent.

My Web : http://wile64.neuf.fr/
French Forum : http://lazforum-fr.tuxfamily.org/index.php
attachment: btn_pause.xpmattachment: btn_run.xpm

Re: Icons run and pause for Lazarus

2007-09-11 Thread Graeme Geldenhuys
If there are no objections from anybody else, could Lazarus be updated
with these images?
Locations to change would be the Lazarus Toolbar and Run menu.

Regards,
  - Graeme -


On 11/09/2007, wile64 [EMAIL PROTECTED] wrote:
 here!


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


Re: Icons run and pause for Lazarus

2007-09-11 Thread wile64
If you want I can create others with time of them?


Laurent.

My Web : http://wile64.neuf.fr/
French Forum : http://lazforum-fr.tuxfamily.org/index.php


Re: Icons run and pause for Lazarus

2007-09-11 Thread Paul Ishenin

Graeme Geldenhuys пишет:

On 11/09/2007, wile64 [EMAIL PROTECTED] wrote:

And for pause !


Perfect!  And all we still need is a greyed out Pause for the toolbar.




Please dont be so fast :) We have some plans for next development 
version of lazarus (0.9.25). Greyed and Highlighted icons will be 
automatically generated from normal images.


This should prevent extra work for designers.

Best regards,
Paul Ishenin.


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


Re: Icons run and pause for Lazarus

2007-09-11 Thread wile64


 Please dont be so fast :) We have some plans for next development
 version of lazarus (0.9.25). Greyed and Highlighted icons will be
 automatically generated from normal images.

 This should prevent extra work for designers.


it is a good idea… ;)


-- 
Laurent.

My Web : http://wile64.neuf.fr/
French Forum : http://lazforum-fr.tuxfamily.org/index.php


Re: [lazarus] Lazarus on one window (aka SDI)

2007-09-11 Thread Graeme Geldenhuys
On 11/09/2007, Marc Weustink [EMAIL PROTECTED] wrote:

 I've the same layout in separate windows. I never can get used to delphi
 versions where they are placed in one window, since whin I want to edit

As I mentioned, I have done the same as you and am very happy with
separate windows. On the other hand it might be good to let the
developer decide what layout they prefer. Delphi and VB6 could switch
between SDI or MDI interface.  I just did a quick look around and
would guess that 90% of all IDE's use a MDI interface (but that could
also be because most of them run under Windows, which loves MDI
interfaces).

Examples of the most popular IDE's using MDI:

  Eclipse (from IBM and others)
  Delphi (from CodeGear)
  Visual Studio (from Microsoft)
  SharpDevelop
  MonoDevelop
  Qt Designer (from Trolltech - I know it's not a IDE)
  VB 5,6 (from Microsoft)
  Magic C++ (windows and Linux ide)
  JBuilder (from CodeGear)
  JCreator
  KDevelop
  NetBeans (from Sun)
  JDeveloper (from Oracle)
  ...etc


I think the MDI based IDE's outnumber the SDI based IDE's by far.

Regards,
  - Graeme -

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


Re: [lazarus] GTK Rotated text

2007-09-11 Thread Marc Weustink

Luis Rodrigues wrote:

Hi,

Over the last weekend I've implemented text rotate in GTK2. I've
implemented it in Gtk2WidgetSet.ExtTextOut. Since there is no way to
define that the font is rotated, TGtk2WidgetSet.CreateFontIndirectEx ..
lfEscapement can only be used to place the angle  somewhere to
ExtTextOut to use.

The used functions (with gtk/pango version)
pango_matrix_rotate -  gtk2.6 
pango_matrix_translate - gtk2.6

pango_context_set_matrix - gtk2.6
pango_renderer_draw_layout - pango1.8

gdk_pango_renderer_get_default - gtk2.6
gdk_pango_renderer_set_drawable - gtk2.6
gdk_pango_renderer_set_gc - gtk2.6

gtk2.6 and pango1.8 where released in Dec 2004 so I guess i can be
implemented with no problems :)


IIRC we already use some 2.6 funtions.

Marc

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


Re: Icons run and pause for Lazarus

2007-09-11 Thread Graeme Geldenhuys
On 11/09/2007, Paul Ishenin [EMAIL PROTECTED] wrote:

 Please dont be so fast :) We have some plans for next development
 version of lazarus (0.9.25). Greyed and Highlighted icons will be
 automatically generated from normal images.

 This should prevent extra work for designers.


Brilliant idea!  :-)
It would save lots of effort.


Graeme.

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


Re: Icons run and pause for Lazarus

2007-09-11 Thread dhkblaszyk
 If you want I can create others with time of them?

Please do so :) Improved icons are always welcomed.

Darius

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


[lazarus] External Tools and Messages window

2007-09-11 Thread Tiziano_mk


I'm trying to make a simple program that I want to put under the Tools 
menu, configured with the Tools|Configure custom tools... command.


All works nicely, but the output of my tool does not appear in the 
Messages window. Note that the messages are there, since I can copy all 
and hidden messages to clipboard.


It seems to me that if I check the Scan output for Free Pascal Compiler 
messages checkbox this should happen.


Am I missing something important?
(Lazarus 0.9.22 - FPC 2.0.4 - Windows i386 platform)


tiziano

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


[lazarus] Elastic tabstops

2007-09-11 Thread Graeme Geldenhuys
When developing in a large team, you have to make convention about the
use of tab in source code. This article suggests a better solution:
rather than saying that a tab character (a 'hard tab') will move the
cursor until the cursor's position is a multiple of N characters, we
should say that a tab character is a delimiter between table cells.
This has a nice side effect, since proportional fonts can now be used.

http://nickgravgaard.com/elastictabstops/


Cool feature for Lazarus?  It should make Tab and Space users happy.


Regards,
  - Graeme -

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


[lazarus] IDE, start once, open files

2007-09-11 Thread Mattias Gärtner

Is there already a cross platform component for applications to check if it is
already running and if yes then pass some commands to the already application?

For example clicking on files in the file browser should not open a second
instance, but tell the already running instance to open the files.


Mattias

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


Re: [lazarus] Editor issues

2007-09-11 Thread Mattias Gärtner
Zitat von Lepidosteus [EMAIL PROTECTED]:

[...]
 But the editor seems to
  1 - lack some features
 For exemple, when typing begin, I've been used to delphi writing two
 new lines, end;, ans putting me on the middle line, just where I
 should type.
 I understand this is code templates or something like this, and
 there may even be a way to do it in lazarus yet. My issue is that you
 install, it doesn't do it.

I have a question, how it should work 'automatically':
Does this mean, you can no longer write 'beginning' in Delphi?
Or is the IDE waiting a little, so it is only invoked if you type begin and
wait?
I guess the last, but who wants to wait?


Mattias

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


Re: Elastic tabstops

2007-09-11 Thread Graeme Geldenhuys
For people like me that don't know how to execute a *.jar files
(smile) here is the syntax.

java -jar ETNotepad.jar

The more I played with that demo editor the more I liked the idea of
implementing 'elastic tabstops' in Lazarus.  I believe this will be a
excellent addition to the editor and should make code formatting
uniform.

Regards,
  - Graeme -




On 11/09/2007, Graeme Geldenhuys [EMAIL PROTECTED] wrote:
 When developing in a large team, you have to make convention about the
 use of tab in source code. This article suggests a better solution:
 rather than saying that a tab character (a 'hard tab') will move the
 cursor until the cursor's position is a multiple of N characters, we
 should say that a tab character is a delimiter between table cells.
 This has a nice side effect, since proportional fonts can now be used.

 http://nickgravgaard.com/elastictabstops/


 Cool feature for Lazarus?  It should make Tab and Space users happy.


 Regards,
   - Graeme -


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


Re: [lazarus] Editor issues

2007-09-11 Thread Michael Van Canneyt


On Tue, 11 Sep 2007, Mattias Gärtner wrote:

 Zitat von Lepidosteus [EMAIL PROTECTED]:
 
 [...]
  But the editor seems to
   1 - lack some features
  For exemple, when typing begin, I've been used to delphi writing two
  new lines, end;, ans putting me on the middle line, just where I
  should type.
  I understand this is code templates or something like this, and
  there may even be a way to do it in lazarus yet. My issue is that you
  install, it doesn't do it.
 
 I have a question, how it should work 'automatically':
 Does this mean, you can no longer write 'beginning' in Delphi?
 Or is the IDE waiting a little, so it is only invoked if you type begin and
 wait?
 I guess the last, but who wants to wait?

My Delphi 7 definitely doesn't do the described behaviour by default; Only
if I press ctrl-j after the begin.

(Nor would I want it to do this automatically)

Michael.

Re: [lazarus] Editor issues

2007-09-11 Thread Graeme Geldenhuys
On 11/09/2007, Mattias Gärtner [EMAIL PROTECTED] wrote:
 I have a question, how it should work 'automatically':
 Does this mean, you can no longer write 'beginning' in Delphi?
 Or is the IDE waiting a little, so it is only invoked if you type begin and
 wait?
 I guess the last, but who wants to wait?


I don't know and I'm guessing here...  Doesn't it get triggered when
you press the spacebar  or enter key after the 'begin' keyword?  As
far as I know with the new Delphi code templates you can even define
the key that triggers the completion.

Will trigger code completion:

  beginspace or enter


So typing the following will _not_ trigger code completion:

  beginningspace or enter will not trigger the code completion



I haven't worked on Delphi since v7.

Regards,
  - Graeme -

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


Re: [lazarus] Editor issues

2007-09-11 Thread Graeme Geldenhuys
On 11/09/2007, Michael Van Canneyt [EMAIL PROTECTED] wrote:

 My Delphi 7 definitely doesn't do the described behaviour by default; Only
 if I press ctrl-j after the begin.

 (Nor would I want it to do this automatically)

As far as I know that code template / code completion feature was
introduced in Delphi 2005 onwards.  Delphi 7 and earlier used Ctrl+J
like Lazarus does.

Graeme.

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


Re: [lazarus] Editor issues

2007-09-11 Thread dhkblaszyk
 On 11/09/2007, Michael Van Canneyt [EMAIL PROTECTED] wrote:

 My Delphi 7 definitely doesn't do the described behaviour by default;
 Only
 if I press ctrl-j after the begin.

 (Nor would I want it to do this automatically)

 As far as I know that code template / code completion feature was
 introduced in Delphi 2005 onwards.  Delphi 7 and earlier used Ctrl+J
 like Lazarus does.


Invoking code completion with enter is also the way that vb works.

Darius

 Graeme.

 _
  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] Lazarus on one window (aka SDI)

2007-09-11 Thread Johannes Nohl
  I've the same layout in separate windows. I never can get used to delphi
  versions where they are placed in one window, since whin I want to edit

 As I mentioned, I have done the same as you and am very happy with
 separate windows. On the other hand it might be good to let the
 developer decide what layout they prefer. Delphi and VB6 could switch
 between SDI or MDI interface.  I just did a quick look around and
 would guess that 90% of all IDE's use a MDI interface (but that could
 also be because most of them run under Windows, which loves MDI
 interfaces).

Why can't lazarus has both? Something like startlazarus -mdi or even
better a menu switch? You shouldn't fight for dogmas. By a closer look
the linux people always prefer the use of many windows. The windows
people like it to be MDI.

The very best would be if users can dock windows together. Like dock
the properties to the main window. Now beeing one window. Then it will
only have one entry in taskbar. That would be nice! (if possible
having a window looking like a rotated L ).


-
___
|   |
|   |
|   |


better one window:

___
___
|   |
|   |
|   |


Hope you can understand what I try to express :-)

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


RE: [lazarus] Editor issues

2007-09-11 Thread Crause, Christo \(JC\)
  But the editor seems to
   1 - lack some features
  For exemple, when typing begin, I've been used to delphi writing two
  new lines, end;, ans putting me on the middle line, just where I
  should type.
  I understand this is code templates or something like this, and
  there may even be a way to do it in lazarus yet. My issue 
 is that you
  install, it doesn't do it.
 
 I have a question, how it should work 'automatically':
 Does this mean, you can no longer write 'beginning' in Delphi?
 Or is the IDE waiting a little, so it is only invoked if you 
 type begin and
 wait?
 I guess the last, but who wants to wait?

From Delphi 2005 the default option in the editor is to insert a
matching end statement when a code block is started by begin and after
enter is pressed.  It is somewhat irritating since I'm used to
automatically fill in the end myself.  I can see that it can save typing
though.  The only problem in Delphi is that the editor sometimes messes
up the placement of the end in nested if statements where it is not
immediately obvious how the blocks are nested.

I have disabled this option at work, but at home it is enabled; which
probably shows that it is at least somewhat useful even for old timers
like myself.

Regards,
Christo

NOTICE: Please note that this eMail, and the contents thereof, 
is subject to the standard Sasol eMail legal notice which may be found at: 
http://www.sasol.com/legalnotices   
   

If you cannot access the legal notice through the URL attached and you wish 
to receive a copy thereof please send an eMail to 
[EMAIL PROTECTED]


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


Re: [lazarus] Lazarus on one window (aka SDI)

2007-09-11 Thread Luca Olivetti

En/na Marc Weustink ha escrit:

I've the same layout in separate windows. I never can get used to delphi 
versions where they are placed in one window, since whin I want to edit 
some properties in the object inspector, the whole is covering my form 
so I cannot see the visual imapact. This means that I've to switch 
everytime between OI and form to see if it is OK.
So if you ask me, I won't invest time implementing a feature in Lazarus 
which I never would use.


OTOH I find it really sweet to have the toolbar, the messages and the 
editor in the same window (I always seem to be chasing the messages 
and/or the toolbar when I move windows around or maximize the editor, 
ok, my fault but I'd still like to have those in the same window).

I agree that the object inspector should be in a stand alone window.
Maybe the interface could be dockable?

Bye
--
Luca

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


Re: [lazarus] IDE, start once, open files

2007-09-11 Thread Luca Olivetti

En/na Mattias Gärtner ha escrit:

Is there already a cross platform component for applications to check if it is
already running and if yes then pass some commands to the already application?

For example clicking on files in the file browser should not open a second
instance, but tell the already running instance to open the files.


There's uniqueinstance
http://sourceforge.net/project/shownotes.php?group_id=92177release_id=471823
(The wiki is down, so I cannot give you the wiki link) *but* it doesn't 
work here under Linux (I could launch more that one instance of my program).
Since I hadn't too much time to debug it, I slightly modified it to open 
and lock a file instead of using TSimpleIpc, but that makes it 
non-crossplatform.
Since it's short I'm including it here, it could be extended to write 
the pid in the file, so another instance can somewhat contact the first one.


Bye
--
Luca

unit uniqueinstanceraw;

{$mode objfpc}{$H+}

interface

uses
  Classes, SysUtils,baseunix,unix;
  
  function InstanceRunning(const Identifier: String): Boolean;

  function InstanceRunning: Boolean;

implementation

const
  BaseServerId = 'tuniqueinstance_';


function InstanceRunning(const Identifier: String): Boolean;
var
  FLockFile:cint;

  function GetServerId: String;
  begin
if Identifier  '' then
  Result:=BaseServerId+Identifier
else
  Result:=BaseServerId+ExtractFileName(ParamStr(0));
  end;
  
begin
  //cuando el programa termine el lock desaparece solo
  result:=true;
  FLockFile:=fpOpen('/tmp/'+GetServerId, O_RDWR or O_CREAT);
  if FLockFile0 then
result:=fpFlock(FLockFile, LOCK_EX or LOCK_NB)0;
end;

function InstanceRunning: Boolean;
begin
  InstanceRunning('');
end;

end.



Re: [lazarus] unable to run Qt app

2007-09-11 Thread Giuliano Colla

Den Jean ha scritto:


On Monday 10 September 2007 12:41:50 Giuliano Colla wrote:
 


start. Which application is irrelevant, all I tested exhibit the same
behavior.
   



using binaries across Linux distributions is not done, 
so recompile binding and please report if this fixes it (feedback helps us)


 

Yes, recompiling the bindings fixed the problem, thank you. Same 
bindings works for me both with Qt 4.3.0 (current  release in FC5) and 
Qt 4.3.1.
It took me some time because the gcc version I've been using (from FC5 
distro) doesn't use the library path to search for files, so it was 
unable to find libQtCore.so.4 and libQtGui.so.4.  I didn't grasp the 
problem at first, believing that the problem was in the linker. I fixed 
it just by symlinking the two files in the bindings dir, but a small fix 
of the compile_lib.bash script would make it of more generalized use. 
Sort of prepending $LD_LIBRARY_PATH/ to the filenames in the g++ 
invocation. Makes no harm to smart g++, but it's necessary with the dumb 
one.


To make you curious about the progress, look at Lazarus compiled 
with Qt4 running a bindings demo shapedclock (last screenshot thumb):

http://users.pandora.be/Jan.Van.hijfte/qtforfpc/fpcqt4.html

The screenshot does not show that synedit is still very slow, 
but what a progress Paul and Zeljko have realized.


 

The reason I wanted to test it was exactly that I was curious about 
progress. I must say that I'm quite impressed. The Lazarus IDE is quite 
an achievement. Even if there's still work to be done,
I find Qt more advanced than gtk 2. What isn't yet there doesn't work, 
of course, but what is there appears to me much more finished and 
reliable than the gtk 2 counterpart. Which is a good thing because the 
best you can say about gtk 2 is that it's better than gtk1...
I'd love to be able to contribute, but for the moment I'm too much 
pressed by deadlines. But I never lose hopes.


Regards,

Giuliano

--
Giuliano Colla

Still using C++ and Visual Studio? I'm using Object Pascal and Lazarus.


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


Re: [lazarus] Lazarus on one window (aka SDI)

2007-09-11 Thread Víctor R. Ruiz
  Hi:

2007/9/11, Luca Olivetti [EMAIL PROTECTED]:
 OTOH I find it really sweet to have the toolbar, the messages and the
 editor in the same window (I always seem to be chasing the messages
 and/or the toolbar when I move windows around or maximize the editor,
 ok, my fault but I'd still like to have those in the same window).
 I agree that the object inspector should be in a stand alone window.
 Maybe the interface could be dockable?

  There seems to be code for docks, but I found no documentation and
just used forms and panels. I will try to add support to switch
between individual windows and panels (no docks, but dock-like).

  Greetings,

-- 
Víctor R. Ruiz [EMAIL PROTECTED] | - Todos estos momentos se perderán
http://rvr.blogalia.com/   |   como lágrimas en la lluvia

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


Re: [lazarus] FPC 2.2 article made it onto OSNews.com

2007-09-11 Thread Giuliano Colla

ik ha scritto:


On 9/11/07, Graeme Geldenhuys [EMAIL PROTECTED] wrote:
 


Nicely done Joost!

http://www4.osnews.com/story/18592/Cross-Platform_Development_with_Free_Pascal_2.2.0

... or a shorter link:   http://tinyurl.com/ywzyvr
   



I have translated the article to Hebrew, if there are anyone that interested :)
http://idkn.blogli.co.il/archives/69

 

I was interested, but I could make out only yet another blog in 
blogli, then I got lost

Maybe I need to refresh my hebrew a bit. :-)
In any case, happy new year!

Giuliano

--
Giuliano Colla

Still using C++ and Visual Studio? I'm using Object Pascal and Lazarus.


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


Re: [lazarus] Lazarus on one window (aka SDI)

2007-09-11 Thread Mattias Gärtner
Zitat von Luca Olivetti [EMAIL PROTECTED]:

 En/na Marc Weustink ha escrit:

  I've the same layout in separate windows. I never can get used to delphi
  versions where they are placed in one window, since whin I want to edit
  some properties in the object inspector, the whole is covering my form
  so I cannot see the visual imapact. This means that I've to switch
  everytime between OI and form to see if it is OK.
  So if you ask me, I won't invest time implementing a feature in Lazarus
  which I never would use.

 OTOH I find it really sweet to have the toolbar, the messages and the
 editor in the same window (I always seem to be chasing the messages
 and/or the toolbar when I move windows around or maximize the editor,
 ok, my fault but I'd still like to have those in the same window).
 I agree that the object inspector should be in a stand alone window.
 Maybe the interface could be dockable?

I agree. I hope to find time to finish the LCL docking code. As soon as this
works good enough it will be used in the IDE.


Mattias

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


Re: [lazarus] Lazarus on one window (aka SDI)

2007-09-11 Thread Marc Weustink

Johannes Nohl wrote:

I've the same layout in separate windows. I never can get used to delphi
versions where they are placed in one window, since whin I want to edit

As I mentioned, I have done the same as you and am very happy with
separate windows. On the other hand it might be good to let the
developer decide what layout they prefer. Delphi and VB6 could switch
between SDI or MDI interface.  I just did a quick look around and
would guess that 90% of all IDE's use a MDI interface (but that could
also be because most of them run under Windows, which loves MDI
interfaces).


Why can't lazarus has both? 


Since noone took the time to implement this, you're welcome.

Marc



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


Re: [lazarus] Editor issues

2007-09-11 Thread Lepidosteus
To the various answers here and there:
- about code templates: I got used to it in various editors (namely
visual studio and eclipse), some people may not like it and don't want
it to be on per default, but for someone coming from thse editors it
definetly looks like something is missing. (it should do things after
i write begin and press enter yes).

- smart tabs help a bit but then indent are of 8 per default instead
of 5, and I can't find a way to change that. This is too much. And
there is still some strange behaviour sometimes after realoding a doc
(I couldn't find a reproducable one easily sorry).

Again for code template I'm not saying you _have_ to implement it,
just that I miss it, but I can live with that. Tabs issues on the
other hand definetely kills the fun of coding.

Thanks for for everyone answers
-- 
Vianney Devreese - Lepidosteus
http://lepidosteus.com

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


RE: [lazarus] GTK Rotated text

2007-09-11 Thread Hess, Philip J
Luis,

Great work! A good test of a widgetset's rotated text is the ported
Orpheus rotated label control, TOvcRLbl. It works with Win32, Carbon and
Qt, so having GTK2 would be wonderful!

There's a link on the Lazarus CCR wiki, but it appears to be down at the
moment. You can also get the source from here:

http://web.fastermac.net/~MacPgmr/OrphPort/OrphStatus.html

Or here: 

https://lazarus-ccr.svn.sourceforge.net/svnroot/lazarus-ccr/components/o
rpheus

Thanks.

-Phil


-Original Message-
From: Luis Rodrigues [mailto:[EMAIL PROTECTED] 
Sent: Monday, September 10, 2007 1:39 PM
To: lazarus@miraclec.com
Subject: Re: [lazarus] GTK Rotated text

Hi,

Over the last weekend I've implemented text rotate in GTK2. I've
implemented it in Gtk2WidgetSet.ExtTextOut. Since there is no way to
define that the font is rotated, TGtk2WidgetSet.CreateFontIndirectEx ..
lfEscapement can only be used to place the angle  somewhere to
ExtTextOut to use.

The used functions (with gtk/pango version)
pango_matrix_rotate -  gtk2.6 
pango_matrix_translate - gtk2.6
pango_context_set_matrix - gtk2.6
pango_renderer_draw_layout - pango1.8

gdk_pango_renderer_get_default - gtk2.6
gdk_pango_renderer_set_drawable - gtk2.6
gdk_pango_renderer_set_gc - gtk2.6

gtk2.6 and pango1.8 where released in Dec 2004 so I guess i can be
implemented with no problems :)


I've defined in Gtk2int.pas

   TPangoMatrix = record
 xx: double;
 xy: double;
 yx: double;
 yy: double;
 x0: double;
 y0: double;
   end;
   PTPangoMatrix = ^TPangoMatrix;
   PPangoRenderer = pointer;
   PGdkPangoRenderer = pointer;

procedure pango_font_description_set_gravity
(desc:PPangoFontDescription;gravity:TPangoGravity); cdecl; external
'libpango-1.0.so.0';
procedure pango_matrix_rotate(matrix: PPangoMatrix; degrees: double);
cdecl; external 'libpango-1.0.so.0';
procedure pango_matrix_translate(matrix: PPangoMatrix; tx, ty: double);
cdecl; external 'libpango-1.0.so.0';
procedure pango_matrix_scale (matrix: PPangoMatrix; scale_x, scale_y:
double);  cdecl; external 'libpango-1.0.so.0';
procedure pango_context_set_matrix(context: PPangoContext; matrix:
PPangoMatrix); cdecl; external 'libpango-1.0.so.0';
procedure pango_renderer_draw_layout (renderer: PPangoRenderer; layout:
PPangoLayout; x,y: Integer);  cdecl; external 'libpango-1.0.so.0';

function  gdk_pango_renderer_get_default (screen: PGdkScreen):
PPangoRenderer; cdecl; external 'libgtk-x11-2.0.so';
procedure gdk_pango_renderer_set_drawable (gdk_renderer:
PGdkPangoRenderer;  drawable: PGdkDrawable); cdecl; external
'libgtk-x11-2.0.so';
procedure gdk_pango_renderer_set_gc (gdk_renderer: PGdkPangoRenderer;
gc: PGdkGC); cdecl; external 'libgtk-x11-2.0.so';


and changed gtkwinapi.inc


  procedure DoTextOut(X,Y : Integer; Str: Pchar; CurCount: Integer);
  var
DevCtx: TDeviceContext;
CurScreenX: LongInt;
CharLen: LongInt;

WidgetCont: PPangoContext;
matrix: TPangoMatrix;
renderer: PPangoRenderer;
screen: PGdkScreen;
gc: PGdkGc;
  begin
DevCtx:=TDeviceContext(DC);
if (Dxnil) then begin
  CurScreenX:=X;
  while CurCount0 do begin
CharLen:=UTF8CharacterLength(CurStr);
//gdk_draw_glyphs(DevCtx.drawable,DevCtx.gc );
pango_layout_set_text(UseFont, CurStr, CharLen);
gdk_draw_layout_with_colors(DevCtx.drawable, DevCtx.GC,
CurScreenX, Y,
UseFont, Foreground, nil);
 
//gdk_draw_rectangle(DevCtx.Drawable,DevCtx.GC,1,CurScreenX,Y,3,3);
inc(CurScreenX,CurDx^);
inc(CurDx);
inc(CurStr,CharLen);
dec(CurCount,CharLen);
  end;
end else begin //just changed this branch
  pango_layout_set_text(UseFont, Str, Count);
  
  renderer :=
gdk_pango_renderer_get_default( gtk_widget_get_screen(DevCtx.DCWidget)
);
  gdk_pango_renderer_set_drawable ( renderer, DevCtx.drawable);
  gdk_pango_renderer_set_gc ( renderer, DevCtx.GC);
  
  WidgetCont := pango_layout_get_context(UseFont);
  matrix.xx := 1.0;
  matrix.xy := 0.0;
  matrix.yx := 0.0;
  matrix.yy := 1.0;
  matrix.x0 := 0.0;
  matrix.y0 := 0.0;
  pango_matrix_translate (@matrix, X, Y);
  pango_matrix_rotate (@matrix, 285); //--this is the angle
  
  pango_context_set_matrix (WidgetCont, @matrix);
  pango_layout_context_changed (UseFont);

  pango_renderer_draw_layout (renderer, UseFont, X, Y);
  
  gdk_pango_renderer_set_drawable ( renderer, nil);
  gdk_pango_renderer_set_gc ( renderer, nil);
end;
  end;

I could have done a patch but this code is just a proof of concept and
needs to be integrated in the correct files (with I don't know with they
are). So now we can have text rotate in Gtk2 also :) 


regards,

Luis


On Wed, 2007-09-05 at 11:43 +0200, Mattias Gaertner wrote:
 On Tue, 04 Sep 2007 21:31:07 +0100
 Luis Rodrigues [EMAIL PROTECTED] wrote:
 
  Hello,
  
  I was going to implement rotating text on GTK2 but just noticed that

[lazarus] last svn version for use with fpc 2.0.4

2007-09-11 Thread Marc Santhoff
Hi,

as the subject says, what is the last compilable and flawlessly working
svn version of lazarus for use with fpc 2.0.4?

TIA,
Marc


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


Re: [lazarus] IDE, start once, open files

2007-09-11 Thread Luiz Americo Pereira Camara

Luca Olivetti wrote:

En/na Mattias Gärtner ha escrit:
Is there already a cross platform component for applications to check 
if it is
already running and if yes then pass some commands to the already 
application?


For example clicking on files in the file browser should not open a 
second

instance, but tell the already running instance to open the files.


There's uniqueinstance
http://sourceforge.net/project/shownotes.php?group_id=92177release_id=471823 

(The wiki is down, so I cannot give you the wiki link) *but* it 
doesn't work here under Linux (I could launch more that one instance 
of my program).
Since I hadn't too much time to debug it, I slightly modified it to 
open and lock a file instead of using TSimpleIpc, but that makes it 
non-crossplatform.
Since it's short I'm including it here, it could be extended to write 
the pid in the file, so another instance can somewhat contact the 
first one.


It's working here both under win32 and linux (testraw and testcomponent 
programs). Using fpc 220, Ubuntu Feisty Faw, recent lazarus svn.


The only missing feature under linux is the parameter list passing:
Under windows the SimpleIpc mechanism is integrated with the win32 
message loop so the IPCServer.OnMessage is called without any further 
intervention.
Under unix, SimpleIpc is not integrated with any message loop so 
IPCServer.OnMessage is not called.

There are to ways of doing under unix:
 - Hook in the LCL message loop to call PeakMessage
 - Create a thread that will call PeakMessage at a time interval

In the below address you will find an updated component that hooks in 
Application.OnIdle to call PeakMessage. Its far from optimal because 
will prevent the use of OnIdle by the programmer and the parameter list 
will be peaked only when the app is idle/has focus.


https://svn.bountysource.com/luipack/trunk/uniqueinstance

If someone knows a way to hook in LCL message loop to be called more 
frequently than OnIdle or wants to implement a separeted thread i'm 
accepting patches.


Luiz

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


[lazarus] Another icons for Lazarus

2007-09-11 Thread wile64
See the sujet !


Regard,

-- 
Laurent.

My Web : http://wile64.neuf.fr/
French Forum : http://lazforum-fr.tuxfamily.org/index.php
attachment: menu_abort_build.pngattachment: menu_build_fast.pngattachment: menu_build_file.pngattachment: menu_run_caret.pngattachment: menu_run_file.png

Re: [lazarus] Editor issues

2007-09-11 Thread Graeme Geldenhuys
On 11/09/2007, Lepidosteus [EMAIL PROTECTED] wrote:

 - smart tabs help a bit but then indent are of 8 per default instead
 of 5, and I can't find a way to change that. This is too much. And
 there is still some strange behaviour sometimes after realoding a doc
 (I couldn't find a reproducable one easily sorry).


If you mean you can't find a place to change this in the editor
settings, resize the dialog vertically.  I found the same issue in the
beginning and didn't know the tab setting was hidden (off screen).

Graeme.

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


Re: [lazarus] Another icons for Lazarus

2007-09-11 Thread Joost van der Sluis
Well... if you have time, do you also allow requests?

The icons of the sqldb-components aren't really beautiful. And the
components in the fp-web-package (lazarus/components/fp-web) are
non-existent... ;)


Joost

Op dinsdag 11-09-2007 om 16:43 uur [tijdzone +0200], schreef wile64:
 See the sujet !
 
 
 Regard,
 
 -- 
 Laurent.
 
 My Web : http://wile64.neuf.fr/
 French Forum : http://lazforum-fr.tuxfamily.org/index.php
-- 

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


Re: [lazarus] Lazarus on one window (aka SDI)

2007-09-11 Thread Víctor R. Ruiz
  Hi:

  I've been talking with Jesus on the IRC about my next steps on this
feature. Of course, a switch in the configuration between docked and
undocked windows is a must. He suggested me to survey the main
developers before doing more work. Right now the modified IDE works
mostly as I wanted (as in eat your own dog food ;) but , is there
any chance the patches could be integrated with futher work? And if
so, which are the main requirements? Thanks.

  Greetings,

-- 
Víctor R. Ruiz [EMAIL PROTECTED] | - Todos estos momentos se perderán
http://rvr.blogalia.com/   |   como lágrimas en la lluvia

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


Re: [lazarus] GTK Rotated text

2007-09-11 Thread Luis Rodrigues
On Tue, 2007-09-11 at 11:38 +0200, Marc Weustink wrote:
 Luis Rodrigues wrote:
  Hi,
  
  Over the last weekend I've implemented text rotate in GTK2. I've
  implemented it in Gtk2WidgetSet.ExtTextOut. Since there is no way to
  define that the font is rotated, TGtk2WidgetSet.CreateFontIndirectEx ..
  lfEscapement can only be used to place the angle  somewhere to
  ExtTextOut to use.
  
  The used functions (with gtk/pango version)
  pango_matrix_rotate -  gtk2.6 
  pango_matrix_translate - gtk2.6
  pango_context_set_matrix - gtk2.6
  pango_renderer_draw_layout - pango1.8
  
  gdk_pango_renderer_get_default - gtk2.6
  gdk_pango_renderer_set_drawable - gtk2.6
  gdk_pango_renderer_set_gc - gtk2.6
  
  gtk2.6 and pango1.8 where released in Dec 2004 so I guess i can be
  implemented with no problems :)
 
 IIRC we already use some 2.6 funtions.

According to gtk.org bindings page only gtk.2.4 is supported in pascal.

Who can add this gtk2.6 functions to the bindings, should I make a patch
against the version with is on fpc?

How can the angle info be integrated into the lcl?

Regards,

Luís



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


Re: [lazarus] IDE, start once, open files

2007-09-11 Thread Luca Olivetti

En/na Luiz Americo Pereira Camara ha escrit:

It's working here both under win32 and linux (testraw and testcomponent 
programs). Using fpc 220, Ubuntu Feisty Faw, recent lazarus svn.


I assure you that I could lauch various copies of my program. I used fpc 
2.0.4, maybe that's the problem. I only used uniqueinstanceraw, since 
it's a daemon, not a gui app.


Bye
--
Luca

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


Re: [lazarus] IDE, start once, open files

2007-09-11 Thread Luiz Americo Pereira Camara

Luca Olivetti wrote:

En/na Luiz Americo Pereira Camara ha escrit:

It's working here both under win32 and linux (testraw and 
testcomponent programs). Using fpc 220, Ubuntu Feisty Faw, recent 
lazarus svn.


I assure you that I could lauch various copies of my program. I used 
fpc 2.0.4, maybe that's the problem. I only used uniqueinstanceraw, 
since it's a daemon, not a gui app.


Did you tested the testraw program that comes bundled with the package? 
Although it uses a Lazarus app, the pattern usage can be transported to 
a non gui app straightforward.


Luiz


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


Re: [lazarus] FPC 2.2 article made it onto OSNews.com

2007-09-11 Thread ik
On 9/11/07, Giuliano Colla [EMAIL PROTECTED] wrote:
 ik ha scritto:

 On 9/11/07, Graeme Geldenhuys [EMAIL PROTECTED] wrote:
 
 
 Nicely done Joost!
 
 http://www4.osnews.com/story/18592/Cross-Platform_Development_with_Free_Pascal_2.2.0
 
 ... or a shorter link:   http://tinyurl.com/ywzyvr
 
 
 
 I have translated the article to Hebrew, if there are anyone that interested 
 :)
 http://idkn.blogli.co.il/archives/69
 
 
 
 I was interested, but I could make out only yet another blog in
 blogli, then I got lost

That's the most important text ;)

 Maybe I need to refresh my hebrew a bit. :-)
I'm willing to help you :)
Your Hebrew is better then my Italian :)

 In any case, happy new year!

Thank you, Happy new year to you and to everyone :)


 Giuliano

Ido


 --
 Giuliano Colla

 Still using C++ and Visual Studio? I'm using Object Pascal and Lazarus.


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



-- 
http://ik.homelinux.org/

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


Re: [lazarus] Lazarus on one window (aka SDI)

2007-09-11 Thread Den Jean
On Tuesday 11 September 2007 07:47:03 Víctor R. Ruiz wrote:
 on my development environments, with little desktop space, working
 with many windows is not a happy experience. I also read some threads

I also prefer everything docked in one window (in Kylix), even on a 24.
This way nothing get partially covered and I can easily re-divide the space
between Object Inspector and Editor (if still necessary on 1920x1200).

when working on forms, I use kde/kwin to let the form stay on 
top of the editor till I am done with the form.

would be nice to see this in lazarus


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


Re: [lazarus] Lazarus on one window (aka SDI)

2007-09-11 Thread A.J. Venter
The single worst thing about the many windows IDE is this:
I am coding, I need to look something up, I'm on my laptop so there
isn't another screen, I open a browser. I want to go back to my code
when I'm done - I have to click 8 or 10 things in the taskbar to get
all the windows to the front.
Usually you can get away with just minimizing the other program - but
when there are 3 or 4...
It is SO bad that I have gotten in the habit of using a dedicated
virtual desktop just for Lazarus. I would definitely be in favor of a
single window design.

A.J.

On 9/11/07, Den Jean [EMAIL PROTECTED] wrote:
 On Tuesday 11 September 2007 07:47:03 Víctor R. Ruiz wrote:
  on my development environments, with little desktop space, working
  with many windows is not a happy experience. I also read some threads

 I also prefer everything docked in one window (in Kylix), even on a 24.
 This way nothing get partially covered and I can easily re-divide the space
 between Object Inspector and Editor (if still necessary on 1920x1200).

 when working on forms, I use kde/kwin to let the form stay on
 top of the editor till I am done with the form.

 would be nice to see this in lazarus


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



-- 
A.J. Venter
Director of Product Development
Tel.: +27 21 554 5059
Fax: +27 21 413 2800
Outkast Solutions IT
www.outkastsolutions.co.za
A division of Global Pact Trading Pty Ltd.

www.silentcoder.co.za - Blog
scartoonz.silentcoder.co.za - ScarToonz webcomic

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


Re: [lazarus] IDE, start once, open files

2007-09-11 Thread Luca Olivetti

En/na Luiz Americo Pereira Camara ha escrit:

Luca Olivetti wrote:

En/na Luiz Americo Pereira Camara ha escrit:

It's working here both under win32 and linux (testraw and 
testcomponent programs). Using fpc 220, Ubuntu Feisty Faw, recent 
lazarus svn.


I assure you that I could lauch various copies of my program. I used 
fpc 2.0.4, maybe that's the problem. I only used uniqueinstanceraw, 
since it's a daemon, not a gui app.


Did you tested the testraw program that comes bundled with the package? 
Although it uses a Lazarus app, the pattern usage can be transported to 
a non gui app straightforward.


Yes, the testraw program works, but my program forks and using your unit 
it allows multiple instances, with mine only one.
Here's a simple program that doesn't work (i.e it allows multiple 
instances) if it forks, but it works if left in the foreground (give it 
the -f parameter).
This is with fpc 2.0.4. Wait a moment...now I tested with 2.2.0 and 
everything works as expected, so it was probably a 2.0.4 thing.


Bye
--
Luca

program test;

{$mode objfpc}{$H+}

uses
  {$IFDEF UNIX}{$IFDEF UseCThreads}
  cthreads,
  {$ENDIF}{$ENDIF}
  Classes, sysutils, strutils, baseunix,
  { add your units here }
  uniqueinstanceraw;

var terminated:boolean;

procedure Init;
var   
  mypid:TPid;
begin
  if InstanceRunning('testprogram') then
  begin
Writeln('Already running!');
Halt(100);
  end;
  if paramstr(1)'-f' then
  begin
mypid:=FpFork;
if mypid0 then
begin
  writeln('fork failed');
  halt(mypid);
end;
if mypid0 then Halt(0); //parent
  end;  
  Close(input);
  Close(stderr);
  Assign(stderr,'/dev/null');
  Rewrite(stderr);
  Close(stdout);
  Assign(stdout,'/dev/null');
  Rewrite(stdout);
end;

procedure CatchSignal(Sig : Longint; Info : PSigInfo; Context : PSigContext);cdecl;
begin
  terminated:=true;
end;

procedure InitSignals;

Var
  old,new : SigactionRec;

begin
  New.sa_handler:[EMAIL PROTECTED];
  fpSigaction(SIGQUIT,@New,@Old);
  fpSigaction(SIGTERM,@New,@Old);
  fpSigaction(SIGINT,@New,@Old);
end;


begin
  Init;
  InitSignals;
  while not terminated do sleep(100);
end.  

Re: [lazarus] GTK Rotated text

2007-09-11 Thread Felipe Monteiro de Carvalho
On 9/11/07, Luis Rodrigues [EMAIL PROTECTED] wrote:
 According to gtk.org bindings page only gtk.2.4 is supported in pascal.

Well, look again =) I sent an e-mail months ago telling them to update
their page, and they finally answered it today, saying it was updated,
and it's indeed updated.

I know that fpc gtk bindings cover at least up to 2.8

-- 
Felipe Monteiro de Carvalho

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


Re: [lazarus] GTK Rotated text

2007-09-11 Thread Luis Rodrigues
On Tue, 2007-09-11 at 20:36 +0200, Felipe Monteiro de Carvalho wrote:
 
 I know that fpc gtk bindings cover at least up to 2.8
 
Where are they?

I could find them defined in FPC/packages/extra/gtk2 or
FPC/packages/extra/gtk1 so I thought they weren't and defined the
functions I needed.


Luís

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


Re: [lazarus] Lazarus on one window (aka SDI)

2007-09-11 Thread Graeme Geldenhuys
On 11/09/2007, A.J. Venter [EMAIL PROTECTED] wrote:
 when I'm done - I have to click 8 or 10 things in the taskbar to get
 all the windows to the front.

That is a very valid point. I haven't noticed it under Linux, because
I use virtual desktops, but it is damn annoying when I switch to
Windows.

 It is SO bad that I have gotten in the habit of using a dedicated
 virtual desktop just for Lazarus. I would definitely be in favor of a
 single window design.

Someone else that thinks like I do. I actually use 4 virtual desktops.
One for Lazarus, Firefox, Mozilla and a spare for things like VMWare.

I guess my assumption was correcty. From all the replies it seems more
people prefer MDI type interfaces. I guess the big IDE products got it
right.  ;)

Regards,
  - Graeme -

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


Re: [lazarus] Lazarus on one window (aka SDI)

2007-09-11 Thread Michael Van Canneyt


On Tue, 11 Sep 2007, Graeme Geldenhuys wrote:

 On 11/09/2007, A.J. Venter [EMAIL PROTECTED] wrote:
  when I'm done - I have to click 8 or 10 things in the taskbar to get
  all the windows to the front.
 
 That is a very valid point. I haven't noticed it under Linux, because
 I use virtual desktops, but it is damn annoying when I switch to
 Windows.
 
  It is SO bad that I have gotten in the habit of using a dedicated
  virtual desktop just for Lazarus. I would definitely be in favor of a
  single window design.
 
 Someone else that thinks like I do. I actually use 4 virtual desktops.
 One for Lazarus, Firefox, Mozilla and a spare for things like VMWare.
 
 I guess my assumption was correcty. From all the replies it seems more
 people prefer MDI type interfaces. I guess the big IDE products got it
 right.  ;)

Not really. The main point is that there should be only 1 window listed
in the task list, and clicking that should simply raise all lazarus windows.

How this is achieved (MDI/SDI) is not really relevant.

The first thing I did when using Delphi 2005 and up was switching back
to the 'old' layout.

Each his preference. It would be best if lazarus offered you the choice
instead of forcing you to use one model or the other.

Open source is all about choice, after all...

Michael.

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


Re: [lazarus] Lazarus on one window (aka SDI)

2007-09-11 Thread Graeme Geldenhuys
On 11/09/2007, Michael Van Canneyt [EMAIL PROTECTED] wrote:

 Each his preference. It would be best if lazarus offered you the choice
 instead of forcing you to use one model or the other.

This would definitely be the best option, but then one question still
remains. If Lazarus supports both MDI and SDI, which one will be the
default?  Do we following all the 'big' IDE's out there and use MDI by
default, or do we continue with the original design using SDI?

PS:
I guess that question only becomes a issue once Lazarus actually
supports both. :)


Graeme.

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


[lazarus] Editor plugins (filters)

2007-09-11 Thread Graeme Geldenhuys
Hi,

I want to try and implement the 'elastic tabstops' in Lazarus. See the
link below for more details on 'elastic tabstops'.

I have a few questions before I start.

1.  Can I extend the editor behavior via a Lazarus addon package?  Or
must I edit the underlying SynEdit component directly. A optional
addon package would be nice as a start, to test the feature before it
(possibly) becomes a default feature. Like what I done with the
Toolbar Editor package.

2.  If it's not possible via a Lazarus addon package, what SynEdit
unit should I be looking at? The Components/SynEdit directory contains
a lot of files - though most seem related to syntax highlighting.

3. Could I hook into the CodeTools API to intercept the tab character
and modify the text buffer like that.  Sometimes I would need to
modify lines before and after the current line being edited.


For more info on what 'elastic tabstops' are:
  http://nickgravgaard.com/elastictabstops/


Regards,
  - Graeme -

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


Re: [lazarus] Lazarus on one window (aka SDI)

2007-09-11 Thread Luiz Americo Pereira Camara

Graeme Geldenhuys wrote:

It is SO bad that I have gotten in the habit of using a dedicated
virtual desktop just for Lazarus. I would definitely be in favor of a
single window design.



Someone else that thinks like I do. I actually use 4 virtual desktops.
One for Lazarus, Firefox, Mozilla and a spare for things like VMWare.
  


We are three. I also use one exclusive virtual desktop for Lazarus.

Luiz

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


[lazarus] Compilation failure

2007-09-11 Thread Stephano
Compiling latest Lazarus SVN (FPC 2.2.0) fails (Lazarus.exe is generated) 
with:
LazarusManager.pas(40,34) Fatal: Can't find unit LRemoteControl used by 
StartLazarus


I can't locate the unit LRemoteControl anywhere. Where should it be?

Stephano 


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


Re: [lazarus] Lazarus on one window (aka SDI)

2007-09-11 Thread Mario R. Carro
On Tuesday 11 September 2007, Víctor R. Ruiz wrote:
   Hi:

   I know some programmers prefer Lazarus IDE the way it is. However,
 on my development environments, with little desktop space, working
 with many windows is not a happy experience. I also read some threads
 on the web forum requesting workspace integration, so I started
 digging in the Lazarus code. Thanks to Mattias' fix to the Notebook
 change of parent, I could get a working version of Lazarus on (almost)
 one window: http://farm2.static.flickr.com/1012/1358706622_0ab97e91ef_o.png

I really like it! One of the things I always disliked from Delphi was that it 
wasn't SDI (at least not up to v7, and never used the newer ones). Lazarus 
made it even worser by showing separately each window it opened in the 
taskbar, as if, for example, I could be interested in restoring the object 
inspector alone but leave the rest minimized, and also cluttering the taskbar 
to the point to make it unusable (unless perhaps you group the icons, wich I 
never do, so probably that's only my problem). I ended dedicating a virtual 
desktop to Lazarus alone so I never need to minimize it and it doesn't matter 
how much it clutters the taskbar... Also it doesn't minimize neither restore 
too gracefully, frequently many clicks are necessary to take every window to 
the desired state.

Added to that, I never overlap none of the windows of the IDE, so having 
windows that can overlap is more of an inconvenience that anything else, and 
I end up with a rather messed layout where no window is in the place it was 
previously, so I need to hunt them around... 

I hope this ends up in SVN!

Uff! That was cathartic... 

Thanks!
Mario

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


Re: [lazarus] IDE, start once, open files

2007-09-11 Thread Mattias Gaertner
On Tue, 11 Sep 2007 11:29:38 -0300
Luiz Americo Pereira Camara [EMAIL PROTECTED] wrote:

 Luca Olivetti wrote:
  En/na Mattias Gärtner ha escrit:
  Is there already a cross platform component for applications to
  check if it is
  already running and if yes then pass some commands to the already 
  application?
 
  For example clicking on files in the file browser should not open
  a second
  instance, but tell the already running instance to open the files.
 
  There's uniqueinstance
  http://sourceforge.net/project/shownotes.php?group_id=92177release_id=471823
   
 
  (The wiki is down, so I cannot give you the wiki link) *but* it 
  doesn't work here under Linux (I could launch more that one
  instance of my program).
  Since I hadn't too much time to debug it, I slightly modified it to 
  open and lock a file instead of using TSimpleIpc, but that makes it 
  non-crossplatform.
  Since it's short I'm including it here, it could be extended to
  write the pid in the file, so another instance can somewhat contact
  the first one.
 
 It's working here both under win32 and linux (testraw and
 testcomponent programs). Using fpc 220, Ubuntu Feisty Faw, recent
 lazarus svn.
 
 The only missing feature under linux is the parameter list passing:
 Under windows the SimpleIpc mechanism is integrated with the win32 
 message loop so the IPCServer.OnMessage is called without any further 
 intervention.
 Under unix, SimpleIpc is not integrated with any message loop so 
 IPCServer.OnMessage is not called.
 There are to ways of doing under unix:
   - Hook in the LCL message loop to call PeakMessage
   - Create a thread that will call PeakMessage at a time interval
 
 In the below address you will find an updated component that hooks in 
 Application.OnIdle to call PeakMessage. Its far from optimal because 
 will prevent the use of OnIdle by the programmer and the parameter
 list will be peaked only when the app is idle/has focus.

Then use Application.AddOnIdleHandler instead.

 
 https://svn.bountysource.com/luipack/trunk/uniqueinstance
 
 If someone knows a way to hook in LCL message loop to be called more 
 frequently than OnIdle or wants to implement a separeted thread i'm 
 accepting patches.

Contrary to windows there are far less messages under linux/gtk so the
OnIdle is not called for long periods, when you work in another program.
Unless you start a TTimer.


Mattias

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


Re: [lazarus] Compilation failure

2007-09-11 Thread Mattias Gaertner
On Wed, 12 Sep 2007 01:10:40 +0300
Stephano [EMAIL PROTECTED] wrote:

 Compiling latest Lazarus SVN (FPC 2.2.0) fails (Lazarus.exe is
 generated) with:
 LazarusManager.pas(40,34) Fatal: Can't find unit LRemoteControl used
 by StartLazarus
 
 I can't locate the unit LRemoteControl anywhere. Where should it be?

Fixed.

Mattias

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


Re: [lazarus] Editor plugins (filters)

2007-09-11 Thread Mattias Gaertner
On Tue, 11 Sep 2007 23:35:46 +0200
Graeme Geldenhuys [EMAIL PROTECTED] wrote:

 Hi,
 
 I want to try and implement the 'elastic tabstops' in Lazarus. See the
 link below for more details on 'elastic tabstops'.
 
 I have a few questions before I start.
 
 1.  Can I extend the editor behavior via a Lazarus addon package?  Or
 must I edit the underlying SynEdit component directly. A optional
 addon package would be nice as a start, to test the feature before it
 (possibly) becomes a default feature. Like what I done with the
 Toolbar Editor package.

Almost all the TabStops code is in synedit.pp. The IDEIntf lacks the
ability to override this behaviour.

 
 2.  If it's not possible via a Lazarus addon package, what SynEdit
 unit should I be looking at? The Components/SynEdit directory contains
 a lot of files - though most seem related to syntax highlighting.
 
 3. Could I hook into the CodeTools API to intercept the tab character
 and modify the text buffer like that.  Sometimes I would need to
 modify lines before and after the current line being edited.

The codetools do not much yet with tabs.
Maybe when the simple beautifier is replaced with a real beautifier.


 For more info on what 'elastic tabstops' are:
   http://nickgravgaard.com/elastictabstops/


Mattias

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


Re: [lazarus] Another icons for Lazarus

2007-09-11 Thread Павел Ишенин

wile64 пишет:

See the sujet !

They are great (and cool acording to irc channel).

But 3 things:
1. They should be in png (so previous xpm are not needed)
2. They must be 16*16
3. Toolbar images that have disabled state will not be changed before 
implementing of auto disabled drawing. So I will add them to repository, 
but without switching to them.


Best regards,
Paul Ishenin.

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


Re: [lazarus] Editor issues

2007-09-11 Thread Mattias Gaertner
On Tue, 11 Sep 2007 14:04:50 +0200 (CEST)
[EMAIL PROTECTED] wrote:

  On 11/09/2007, Michael Van Canneyt [EMAIL PROTECTED] wrote:
 
  My Delphi 7 definitely doesn't do the described behaviour by
  default; Only
  if I press ctrl-j after the begin.
 
  (Nor would I want it to do this automatically)
 
  As far as I know that code template / code completion feature was
  introduced in Delphi 2005 onwards.  Delphi 7 and earlier used Ctrl+J
  like Lazarus does.
 
 
 Invoking code completion with enter is also the way that vb works.

(IMHO the vb is an example how a source completion function should *not*
work, although I understand why MS did it in this case)

Code templates can now be invoked on Enter and/or Space (see the Code
Template options).
I tried the begin+Enter template example and find it very annoying.
To insert a new line I often use End+Enter. If the 'begin' is the last
word, it now misunderstands it as template.
It would be better to write a small macro function, that checks if an
'end' is missing and adds it only if needed.

The ;=+Space to := works nice. Maybe I will add this template to the
defaults.


Mattias

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


Re: [lazarus] GTK Rotated text

2007-09-11 Thread Luis Rodrigues
Here is the patch to enable font rotation on gtk2. The angle used is the
one defined in createfontindirect.

Someone still needs to implement the necessary functions in the gtk
bindings.

Luis

On Mon, 2007-09-10 at 18:39 +0100, Luis Rodrigues wrote:
 Hi,
 
 Over the last weekend I've implemented text rotate in GTK2. I've
 implemented it in Gtk2WidgetSet.ExtTextOut. Since there is no way to
 define that the font is rotated, TGtk2WidgetSet.CreateFontIndirectEx ..
 lfEscapement can only be used to place the angle  somewhere to
 ExtTextOut to use.
 
 The used functions (with gtk/pango version)
 pango_matrix_rotate -  gtk2.6 
 pango_matrix_translate - gtk2.6
 pango_context_set_matrix - gtk2.6
 pango_renderer_draw_layout - pango1.8
 
 gdk_pango_renderer_get_default - gtk2.6
 gdk_pango_renderer_set_drawable - gtk2.6
 gdk_pango_renderer_set_gc - gtk2.6
 
 gtk2.6 and pango1.8 where released in Dec 2004 so I guess i can be
 implemented with no problems :)
 
 
 I've defined in Gtk2int.pas
 
TPangoMatrix = record
  xx: double;
  xy: double;
  yx: double;
  yy: double;
  x0: double;
  y0: double;
end;
PTPangoMatrix = ^TPangoMatrix;
PPangoRenderer = pointer;
PGdkPangoRenderer = pointer;
 
 procedure pango_font_description_set_gravity
 (desc:PPangoFontDescription;gravity:TPangoGravity); cdecl; external
 'libpango-1.0.so.0';
 procedure pango_matrix_rotate(matrix: PPangoMatrix; degrees: double);
 cdecl; external 'libpango-1.0.so.0';
 procedure pango_matrix_translate(matrix: PPangoMatrix; tx, ty: double);
 cdecl; external 'libpango-1.0.so.0';
 procedure pango_matrix_scale (matrix: PPangoMatrix; scale_x, scale_y:
 double);  cdecl; external 'libpango-1.0.so.0';
 procedure pango_context_set_matrix(context: PPangoContext; matrix:
 PPangoMatrix); cdecl; external 'libpango-1.0.so.0';
 procedure pango_renderer_draw_layout (renderer: PPangoRenderer; layout:
 PPangoLayout; x,y: Integer);  cdecl; external 'libpango-1.0.so.0';
 
 function  gdk_pango_renderer_get_default (screen: PGdkScreen):
 PPangoRenderer; cdecl; external 'libgtk-x11-2.0.so';
 procedure gdk_pango_renderer_set_drawable (gdk_renderer:
 PGdkPangoRenderer;  drawable: PGdkDrawable); cdecl; external
 'libgtk-x11-2.0.so';
 procedure gdk_pango_renderer_set_gc (gdk_renderer: PGdkPangoRenderer;
 gc: PGdkGC); cdecl; external 'libgtk-x11-2.0.so';
 
 
 and changed gtkwinapi.inc
 
 
   procedure DoTextOut(X,Y : Integer; Str: Pchar; CurCount: Integer);
   var
 DevCtx: TDeviceContext;
 CurScreenX: LongInt;
 CharLen: LongInt;
 
 WidgetCont: PPangoContext;
 matrix: TPangoMatrix;
 renderer: PPangoRenderer;
 screen: PGdkScreen;
 gc: PGdkGc;
   begin
 DevCtx:=TDeviceContext(DC);
 if (Dxnil) then begin
   CurScreenX:=X;
   while CurCount0 do begin
 CharLen:=UTF8CharacterLength(CurStr);
 //gdk_draw_glyphs(DevCtx.drawable,DevCtx.gc );
 pango_layout_set_text(UseFont, CurStr, CharLen);
 gdk_draw_layout_with_colors(DevCtx.drawable, DevCtx.GC,
 CurScreenX, Y,
 UseFont, Foreground, nil);
 //gdk_draw_rectangle(DevCtx.Drawable,DevCtx.GC,1,CurScreenX,Y,3,3);
 inc(CurScreenX,CurDx^);
 inc(CurDx);
 inc(CurStr,CharLen);
 dec(CurCount,CharLen);
   end;
 end else begin //just changed this branch
   pango_layout_set_text(UseFont, Str, Count);
   
   renderer :=
 gdk_pango_renderer_get_default( gtk_widget_get_screen(DevCtx.DCWidget) );
   gdk_pango_renderer_set_drawable ( renderer, DevCtx.drawable);
   gdk_pango_renderer_set_gc ( renderer, DevCtx.GC);
   
   WidgetCont := pango_layout_get_context(UseFont);
   matrix.xx := 1.0;
   matrix.xy := 0.0;
   matrix.yx := 0.0;
   matrix.yy := 1.0;
   matrix.x0 := 0.0;
   matrix.y0 := 0.0;
   pango_matrix_translate (@matrix, X, Y);
   pango_matrix_rotate (@matrix, 285); //--this is the angle
   
   pango_context_set_matrix (WidgetCont, @matrix);
   pango_layout_context_changed (UseFont);
 
   pango_renderer_draw_layout (renderer, UseFont, X, Y);
   
   gdk_pango_renderer_set_drawable ( renderer, nil);
   gdk_pango_renderer_set_gc ( renderer, nil);
 end;
   end;
 
 I could have done a patch but this code is just a proof of concept and
 needs to be integrated in the correct files (with I don't know with they
 are). So now we can have text rotate in Gtk2 also :) 
 
 
 regards,
 
 Luis
 
 
 On Wed, 2007-09-05 at 11:43 +0200, Mattias Gaertner wrote:
  On Tue, 04 Sep 2007 21:31:07 +0100
  Luis Rodrigues [EMAIL PROTECTED] wrote:
  
   Hello,
   
   I was going to implement rotating text on GTK2 but just noticed that
   pango_font_description_set_gravity, PangoGravity, etc are not defined
   on FreePascal Pango bindings.
   
   I tried to find on GTK website and on FPC
   (http://www.freepascal.org/packages/gtk.html) but had no luke :(
   
   Is anyone actively working on that?
  

Re: [lazarus] GTK Rotated text

2007-09-11 Thread Luis Rodrigues
Too much sleep made me send the wrong patch. Sorry.

I don't know how the change in drawing function affects the rest of the
lcl code, but it should work with no probs.

Luis


On Wed, 2007-09-12 at 04:47 +0100, Luis Rodrigues wrote:
 Here is the patch to enable font rotation on gtk2. The angle used is the
 one defined in createfontindirect.
 
 Someone still needs to implement the necessary functions in the gtk
 bindings.
 
 Luis
 
 On Mon, 2007-09-10 at 18:39 +0100, Luis Rodrigues wrote:
  Hi,
  
  Over the last weekend I've implemented text rotate in GTK2. I've
  implemented it in Gtk2WidgetSet.ExtTextOut. Since there is no way to
  define that the font is rotated, TGtk2WidgetSet.CreateFontIndirectEx ..
  lfEscapement can only be used to place the angle  somewhere to
  ExtTextOut to use.
  
  The used functions (with gtk/pango version)
  pango_matrix_rotate -  gtk2.6 
  pango_matrix_translate - gtk2.6
  pango_context_set_matrix - gtk2.6
  pango_renderer_draw_layout - pango1.8
  
  gdk_pango_renderer_get_default - gtk2.6
  gdk_pango_renderer_set_drawable - gtk2.6
  gdk_pango_renderer_set_gc - gtk2.6
  
  gtk2.6 and pango1.8 where released in Dec 2004 so I guess i can be
  implemented with no problems :)
  
  
  I've defined in Gtk2int.pas
  
 TPangoMatrix = record
   xx: double;
   xy: double;
   yx: double;
   yy: double;
   x0: double;
   y0: double;
 end;
 PTPangoMatrix = ^TPangoMatrix;
 PPangoRenderer = pointer;
 PGdkPangoRenderer = pointer;
  
  procedure pango_font_description_set_gravity
  (desc:PPangoFontDescription;gravity:TPangoGravity); cdecl; external
  'libpango-1.0.so.0';
  procedure pango_matrix_rotate(matrix: PPangoMatrix; degrees: double);
  cdecl; external 'libpango-1.0.so.0';
  procedure pango_matrix_translate(matrix: PPangoMatrix; tx, ty: double);
  cdecl; external 'libpango-1.0.so.0';
  procedure pango_matrix_scale (matrix: PPangoMatrix; scale_x, scale_y:
  double);  cdecl; external 'libpango-1.0.so.0';
  procedure pango_context_set_matrix(context: PPangoContext; matrix:
  PPangoMatrix); cdecl; external 'libpango-1.0.so.0';
  procedure pango_renderer_draw_layout (renderer: PPangoRenderer; layout:
  PPangoLayout; x,y: Integer);  cdecl; external 'libpango-1.0.so.0';
  
  function  gdk_pango_renderer_get_default (screen: PGdkScreen):
  PPangoRenderer; cdecl; external 'libgtk-x11-2.0.so';
  procedure gdk_pango_renderer_set_drawable (gdk_renderer:
  PGdkPangoRenderer;  drawable: PGdkDrawable); cdecl; external
  'libgtk-x11-2.0.so';
  procedure gdk_pango_renderer_set_gc (gdk_renderer: PGdkPangoRenderer;
  gc: PGdkGC); cdecl; external 'libgtk-x11-2.0.so';
  
  
  and changed gtkwinapi.inc
  
  
procedure DoTextOut(X,Y : Integer; Str: Pchar; CurCount: Integer);
var
  DevCtx: TDeviceContext;
  CurScreenX: LongInt;
  CharLen: LongInt;
  
  WidgetCont: PPangoContext;
  matrix: TPangoMatrix;
  renderer: PPangoRenderer;
  screen: PGdkScreen;
  gc: PGdkGc;
begin
  DevCtx:=TDeviceContext(DC);
  if (Dxnil) then begin
CurScreenX:=X;
while CurCount0 do begin
  CharLen:=UTF8CharacterLength(CurStr);
  //gdk_draw_glyphs(DevCtx.drawable,DevCtx.gc );
  pango_layout_set_text(UseFont, CurStr, CharLen);
  gdk_draw_layout_with_colors(DevCtx.drawable, DevCtx.GC,
  CurScreenX, Y,
  UseFont, Foreground, nil);
  //gdk_draw_rectangle(DevCtx.Drawable,DevCtx.GC,1,CurScreenX,Y,3,3);
  inc(CurScreenX,CurDx^);
  inc(CurDx);
  inc(CurStr,CharLen);
  dec(CurCount,CharLen);
end;
  end else begin //just changed this branch
pango_layout_set_text(UseFont, Str, Count);

renderer :=
  gdk_pango_renderer_get_default( gtk_widget_get_screen(DevCtx.DCWidget) );
gdk_pango_renderer_set_drawable ( renderer, DevCtx.drawable);
gdk_pango_renderer_set_gc ( renderer, DevCtx.GC);

WidgetCont := pango_layout_get_context(UseFont);
matrix.xx := 1.0;
matrix.xy := 0.0;
matrix.yx := 0.0;
matrix.yy := 1.0;
matrix.x0 := 0.0;
matrix.y0 := 0.0;
pango_matrix_translate (@matrix, X, Y);
pango_matrix_rotate (@matrix, 285); //--this is the angle

pango_context_set_matrix (WidgetCont, @matrix);
pango_layout_context_changed (UseFont);
  
pango_renderer_draw_layout (renderer, UseFont, X, Y);

gdk_pango_renderer_set_drawable ( renderer, nil);
gdk_pango_renderer_set_gc ( renderer, nil);
  end;
end;
  
  I could have done a patch but this code is just a proof of concept and
  needs to be integrated in the correct files (with I don't know with they
  are). So now we can have text rotate in Gtk2 also :) 
  
  
  regards,
  
  Luis
  
  
  On Wed, 2007-09-05 at 11:43 +0200, Mattias Gaertner wrote:
   On Tue, 04 Sep 2007 21:31:07 +0100
   Luis Rodrigues [EMAIL 

Re: Lazarus on one window (aka SDI)

2007-09-11 Thread Víctor R. Ruiz
  Hi:

  In lazarus-svn-r11993-sdi-2.diff.gz I have published some changes to
yesterday code so the window docking is now optional (variable
DockedIDE at main, I will replace this with a proper xml reading).
Next step will be to add support to do a hot swapping.

  Greetings,

-- 
Víctor R. Ruiz [EMAIL PROTECTED] | - Todos estos momentos se perderán
http://rvr.blogalia.com/   |   como lágrimas en la lluvia

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