Re: [lazarus] TListView selection

2006-02-27 Thread Micha Nelissen

George Lober wrote:

Darius Blaszijk wrote:


Maybe the patch is too old ?
  


It's patched against SVN, so I guess not ;)
 
Applying the patch in the lcl directory, the output of 'patch --dry-run 
 listview.diff' under Windows is:


--
|Index: lcl/interfaces/win32/win32wscustomlistview.inc
|===


Try applying from the lazarus directory. The path mentioned starts with 
lcl, so applying within lcl is not going to work. I also usually use 
option -p0 to patch, so it fixes path separators.


Micha

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


[lazarus] Pretty looking TEdit

2006-02-27 Thread A.J. Venter
Hi all,
Probably the most requested feature for tappytux is that the entry line where 
users type answers needs to be bigger (I mean huge) and prettier, using 
something like Comic Sans font at size 32 should do it, but of course lazarus 
provides no means of setting fonts and gtkrc seems to only be able to do it 
globally - not for one widget type only.

Which is why I am thinking that what I would need to do is create a component 
that is canvas drawn and knows how to output text in the font type of your 
choosing, in fact I think textout to a color-painted region might almost do 
it, however there is a catch, the component HAS to be UTF-8 enabled because 
tappytux is VERY internationalised and UTF is just about the only way to do 
that cleanly.
Now for the most part textout DOES display UTF-8 but the hard bit is input.
I have no idea how UTF-8 is mapped to keycodes, if I know how to handle an 
onkeydown event for a component in such a way as to ensure that the character 
displayed is what was actually TYPED (which includes handling things like Del 
and Backspace right) then my problem is solved. Of course such a component is 
sufficiently generically usefull that I imagine others would bennifit as well 
and as always I will lgpl it.

Any advice on how it should work ? What it should be descended from and how to 
get from input to screen ?

Ciao
A.J.
-- 
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] TListView selection

2006-02-27 Thread Vincent Snijders

[EMAIL PROTECTED] wrote:

George,

This feature does not work under win32. I have attached a patch that
should fix this.



I looked at the patch I don't understand the part in win32wscustomlistview.pas.
You add
  SetProperty(TListView(AWinControl), lvpHideSelection, True);
and then you seem to comment out the implementation of 
TWin32WSCustomListView.SetProperty.


Is that new line actually doing anything?

Vincent

P.S. if you use // to comment blocks more can be read from the patch.

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


Re: [lazarus] transparent forms

2006-02-27 Thread Micha Nelissen

Felipe Monteiro de Carvalho wrote:

What really happens with TransparentColor of TForm is that it takes a
screenshot of the screen, probably before the application is loaded,
so it doesn't appear on the screenshot, and the first thing that
happens on the paint process of the window is paint a portion of the
screenshot.

There is no real window transparency on Windows API. All apps that
don't seam to have a rectangular window acctually work like that.


I think SetWindowRgn makes part of a window transparent (the parts not 
in the region). For example, winamp can do it: have oddly shaped sizes.


Micha

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


Re: [lazarus] Pretty looking TEdit

2006-02-27 Thread A.J. Venter
On Monday 27 February 2006 10:47, Micha Nelissen wrote:
 A.J. Venter wrote:
  Hi all,
  Probably the most requested feature for tappytux is that the entry line
  where users type answers needs to be bigger (I mean huge) and prettier,
  using something like Comic Sans font at size 32 should do it, but of
  course lazarus provides no means of setting fonts and gtkrc seems to only
  be able to do it globally - not for one widget type only.

 Are you sure gtk is really incapable of showing a different font for
 certain widgets ? IIRC Darek implemented Color property for some
 widgets, so I guess fonts should be possible as well. (But I have no gtk
 experience).

 If this is possible, then this is *the* way to go.

I spent about 4 hours last night reading gtkrc howto´s and studying existing 
theme files and thus far I cannot find anything to do this, even then it 
STILL requires an external gtkrc file, I think a component for those cases 
where you do need it would be very usefull, the same way a tstatictext can be 
used instead of a tlabel when you just need output.

A.J.
-- 
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] TListView selection

2006-02-27 Thread George Lober

Micha Nelissen wrote:


George Lober wrote:


Darius Blaszijk wrote:


Maybe the patch is too old ?
  



It's patched against SVN, so I guess not ;)
 


Applying the patch in the lcl directory, the output of 'patch 
--dry-run  listview.diff' under Windows is:


--
|Index: lcl/interfaces/win32/win32wscustomlistview.inc
|===



Try applying from the lazarus directory. The path mentioned starts 
with lcl, so applying within lcl is not going to work. I also usually 
use option -p0 to patch, so it fixes path separators.




Tried doing it from the Lazarus directory but it doesn't work either. 
This is the result under Linux:


[EMAIL PROTECTED] ~/lazarus $ patch --dry-run -p0  listview.diff
patching file lcl/comctrls.pp
Hunk #1 FAILED at 950.
1 out of 1 hunk FAILED -- saving rejects to file lcl/comctrls.pp.rej
patching file lcl/interfaces/win32/win32wscustomlistview.inc
Hunk #1 FAILED at 373.
Hunk #2 FAILED at 577.
Hunk #3 FAILED at 598.
3 out of 3 hunks FAILED -- saving rejects to file 
lcl/interfaces/win32/win32wscustomlistview.inc.rej



George

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


Re: [lazarus] Pretty looking TEdit

2006-02-27 Thread A.J. Venter
On Monday 27 February 2006 11:40, Mattias Gaertner wrote:
 On Mon, 27 Feb 2006 11:15:03 +0200

 A.J. Venter [EMAIL PROTECTED] wrote:
  On Monday 27 February 2006 10:47, Micha Nelissen wrote:
   A.J. Venter wrote:
Hi all,
Probably the most requested feature for tappytux is that the entry
line where users type answers needs to be bigger (I mean huge) and
prettier, using something like Comic Sans font at size 32 should do
it, but of course lazarus provides no means of setting fonts and
gtkrc seems to only be able to do it globally - not for one widget
type only.
  
   Are you sure gtk is really incapable of showing a different font for
   certain widgets ? IIRC Darek implemented Color property for some
   widgets, so I guess fonts should be possible as well. (But I have no
   gtk experience).
  
   If this is possible, then this is *the* way to go.
 
  I spent about 4 hours last night reading gtkrc howto´s and studying
  existing  theme files and thus far I cannot find anything to do this,
  even then it  STILL requires an external gtkrc file, I think a component
  for those cases  where you do need it would be very usefull, the same way
  a tstatictext can be  used instead of a tlabel when you just need output.

 I just tried under linux/gtk1: Setting a TEdit font size to 30 gave a a
 huge font.

Then this may be the right way, although I am using GTK2 here (I need the 
pango UTF support), and gtk_rc_parse will allow me to force a specific theme 
file. 
How exactly does your line look ? Any idea how I need ot change it to use 
GTK2 ? Or did you do this in code ?

A.J.
-- 
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


[lazarus] PNG support

2006-02-27 Thread Graeme Geldenhuys
Hi,

I see lazarus can read and display png file.  However, Lazarus doesn't
seem to support the blending effect that png files support.  By
blending I mean the shadow in a png file, etc...
Is there a packages or unit I can load to give me that support?  I see
FPC has a libPNG package, but not sure how to use it yet.

Regards,
  - Graeme -

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


Re: [lazarus] TListView selection

2006-02-27 Thread George Lober

George Lober wrote:


Micha Nelissen wrote:


George Lober wrote:


Darius Blaszijk wrote:


Maybe the patch is too old ?
  




It's patched against SVN, so I guess not ;)
 



Applying the patch in the lcl directory, the output of 'patch 
--dry-run  listview.diff' under Windows is:


--
|Index: lcl/interfaces/win32/win32wscustomlistview.inc
|===




Try applying from the lazarus directory. The path mentioned starts 
with lcl, so applying within lcl is not going to work. I also usually 
use option -p0 to patch, so it fixes path separators.




Tried doing it from the Lazarus directory but it doesn't work either. 
This is the result under Linux:


[EMAIL PROTECTED] ~/lazarus $ patch --dry-run -p0  listview.diff
patching file lcl/comctrls.pp
Hunk #1 FAILED at 950.
1 out of 1 hunk FAILED -- saving rejects to file lcl/comctrls.pp.rej
patching file lcl/interfaces/win32/win32wscustomlistview.inc
Hunk #1 FAILED at 373.
Hunk #2 FAILED at 577.
Hunk #3 FAILED at 598.
3 out of 3 hunks FAILED -- saving rejects to file 
lcl/interfaces/win32/win32wscustomlistview.inc.rej




Micha you are right, under Windows doing it from the Lazarus directory 
does work. The trick was using the -p0 option. A small detail, but I 
think it's something that's worth adding to wiki. Why the patching 
doesn't work in Linux remains a mystery.


George

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


Re: [lazarus] CodeTools - jump to method I loose focus

2006-02-27 Thread Mattias Gaertner
On Mon, 27 Feb 2006 11:36:39 +0200
Graeme Geldenhuys [EMAIL PROTECTED] wrote:

 Hi,
 
 I created a Lazarus addon which shows a list of procedures in a Modal
 dialog (same a GExperts Procedure List).  Everythings seems to work
 fine, except for the editor focus after the jump.
 
 When I call the method below, it jumps to the correct location, and
 the Modal dialog closes, but now I cannot see my cursor in the editor?
  The editor looks like it has focus, but no cursor movement is shown
 when I press the up/down keys or even the Ctrl+up/down keys.
 
 Any ideas how I can resolve this?  If you need the full source, I can
 email it directly.
 
 Some notes on the code below:
 LV = TListView component in Report style
 lItem.SubItems[3] holds the TCodeTreeNode.PosStart integer value
 
 
 
 procedure TProcedureListForm.JumpToSelection;
 var
   lItem: TListItem;
   Caret: TCodeXYPosition;
   NewTopLine: integer;
   CodeBuffer: TCodeBuffer;
   ACodeTool: TCodeTool;
   lStartPos: integer;
 begin
   lItem := LV.Selected;
   if lItem = nil then
 Exit; //==
   if lItem.SubItems[3] = '' then
 Exit; //==
 
   lStartPos := StrToInt(lItem.SubItems[3]);
 
   CodeBuffer := CodeToolBoss.FindFile(MainFilename);
   if CodeBuffer = nil then
 Exit; //==
 
   ACodeTool := nil;
   CodeToolBoss.Explore(CodeBuffer,ACodeTool,false);
   if ACodeTool = nil then
 Exit; //==
 
   if not ACodeTool.CleanPosToCaretAndTopLine(lStartPos, Caret, NewTopLine)
   then
 Exit; //==
 
   LazarusIDE.DoOpenFileAndJumpToPos(Caret.Code.Filename,
 Point(Caret.X, Caret.Y),
   NewTopLine, -1, [ofRegularFile,ofUseCache]);

The form is still modal, so the source editor can not be focused. Move the
above line behind the ShowModal.
Save the needed values in some public properties.


 
   Close;
 end;
 
 
 { method the launches the dialog }
 procedure ExecuteProcedureList(Sender: TObject);
 begin
   with TProcedureListForm.Create(Application) do
 try
   ShowModal;

Add here:

if ShowModal=mrOk then
  LazarusIDE.DoOpenFileAndJumpToPos ...


 finally
   Free;
 end;
 end;

Mattias

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


Re: [lazarus] Pretty looking TEdit

2006-02-27 Thread Mattias Gaertner
On Mon, 27 Feb 2006 12:08:26 +0200
A.J. Venter [EMAIL PROTECTED] wrote:

 On Monday 27 February 2006 11:40, Mattias Gaertner wrote:
  On Mon, 27 Feb 2006 11:15:03 +0200
 
  A.J. Venter [EMAIL PROTECTED] wrote:
   On Monday 27 February 2006 10:47, Micha Nelissen wrote:
A.J. Venter wrote:
 Hi all,
 Probably the most requested feature for tappytux is that the entry
 line where users type answers needs to be bigger (I mean huge) and
 prettier, using something like Comic Sans font at size 32 should
 do it, but of course lazarus provides no means of setting fonts
 and gtkrc seems to only be able to do it globally - not for one
 widget type only.
   
Are you sure gtk is really incapable of showing a different font for
certain widgets ? IIRC Darek implemented Color property for some
widgets, so I guess fonts should be possible as well. (But I have no
gtk experience).
   
If this is possible, then this is *the* way to go.
  
   I spent about 4 hours last night reading gtkrc howto´s and studying
   existing  theme files and thus far I cannot find anything to do this,
   even then it  STILL requires an external gtkrc file, I think a
   component for those cases  where you do need it would be very usefull,
   the same way a tstatictext can be  used instead of a tlabel when you
   just need output.
 
  I just tried under linux/gtk1: Setting a TEdit font size to 30 gave a a
  huge font.
 
 Then this may be the right way, although I am using GTK2 here (I need the 
 pango UTF support), and gtk_rc_parse will allow me to force a specific
 theme  file. 
 How exactly does your line look ? 

As a TEdit with a big font.


 Any idea how I need ot change it to use GTK2 ? Or did you do this in code
 ?

I did it in the designer and it works at runtime with gtk1.
For gtk2:
This needs to be implemented in gtkobject.inc TGtkWidgetSet.SetWidgetFont.


Mattias

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


Re: [lazarus] PNG support

2006-02-27 Thread Mattias Gaertner
On Mon, 27 Feb 2006 12:32:43 +0200
Graeme Geldenhuys [EMAIL PROTECTED] wrote:

 Hi,
 
 I see lazarus can read and display png file.  However, Lazarus doesn't
 seem to support the blending effect that png files support.  By
 blending I mean the shadow in a png file, etc...

If this needs alpha transparency, then I guess, it will be difficult.
fpImage can read the full alpha information, but TBitmap only supports
on/off transparency, so the LCL cuts it off. To get alpha, you have to paint
yourself.


 Is there a packages or unit I can load to give me that support?  I see
 FPC has a libPNG package, but not sure how to use it yet.


Mattias

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


Re: [lazarus] TListView selection

2006-02-27 Thread George Lober

Vincent Snijders wrote:


[EMAIL PROTECTED] wrote:


George,

This feature does not work under win32. I have attached a patch that
should fix this.



I looked at the patch I don't understand the part in 
win32wscustomlistview.pas.

You add
  SetProperty(TListView(AWinControl), lvpHideSelection, True);
and then you seem to comment out the implementation of 
TWin32WSCustomListView.SetProperty.


Is that new line actually doing anything?

Vincent

P.S. if you use // to comment blocks more can be read from the patch.



Darius, I managed to apply your patch but it doesn't do what I need it 
to do. While a grayed out selection remains on the ListViews, it's only 
visual. Logic wise, if for example I have two selected ListViews on a 
form, only one of them will be  Listview.selected  nil, I need both to 
be nil.


George

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


Re: [lazarus] Pretty looking TEdit

2006-02-27 Thread A.J. Venter


  Any idea how I need ot change it to use GTK2 ? Or did you do this in code
  ?

 I did it in the designer and it works at runtime with gtk1.
 For gtk2:
 This needs to be implemented in gtkobject.inc TGtkWidgetSet.SetWidgetFont.

I am studying that file now, thinking off it, my way wouldn´t work anyway, 
without SetWidgetFont there isn´t any real way for a custom component to 
force it´s font either (except perhaps for direct GTK2 calls in which case I 
may as well just do it for the LCL and be done with it).

Not being a GTK guru I am a little lost but mostly understanding what the code 
is meant to be doing and I am fairly certain that (some of) the code in 
PangoDrawText can be used to implement this (since I need it, I am happy to 
try at least), what I do need however is some idea of how it should work, 
where is it defined ? Procedure ? Function (result type) ?

Unfortunately the lazarus-ccr seems to be down (could be my ISP though) so I 
cannot look it up there and I cannot find such a function in the GTK1 file of 
the same name at all. 

I assume it´s specified somewhere else ? Presumably the same place where the 
debugln for setWidgetFont comes from.

Anybody up for helping me ?

A.J.
-- 
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


[lazarus] String functions on non latin text

2006-02-27 Thread Panagiotis Sidiropoulos
Functions such as POS() and COPY(), return strange result when used with
utf8 text.

Forr example, if your try
pos( 'κ',
'άέύίόήώϊϋΐΰαβγδεζηθικλμνξοπρσςτυφχψωΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣςΤΥΦΧΨΩΆΈΎΊΌΉΏΪΫ-' ) you 
will get 1, which is incorrect.

I know this has to do with utf encoding (2 or more bytes per character).

Any ideas?

Panagiotis

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


Re: [lazarus] CodeTools - jump to method I loose focus

2006-02-27 Thread Graeme Geldenhuys
Thanks Mattias.  Thinking about it now, the problem makes sense.  Made
the change and it works perfectly now!

I am very impressed with CodeTools so far!  I have only scratched the
surface of what it can do, but it is brilliant.  Once you get the
basics of how it works and what each class does, it becomes much
easier.  I took me much longer to write this addon for Kylix, than for
Lazarus, thanks to CodeTools, which did most of the work for me.

Regards,
  - Graeme -



On 2/27/06, Mattias Gaertner [EMAIL PROTECTED] wrote:
 On Mon, 27 Feb 2006 11:36:39 +0200
 Graeme Geldenhuys [EMAIL PROTECTED] wrote:

  Hi,
 
  I created a Lazarus addon which shows a list of procedures in a Modal
  dialog (same a GExperts Procedure List).  Everythings seems to work
  fine, except for the editor focus after the jump.
 
  When I call the method below, it jumps to the correct location, and
  the Modal dialog closes, but now I cannot see my cursor in the editor?
   The editor looks like it has focus, but no cursor movement is shown
  when I press the up/down keys or even the Ctrl+up/down keys.
 
  Any ideas how I can resolve this?  If you need the full source, I can
  email it directly.
 
  Some notes on the code below:
  LV = TListView component in Report style
  lItem.SubItems[3] holds the TCodeTreeNode.PosStart integer value
 
 
 
  procedure TProcedureListForm.JumpToSelection;
  var
lItem: TListItem;
Caret: TCodeXYPosition;
NewTopLine: integer;
CodeBuffer: TCodeBuffer;
ACodeTool: TCodeTool;
lStartPos: integer;
  begin
lItem := LV.Selected;
if lItem = nil then
  Exit; //==
if lItem.SubItems[3] = '' then
  Exit; //==
 
lStartPos := StrToInt(lItem.SubItems[3]);
 
CodeBuffer := CodeToolBoss.FindFile(MainFilename);
if CodeBuffer = nil then
  Exit; //==
 
ACodeTool := nil;
CodeToolBoss.Explore(CodeBuffer,ACodeTool,false);
if ACodeTool = nil then
  Exit; //==
 
if not ACodeTool.CleanPosToCaretAndTopLine(lStartPos, Caret, NewTopLine)
then
  Exit; //==
 
LazarusIDE.DoOpenFileAndJumpToPos(Caret.Code.Filename,
  Point(Caret.X, Caret.Y),
NewTopLine, -1, [ofRegularFile,ofUseCache]);

 The form is still modal, so the source editor can not be focused. Move the
 above line behind the ShowModal.
 Save the needed values in some public properties.


 
Close;
  end;
 
 
  { method the launches the dialog }
  procedure ExecuteProcedureList(Sender: TObject);
  begin
with TProcedureListForm.Create(Application) do
  try
ShowModal;

 Add here:

 if ShowModal=mrOk then
   LazarusIDE.DoOpenFileAndJumpToPos ...


  finally
Free;
  end;
  end;

 Mattias

 _
  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


[lazarus] Cannot run r8833

2006-02-27 Thread A.J. Venter
Not sure how far back this goes because I only update ever few days, but I 
cannot run this version, after a clean build, lazarus begins to start, shows 
the splash screen and the lazarus editor window and freezes (nothing ever 
gets painted IN the editor window).

On the shell the last output is:
TMainIDE.DoNewEditorFile A Filename=

Thereafter absolutely nothing happens, I did an strace but I couldn´t figure 
out what it was trying to do, just that it didn´t actually do anything beyond 
that point. 
At first I thought it was just my home machine but now I have the same result 
at the office. Obviously I cannot try to do the font stuff until this 
happens, it could mean some new incompatibility with openlab
(I did test - removing $HOME/.lazarus had no impact nor does trying to run it 
as root), though I wouldn´t know where to start looking, let me know if I can 
provide any usefull information like LDD outputs or something.

Note that at this stage we are just talking about a clean make, no GTK2 or 
anything yet, not even any extra packages.

Ciao
A.J.
-- 
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] String functions on non latin text

2006-02-27 Thread Panagiotis Sidiropoulos
Unfortunatelly, even after checking syntax (system.pos()) I get same
strange behaviour, I can't seek in a string.

Panagiotis


-Original Message-
From: Mattias Gaertner [mailto:[EMAIL PROTECTED] 
Sent: Monday, February 27, 2006 1:27 PM
To: lazarus@miraclec.com
Subject: Re: [lazarus] String functions on non latin text


On Mon, 27 Feb 2006 15:17:41 +0200
Panagiotis Sidiropoulos [EMAIL PROTECTED] wrote:

 Functions such as POS() and COPY(), return strange result when used 
 with utf8 text.
 
 Forr example, if your try
 pos( '__', 
 '_

___-
'
 ) you will get 1, which is incorrect.
 
 I know this has to do with utf encoding (2 or more bytes per 
 character).
 
 Any ideas?

UTF8 works with System.Pos. Just make sure you use ansistring or
shortstring, not widestring.


Mattias

_
 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] Cannot run r8833

2006-02-27 Thread Vincent Snijders

A.J. Venter wrote:
Not sure how far back this goes because I only update ever few days, but I 
cannot run this version, after a clean build, lazarus begins to start, shows 
the splash screen and the lazarus editor window and freezes (nothing ever 
gets painted IN the editor window).


On the shell the last output is:
TMainIDE.DoNewEditorFile A Filename=



Already fixed in 8334.

Vincent.

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


Re: [lazarus] String functions on non latin text

2006-02-27 Thread Mattias Gaertner
On Mon, 27 Feb 2006 15:03:17 +0200
Panagiotis Sidiropoulos [EMAIL PROTECTED] wrote:

 Unfortunatelly, even after checking syntax (system.pos()) I get same
 strange behaviour, I can't seek in a string.

Maybe you can send a complete example? (zipped)

Mattias


 
 Panagiotis
 
 
 -Original Message-
 From: Mattias Gaertner [mailto:[EMAIL PROTECTED] 
 Sent: Monday, February 27, 2006 1:27 PM
 To: lazarus@miraclec.com
 Subject: Re: [lazarus] String functions on non latin text
 
 
 On Mon, 27 Feb 2006 15:17:41 +0200
 Panagiotis Sidiropoulos [EMAIL PROTECTED] wrote:
 
  Functions such as POS() and COPY(), return strange result when used 
  with utf8 text.
  
  Forr example, if your try
  pos( '__', 
  '_
 
 ___-
 '
  ) you will get 1, which is incorrect.
  
  I know this has to do with utf encoding (2 or more bytes per 
  character).
  
  Any ideas?
 
 UTF8 works with System.Pos. Just make sure you use ansistring or
 shortstring, not widestring.
 
 
 Mattias
 
 _
  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

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


Re: [lazarus] CodeTools - jump to method I loose focus

2006-02-27 Thread Mattias Gaertner
On Mon, 27 Feb 2006 14:49:18 +0200
Graeme Geldenhuys [EMAIL PROTECTED] wrote:

 Thanks Mattias.  Thinking about it now, the problem makes sense.  Made
 the change and it works perfectly now!
 
 I am very impressed with CodeTools so far!  I have only scratched the
 surface of what it can do, but it is brilliant.  Once you get the
 basics of how it works and what each class does, it becomes much
 easier.  I took me much longer to write this addon for Kylix, than for
 Lazarus, thanks to CodeTools, which did most of the work for me.

Thanks.
Where is the addon available?

Mattias


 
 Regards,
   - Graeme -
 
 
 
 On 2/27/06, Mattias Gaertner [EMAIL PROTECTED] wrote:
  On Mon, 27 Feb 2006 11:36:39 +0200
  Graeme Geldenhuys [EMAIL PROTECTED] wrote:
 
   Hi,
  
   I created a Lazarus addon which shows a list of procedures in a Modal
   dialog (same a GExperts Procedure List).  Everythings seems to work
   fine, except for the editor focus after the jump.
  
   When I call the method below, it jumps to the correct location, and
   the Modal dialog closes, but now I cannot see my cursor in the editor?
The editor looks like it has focus, but no cursor movement is shown
   when I press the up/down keys or even the Ctrl+up/down keys.
  
   Any ideas how I can resolve this?  If you need the full source, I can
   email it directly.
  
   Some notes on the code below:
   LV = TListView component in Report style
   lItem.SubItems[3] holds the TCodeTreeNode.PosStart integer value
  
  
  
   procedure TProcedureListForm.JumpToSelection;
   var
 lItem: TListItem;
 Caret: TCodeXYPosition;
 NewTopLine: integer;
 CodeBuffer: TCodeBuffer;
 ACodeTool: TCodeTool;
 lStartPos: integer;
   begin
 lItem := LV.Selected;
 if lItem = nil then
   Exit; //==
 if lItem.SubItems[3] = '' then
   Exit; //==
  
 lStartPos := StrToInt(lItem.SubItems[3]);
  
 CodeBuffer := CodeToolBoss.FindFile(MainFilename);
 if CodeBuffer = nil then
   Exit; //==
  
 ACodeTool := nil;
 CodeToolBoss.Explore(CodeBuffer,ACodeTool,false);
 if ACodeTool = nil then
   Exit; //==
  
 if not ACodeTool.CleanPosToCaretAndTopLine(lStartPos, Caret,
 NewTopLine) then
   Exit; //==
  
 LazarusIDE.DoOpenFileAndJumpToPos(Caret.Code.Filename,
   Point(Caret.X, Caret.Y),
 NewTopLine, -1, [ofRegularFile,ofUseCache]);
 
  The form is still modal, so the source editor can not be focused. Move
  the above line behind the ShowModal.
  Save the needed values in some public properties.
 
 
  
 Close;
   end;
  
  
   { method the launches the dialog }
   procedure ExecuteProcedureList(Sender: TObject);
   begin
 with TProcedureListForm.Create(Application) do
   try
 ShowModal;
 
  Add here:
 
  if ShowModal=mrOk then
LazarusIDE.DoOpenFileAndJumpToPos ...
 
 
   finally
 Free;
   end;
   end;
 
  Mattias
 
  _
   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

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


[lazarus] Listview scroll selected item into view

2006-02-27 Thread Graeme Geldenhuys
Hi,

Anybody know how I can scroll the selected item of a TListview into
the viewable area.
eg:
  I have 30 items in my Listview (style is Report).
  Currently the listview shows the first 5 items in the list.
  I programatically set the FocusedItem and SelectedItem to the 20th item.
  Now I want to tell the Listview to scroll down until the
SelectedItem is visible.

Any ideas?  Ideally I would like a cross platform solution, but if I
have to use ifdefs to get it to work under Windows and Linux, that is
also ok.

Regards,
  - Graeme -

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


Re: [lazarus] CodeTools - jump to method I loose focus

2006-02-27 Thread Graeme Geldenhuys
I will place it on my server tonight and post the link here...
After a bit of public testing, and it being useful enough, maybe
someone could add it to the Lazarus\Components folder.

I am in the process on converting a few of the GExperts addons to
Lazarus.  This one is the first and a few more will follow over the
next few days (time permitting).  There are certain tool you just
can't live without.  ;-)

Regards,
  - Graeme -



On 2/27/06, Mattias Gaertner [EMAIL PROTECTED] wrote:
 On Mon, 27 Feb 2006 14:49:18 +0200
 Graeme Geldenhuys [EMAIL PROTECTED] wrote:

  Thanks Mattias.  Thinking about it now, the problem makes sense.  Made
  the change and it works perfectly now!
 
  I am very impressed with CodeTools so far!  I have only scratched the
  surface of what it can do, but it is brilliant.  Once you get the
  basics of how it works and what each class does, it becomes much
  easier.  I took me much longer to write this addon for Kylix, than for
  Lazarus, thanks to CodeTools, which did most of the work for me.

 Thanks.
 Where is the addon available?

 Mattias


 
  Regards,
- Graeme -
 
 
 
  On 2/27/06, Mattias Gaertner [EMAIL PROTECTED] wrote:
   On Mon, 27 Feb 2006 11:36:39 +0200
   Graeme Geldenhuys [EMAIL PROTECTED] wrote:
  
Hi,
   
I created a Lazarus addon which shows a list of procedures in a Modal
dialog (same a GExperts Procedure List).  Everythings seems to work
fine, except for the editor focus after the jump.
   
When I call the method below, it jumps to the correct location, and
the Modal dialog closes, but now I cannot see my cursor in the editor?
 The editor looks like it has focus, but no cursor movement is shown
when I press the up/down keys or even the Ctrl+up/down keys.
   
Any ideas how I can resolve this?  If you need the full source, I can
email it directly.
   
Some notes on the code below:
LV = TListView component in Report style
lItem.SubItems[3] holds the TCodeTreeNode.PosStart integer value
   
   
   
procedure TProcedureListForm.JumpToSelection;
var
  lItem: TListItem;
  Caret: TCodeXYPosition;
  NewTopLine: integer;
  CodeBuffer: TCodeBuffer;
  ACodeTool: TCodeTool;
  lStartPos: integer;
begin
  lItem := LV.Selected;
  if lItem = nil then
Exit; //==
  if lItem.SubItems[3] = '' then
Exit; //==
   
  lStartPos := StrToInt(lItem.SubItems[3]);
   
  CodeBuffer := CodeToolBoss.FindFile(MainFilename);
  if CodeBuffer = nil then
Exit; //==
   
  ACodeTool := nil;
  CodeToolBoss.Explore(CodeBuffer,ACodeTool,false);
  if ACodeTool = nil then
Exit; //==
   
  if not ACodeTool.CleanPosToCaretAndTopLine(lStartPos, Caret,
  NewTopLine) then
Exit; //==
   
  LazarusIDE.DoOpenFileAndJumpToPos(Caret.Code.Filename,
Point(Caret.X, Caret.Y),
  NewTopLine, -1, [ofRegularFile,ofUseCache]);
  
   The form is still modal, so the source editor can not be focused. Move
   the above line behind the ShowModal.
   Save the needed values in some public properties.
  
  
   
  Close;
end;
   
   
{ method the launches the dialog }
procedure ExecuteProcedureList(Sender: TObject);
begin
  with TProcedureListForm.Create(Application) do
try
  ShowModal;
  
   Add here:
  
   if ShowModal=mrOk then
 LazarusIDE.DoOpenFileAndJumpToPos ...
  
  
finally
  Free;
end;
end;
  
   Mattias
  
   _
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

 _
  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] CodeTools - jump to method I loose focus

2006-02-27 Thread Michael Van Canneyt



On Mon, 27 Feb 2006, Graeme Geldenhuys wrote:


I will place it on my server tonight and post the link here...
After a bit of public testing, and it being useful enough, maybe
someone could add it to the Lazarus\Components folder.

I am in the process on converting a few of the GExperts addons to
Lazarus.  This one is the first and a few more will follow over the
next few days (time permitting).  There are certain tool you just
can't live without.  ;-)


I'll be the first to use them. GExperts is just too good :-)

Michael.

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


Re: [lazarus] Listview scroll selected item into view

2006-02-27 Thread Marc Weustink

Graeme Geldenhuys wrote:

Hi,

Anybody know how I can scroll the selected item of a TListview into
the viewable area.
eg:
  I have 30 items in my Listview (style is Report).
  Currently the listview shows the first 5 items in the list.
  I programatically set the FocusedItem and SelectedItem to the 20th item.
  Now I want to tell the Listview to scroll down until the
SelectedItem is visible.

Any ideas?  Ideally I would like a cross platform solution, but if I
have to use ifdefs to get it to work under Windows and Linux, that is
also ok.


Item.EnsureVisible (or was it called Item.MakeVisible ?)

Marc

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


RE: [lazarus] String functions on non latin text

2006-02-27 Thread Panagiotis Sidiropoulos
Please download sample project at:
- www.magentadb.gr/ftp/pos-sample.zip

Panagiotis


-Original Message-
From: Mattias Gaertner [mailto:[EMAIL PROTECTED] 
Sent: Monday, February 27, 2006 3:10 PM
To: lazarus@miraclec.com
Subject: Re: [lazarus] String functions on non latin text


On Mon, 27 Feb 2006 15:03:17 +0200
Panagiotis Sidiropoulos [EMAIL PROTECTED] wrote:

 Unfortunatelly, even after checking syntax (system.pos()) I get same 
 strange behaviour, I can't seek in a string.

Maybe you can send a complete example? (zipped)

Mattias


 
 Panagiotis
 
 
 -Original Message-
 From: Mattias Gaertner [mailto:[EMAIL PROTECTED]
 Sent: Monday, February 27, 2006 1:27 PM
 To: lazarus@miraclec.com
 Subject: Re: [lazarus] String functions on non latin text
 
 
 On Mon, 27 Feb 2006 15:17:41 +0200
 Panagiotis Sidiropoulos [EMAIL PROTECTED] wrote:
 
  Functions such as POS() and COPY(), return strange result when used
  with utf8 text.
  
  Forr example, if your try
  pos( '__',
 
'_
 
 __
 _-
 '
  ) you will get 1, which is incorrect.
  
  I know this has to do with utf encoding (2 or more bytes per
  character).
  
  Any ideas?
 
 UTF8 works with System.Pos. Just make sure you use ansistring or 
 shortstring, not widestring.
 
 
 Mattias
 
 _
  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

_
 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


[lazarus] compile lazarus on opensuse 10.0

2006-02-27 Thread Uwe Grauer
Do i really need to have a gtk1-dev-package to compile lazarus?
Opensuse has full gtk2-support. I don't want to mess up my system
just to compile lazarus.
What can i do?

Tanks,
Uwe

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


Re: [lazarus] String functions on non latin text

2006-02-27 Thread Mattias Gaertner
On Mon, 27 Feb 2006 16:08:52 +0200
Panagiotis Sidiropoulos [EMAIL PROTECTED] wrote:

 Please download sample project at:
 - www.magentadb.gr/ftp/pos-sample.zip

It returns 41. Seems to be correct.
I'm using fpc 2.0.2.


Mattias



 
 Panagiotis
 
 
 -Original Message-
 From: Mattias Gaertner [mailto:[EMAIL PROTECTED] 
 Sent: Monday, February 27, 2006 3:10 PM
 To: lazarus@miraclec.com
 Subject: Re: [lazarus] String functions on non latin text
 
 
 On Mon, 27 Feb 2006 15:03:17 +0200
 Panagiotis Sidiropoulos [EMAIL PROTECTED] wrote:
 
  Unfortunatelly, even after checking syntax (system.pos()) I get same 
  strange behaviour, I can't seek in a string.
 
 Maybe you can send a complete example? (zipped)
 
 Mattias
 
 
  
  Panagiotis
  
  
  -Original Message-
  From: Mattias Gaertner [mailto:[EMAIL PROTECTED]
  Sent: Monday, February 27, 2006 1:27 PM
  To: lazarus@miraclec.com
  Subject: Re: [lazarus] String functions on non latin text
  
  
  On Mon, 27 Feb 2006 15:17:41 +0200
  Panagiotis Sidiropoulos [EMAIL PROTECTED] wrote:
  
   Functions such as POS() and COPY(), return strange result when used
   with utf8 text.
   
   Forr example, if your try
   pos( '__',
  
 '_
  
  __
  _-
  '
   ) you will get 1, which is incorrect.
   
   I know this has to do with utf encoding (2 or more bytes per
   character).
   
   Any ideas?
  
  UTF8 works with System.Pos. Just make sure you use ansistring or 
  shortstring, not widestring.
  
  
  Mattias
  
  _
   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
 
 _
  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

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


Re: [lazarus] compile lazarus on opensuse 10.0

2006-02-27 Thread Mattias Gaertner
On Mon, 27 Feb 2006 15:24:50 +0100
Uwe Grauer [EMAIL PROTECTED] wrote:

 Do i really need to have a gtk1-dev-package to compile lazarus?
 Opensuse has full gtk2-support. I don't want to mess up my system
 just to compile lazarus.
 What can i do?

gtk1 and gtk2 lives happily together. They don't share anything. Installing
any gtk1 part should not mess up any gtk2 installation.

Maybe you got confused by the --force option, you need to install the lazrus
fedora rpm on suse. If you don't want to use the --force option, do not
install the rpm. Download the lazarus tgz, extract it and do 'make' to build
it. Lazarus does not need any special directory name. The only executable
are 'lazarus' and startlazarus.

Mattias

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


Re: [lazarus] Listview scroll selected item into view

2006-02-27 Thread Graeme Geldenhuys
Thanks Marc, it was MakeVisible...

G.



On 2/27/06, Marc Weustink [EMAIL PROTECTED] wrote:
 Item.EnsureVisible (or was it called Item.MakeVisible ?)

 Marc

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


Re: [lazarus] Pretty looking TEdit

2006-02-27 Thread A.J. Venter
Well I did some research and the GTK way of doing it is really very simple, 
except that the method (modify_font) doesn´t seem to exist in PGTKWidget 
which I surmise is because the definition of THAT is taken from the GTK1 
definition.
According to the GTK2 docs, all GTK2 widgets derive from GTKWidget and should 
inherrit modify_font which can set any pangoFontDescription, the only 
remaining part is to convert a tfont TO a PangoFontDescription (well 
PPangoFontDescription actually).

So the RIGHT way I believe is to enable the method, presumably by descending 
PGTKWidget to create PGTK2Widget (oddly TGK2Widget exists but TGKWidget does 
not) - which may have the inadvertent side effect of meaning that damn near 
every bit of GTK needs to have it´s type definitions altered to call and use 
the derived class, either that or GTK2 should simply overWRITE the PGTKWidget 
definition with it´s own version that enables the GTK2 specific features.

Thoughts anyone ?

Ciao
A.J.
-- 
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] TSqlite3Dataset

2006-02-27 Thread Luiz Americo Pereira Camara

Michael Van Canneyt escreveu:

On Sun, 26 Feb 2006, Luiz Americo Pereira Camara wrote:

  

Michael Van Canneyt escreveu:


Maybe it's easier to revert your component to SQLDb.

  

Probably not. As i said is just a question of time. The design is
already on my mind and the implementation seems not to be difficult.


SQLDB has a working ApplyUpdates, even for queries
with fields of more than one table.

  

In my experience sqldb.ApplyUpdates is not working at all:
http://www.freepascal.org/bugs/showrec.php3?ID=4725.
And its internals is somewhat slower(the results are in miliseconds):
http://www.geocities.com/camara_luiz/sqlite4fpc/benchmarks.html.



These results are very strange. I am writing articles about
embedded databases, and while for simple queries, Sqlite
is really fast, for complicated queries, it's a factor 12
or more  _slower_ than either mysql or firebird.

I'm talking about running 600.000 queries here, inserting
over 600.000 records. (and yes, I did optimize transactions
and so on)

  
I updated the benchmarks to insert 600.000 records: 
http://www.geocities.com/camara_luiz/sqlite4fpc/benchmarks.html

You would then also have parameter support and so on.

  

Anyway, i think that sqldb and TSqliteDataset are for different
purposes. While the first offers full support to Client/Server
databases, transactions, rollbacks etc., the second is good for
Desktop/embedded applications that need to manipulate data. Also
TSqliteDataset offers the ability to easily (with few lines of code)
create databases at runtime, even in disk or in memory databases (using
filename ':memory:').



The outcome of my investigations is unfortunately not so favourable
for the combination sqlite/pascal ;-)

Michael.

  

Luiz

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


Re: [lazarus] compile lazarus on opensuse 10.0

2006-02-27 Thread Uwe Grauer
Mattias Gaertner wrote:
 On Mon, 27 Feb 2006 15:24:50 +0100
 Uwe Grauer [EMAIL PROTECTED] wrote:
 
 Do i really need to have a gtk1-dev-package to compile lazarus?
 Opensuse has full gtk2-support. I don't want to mess up my system
 just to compile lazarus.
 What can i do?
 
 gtk1 and gtk2 lives happily together. They don't share anything. Installing
 any gtk1 part should not mess up any gtk2 installation.
 
 Maybe you got confused by the --force option, you need to install the lazrus
 fedora rpm on suse. If you don't want to use the --force option, do not
 install the rpm. Download the lazarus tgz, extract it and do 'make' to build
 it. Lazarus does not need any special directory name. The only executable
 are 'lazarus' and startlazarus.
 
 Mattias
 

Mattias,

thank you for the info.
I will try to find a gtk1-dev-package for suse 10.0 then.
Any hints where to find it (suse 10.0 users)?

Uwe

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


Re: [lazarus] TSqlite3Dataset

2006-02-27 Thread Luiz Americo Pereira Camara

Bogusław Brandys escreveu:


But why Post is not working for TSqlite3Dataset ? ApplyUpdates seems 
to be rather for remote server (Delphi help : Changes made to the 
client dataset’s local copy of data are not sent to the application 
server until the client application calls the ApplyUpdates method for 
the dataset.)  , while sqlite is more desktop database I think.


Also I  found a bug:
when I do TSqlite3Dataset.Cancel it doesn't revert value displayed in 
DB controls connected to this dataset to previous state (to value 
stored in database) This cause out of sync - value displayed is that 
last modified by user while in database nothing was changed 
(fortunately - if Dataset.Cancel would allow to post changes on 
Cancel that will be more nasty bug)


Best Regards
Boguslaw



Ok,I understand that because sqlite is purely SQL based it may be 
difficult to allow Cancel to work properly but in fact without proper 
Cancel method - it does not make sense to me creating full dataset 
descendant for sqlite.


One solution would be duplicated buffer for previous posted value for 
revering or simply (better) reget current row from database


I uploaded a version of sqlite3ds that retrieves the data from the 
database when Cancel is called. The code is commented to avoid future 
incompatibilities since the correct approach is to revert to the last 
Posted value which demands more changes/testing. Anyway it's there to 
you test and if this is what you want you can override the DoAfterCancel 
procedure with that code, so there's no problem of futures 
incompatibilities.


Luiz



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


Re: [lazarus] TSqlite3Dataset

2006-02-27 Thread Bogusław Brandys

Luiz Americo Pereira Camara wrote:

Bogusław Brandys escreveu:


But why Post is not working for TSqlite3Dataset ? ApplyUpdates seems 
to be rather for remote server (Delphi help : Changes made to the 
client dataset’s local copy of data are not sent to the application 
server until the client application calls the ApplyUpdates method for 
the dataset.)  , while sqlite is more desktop database I think.


Also I  found a bug:
when I do TSqlite3Dataset.Cancel it doesn't revert value displayed in 
DB controls connected to this dataset to previous state (to value 
stored in database) This cause out of sync - value displayed is that 
last modified by user while in database nothing was changed 
(fortunately - if Dataset.Cancel would allow to post changes on 
Cancel that will be more nasty bug)


Best Regards
Boguslaw



Ok,I understand that because sqlite is purely SQL based it may be 
difficult to allow Cancel to work properly but in fact without proper 
Cancel method - it does not make sense to me creating full dataset 
descendant for sqlite.


One solution would be duplicated buffer for previous posted value for 
revering or simply (better) reget current row from database


I uploaded a version of sqlite3ds that retrieves the data from the 
database when Cancel is called. The code is commented to avoid future 
incompatibilities since the correct approach is to revert to the last 
Posted value which demands more changes/testing. Anyway it's there to 
you test and if this is what you want you can override the DoAfterCancel 
procedure with that code, so there's no problem of futures 
incompatibilities.


Luiz





Great! Where can I download this updated sqlite3ds ?


Regards
Boguslaw Brandys

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


[lazarus] Changing SynEdit

2006-02-27 Thread Flávio Etrusco
Hi all,

is there some kind of official maintainer for the SynEdit component
in Lazarus? I'd like to discuss some changes that were to the original
SynEdit code and some new features (and refactors and restructuing ;-)
I'd like to play with...

Best regards,
Flávio

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


Re: [lazarus] transparent forms

2006-02-27 Thread Christian Iversen
On Monday 27 February 2006 09:38, Micha Nelissen wrote:
 Felipe Monteiro de Carvalho wrote:
  What really happens with TransparentColor of TForm is that it takes a
  screenshot of the screen, probably before the application is loaded,
  so it doesn't appear on the screenshot, and the first thing that
  happens on the paint process of the window is paint a portion of the
  screenshot.
 
  There is no real window transparency on Windows API. All apps that
  don't seam to have a rectangular window acctually work like that.

 I think SetWindowRgn makes part of a window transparent (the parts not
 in the region). For example, winamp can do it: have oddly shaped sizes.

And, xmms can do it without problems as well. (also on old versions of X)

It's only the alpha-*blended* situation that is tricky - alpha testing should 
not be too hard, if you simply recompute the clipping region when the bitmap 
is changed (which is probably slow, so just don't change it too often :-)

-- 
Regards,
Christian Iversen

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


Re: [lazarus] transparent forms

2006-02-27 Thread Flávio Etrusco
On 2/27/06, Christian Iversen [EMAIL PROTECTED] wrote:
 On Monday 27 February 2006 09:38, Micha Nelissen wrote:
  Felipe Monteiro de Carvalho wrote:
   What really happens with TransparentColor of TForm is that it takes a
   screenshot of the screen, probably before the application is loaded,
   so it doesn't appear on the screenshot, and the first thing that
   happens on the paint process of the window is paint a portion of the
   screenshot.
  
   There is no real window transparency on Windows API. All apps that
   don't seam to have a rectangular window acctually work like that.
 
  I think SetWindowRgn makes part of a window transparent (the parts not
  in the region). For example, winamp can do it: have oddly shaped sizes.

 And, xmms can do it without problems as well. (also on old versions of X)

 It's only the alpha-*blended* situation that is tricky - alpha testing should
 not be too hard, if you simply recompute the clipping region when the bitmap
 is changed (which is probably slow, so just don't change it too often :-)

 --
 Regards,
 Christian Iversen

No, no, no, Micha is very right.
I don't know how this discussion started and what it was trying to
acomplish, but SetWindowRgn does exatcly what Micha said.

-Flávio

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


Re: [lazarus] Changing SynEdit

2006-02-27 Thread L505
 is there some kind of official maintainer for the SynEdit component
 in Lazarus? I'd like to discuss some changes that were to the original
 SynEdit code and some new features (and refactors and restructuing ;-)
 I'd like to play with...

 Best regards,
 Flávio



I'm not the maintainer and I have no right to say this but I think you guys
should merge efforts and include the lazarus ifdef's right into the releases of
the Delphi synedit project.

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


Re: Why is this throwing an exception - ANSWER

2006-02-27 Thread Vincent Snijders

A.J. Venter wrote:

I applied only the ippanel change.



As far as I know that should have been the only one anyway though it seems the 
tutorial on patch creation should be expanded to include make clean before 
creating a patch.




That would not have helped in this case, because most of your changes were because 
of local changes to files in the repository.


Vincent.

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


Re: Why is this throwing an exception - ANSWER

2006-02-27 Thread A.J. Venter
On Monday 27 February 2006 18:19, Vincent Snijders wrote:
 A.J. Venter wrote:
 I applied only the ippanel change.
 
  As far as I know that should have been the only one anyway though it
  seems the tutorial on patch creation should be expanded to include make
  clean before creating a patch.

 That would not have helped in this case, because most of your changes were
 because of local changes to files in the repository.

 Vincent.

Then I really dunno what I did wrong because that was the ONLY changed file at 
the time, at least the only one *I* had changed - does lazarus change files 
during runtime or installing of packages ?
How SHOULD I have created the patch ?

A.J.
-- 
A.J. Venter
Chief Software Architect
OpenLab International
www.getopenlab.com
www.silentcoder.co.za
+27 82 726 5103

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


Re: [lazarus] Pretty looking TEdit

2006-02-27 Thread A.J. Venter

 
  If this is possible, then this is *the* way to go.

 At least I know it is possible for gtk2 - I implemented dynamic fonts in
 one of my (C++, unfortunately) programs. The documentation seems to talk
 about the font code as something New and Improved (tm), so I'd say it's
 quite hard in gtk1.
Well I could find the documentation on how to do it, but the actual method 
isn't implemented somewhere, it is not impossible that the PLACE where it is 
missing is in the FPC units, but since those were autogenerated my gutt tells 
me that it is more likely to be somewhere in the LCL.

I am not exactly sure how the GTK2 objects were turned into OP classes for the 
LCL, I would have to look at the wrapper code first, my feeling however is 
that the likely scenario is that somewhere an external declaration needs to 
be added that can enable GTKWidget.Modify_font from the GTK2 libs.

GTK1 already has support for this, and if I I didn't REALLY need UTF-8 support 
for text-out I would have just compiled my app for GTK1 instead but since I 
don't know how, and it would be GREAT if this works, I am happy to help write 
code to make it happen, if I can get help from some of the gtk2 guru's it 
would just happen faster. 

My current code:
In gtk2object.inc add this (I put mine just above TGTKWidget.SetCallBack):
Procedure TGTK2WidgetSet.SetWidgetFont(const AWidget: PGTK2Widget; const 
Afont: tFont);
Var
  PangoDescStr,DescOpts : String;
  NewFontDescription : PPangoFontDescription;

Begin
{$IFDEF GTK2}
PangoDescStr := AFont.Name;
DescOpts := '';
  If FSBold in AFont.Style then
DescOpts := DescOpts + ' bold';
  If FSItalic in AFont.Style then
DescOpts := DescOpts + ' italic';
  If FSUnderline in AFont.Style then
DescOpts := DescOpts + ' underline';
  If FSStrikeOut in AFont.Style then
DescOpts := DescOpts + ' strikethrough';

   PangoDescStr := PangoDescStr+DescOpts+' '+intToStr(Afont.Size);
//Pango does not appear to have a way to set the character set in the
//font description but seems to default to UTF-8 this probably
//requires some or other todo item.
try
NewFontDescription := PPangoFontDescription(PangoDescStr);
AWidget.Modify_Font(NewFontDescription);

except
debugln('COULD NOT SET FONT');
end;
{$ENDIF}
end;


In GTK2Int.pas  change
  protected
procedure AppendText(Sender: TObject; Str: PChar);
to:
  protected
procedure SetWidgetFont(const AWidget: PGTK2Widget; const Afont: tFont);
procedure AppendText(Sender: TObject; Str: PChar);

Note that the current code DOES NOT COMPILE due to the missing Modify_Font.

PS. Thanks Darek, I managed to get THIS far by studying your patch and will 
look at it again when doing the per-widget bits.

PPS. As you can see, right now tfont.color is NOT yet handled at all.

Ciao
A.J.

-- 
A.J. Venter
Chief Software Architect
OpenLab International
www.getopenlab.com
www.silentcoder.co.za
+27 82 726 5103

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


Re: [lazarus] Changing SynEdit

2006-02-27 Thread Mattias Gaertner
On Mon, 27 Feb 2006 09:24:34 -0700
L505 [EMAIL PROTECTED] wrote:

  is there some kind of official maintainer for the SynEdit component
  in Lazarus? I'd like to discuss some changes that were to the original
  SynEdit code and some new features (and refactors and restructuing ;-)
  I'd like to play with...
 
  Best regards,
  Flávio
 
 
 
 I'm not the maintainer and I have no right to say this but I think you
 guys should merge efforts and include the lazarus ifdef's right into the
 releases of the Delphi synedit project.

Yes. 


Mattias

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


Re: [lazarus] TSqlite3Dataset

2006-02-27 Thread Luiz Americo Pereira Camara

Bogusław Brandys escreveu:
I uploaded a version of sqlite3ds that retrieves the data from the 
database when Cancel is called. The code is commented to avoid future 
incompatibilities since the correct approach is to revert to the last 
Posted value which demands more changes/testing. Anyway it's there to 
you test and if this is what you want you can override the 
DoAfterCancel procedure with that code, so there's no problem of 
futures incompatibilities.


Luiz





Great! Where can I download this updated sqlite3ds ?

From http://www.geocities.com/camara_luiz/sqlite4fpc/index.html

Luiz

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


Re: Why is this throwing an exception - ANSWER

2006-02-27 Thread Mattias Gaertner
On Mon, 27 Feb 2006 18:24:09 +0200
A.J. Venter [EMAIL PROTECTED] wrote:

 On Monday 27 February 2006 18:19, Vincent Snijders wrote:
  A.J. Venter wrote:
  I applied only the ippanel change.
  
   As far as I know that should have been the only one anyway though it
   seems the tutorial on patch creation should be expanded to include
   make clean before creating a patch.
 
  That would not have helped in this case, because most of your changes
  were because of local changes to files in the repository.
 
  Vincent.
 
 Then I really dunno what I did wrong because that was the ONLY changed
 file at  the time, at least the only one *I* had changed - does lazarus
 change files  during runtime or installing of packages ?
 How SHOULD I have created the patch ?

Not your fault.
The IDE was not optimized and recreated the Makefiles, even if it was not
neccessary.
This has been improved a few weeks ago.


Mattias

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


Re: [lazarus] Pretty looking TEdit

2006-02-27 Thread Mattias Gaertner
On Mon, 27 Feb 2006 16:42:06 +0200
A.J. Venter [EMAIL PROTECTED] wrote:

 Well I did some research and the GTK way of doing it is really very
 simple,  except that the method (modify_font) doesn´t seem to exist in
 PGTKWidget  which I surmise is because the definition of THAT is taken
 from the GTK1  definition.
 According to the GTK2 docs, all GTK2 widgets derive from GTKWidget and
 should  inherrit modify_font which can set any pangoFontDescription, the
 only  remaining part is to convert a tfont TO a PangoFontDescription (well
 PPangoFontDescription actually).

Correct. 
There must be already such a function, but I'm not sure if it works good.
There are a lot of font issues in the gtk2 interface. 

 
 So the RIGHT way I believe is to enable the method, presumably by
 descending  PGTKWidget to create PGTK2Widget (oddly TGK2Widget exists but
 TGKWidget does  not) - which may have the inadvertent side effect of
 meaning that damn near  every bit of GTK needs to have it´s type
 definitions altered to call and use  the derived class, either that or
 GTK2 should simply overWRITE the PGTKWidget  definition with it´s own
 version that enables the GTK2 specific features.

I'm not sure what this TGTK2Widget is.


Mattias

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


Re: [lazarus] transparent forms

2006-02-27 Thread Den Jean
On Monday 27 February 2006 03:38 am, Micha Nelissen wrote:
 I think SetWindowRgn makes part of a window transparent (the parts not
 in the region). For example, winamp can do it: have oddly shaped sizes.


Here is a sample of using regions with FPC/Qt4 to get oddly shaped sizes.
http://users.pandora.be/Jan.Van.hijfte/qtforfpc/shapedclock.png

I was just working on this so ...




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


Re: [lazarus] Pretty looking TEdit

2006-02-27 Thread A.J. Venter

 Correct.
 There must be already such a function, but I'm not sure if it works good.
 There are a lot of font issues in the gtk2 interface.
Well if it's there, it's not there under the same name :)

  So the RIGHT way I believe is to enable the method, presumably by
  descending  PGTKWidget to create PGTK2Widget (oddly TGK2Widget exists but
  TGKWidget does  not) - which may have the inadvertent side effect of
  meaning that damn near  every bit of GTK needs to have it´s type
  definitions altered to call and use  the derived class, either that or
  GTK2 should simply overWRITE the PGTKWidget  definition with it´s own
  version that enables the GTK2 specific features.

 I'm not sure what this TGTK2Widget is.
It is defined in gtk2int.pas and seems to to be the parent widget for gtk2 
widgets, except it's a LOT shorter than the TGTKWidget definition in 
gtkint.pas (this was where I had to add the procedure definition for 
setWidgetFont), and it doesn't seem to be derived, 
I have not found any reference to PGTK2Widget however leading me to presume it 
doesn't exist, the procedure reference right now uses PGTKWidget since that 
is what I got from Darek's patch, but I am fairly certain that it DOES need 
to change to be a pointer to a TGK2Widget, I am still trying to figure out 
where to DO that though, it is not impossible that defining PGTK2Widget and 
making whatever changes is needed to allow SetWidgetFont calls under GTK2 to 
pass the right type will solve the problem entirely - of course a GTK2 only 
method won't exist if we are using a GTK1 class definition to refer to the 
widget objects in calls. 


Ciao
A.J.
-- 
A.J. Venter
Chief Software Architect
OpenLab International
www.getopenlab.com
www.silentcoder.co.za
+27 82 726 5103

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


Re: [lazarus] Pretty looking TEdit

2006-02-27 Thread A.J. Venter

  try
  NewFontDescription := PPangoFontDescription(PangoDescStr);
  AWidget.Modify_Font(NewFontDescription);

 I will take a look ...

Mucios Gracias Amigo.

A.J.

-- 
A.J. Venter
Chief Software Architect
OpenLab International
www.getopenlab.com
www.silentcoder.co.za
+27 82 726 5103

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


Re: [lazarus] transparent forms

2006-02-27 Thread Felipe Monteiro de Carvalho
On 2/27/06, Micha Nelissen [EMAIL PROTECTED] wrote:
 I think SetWindowRgn makes part of a window transparent (the parts not
 in the region). For example, winamp can do it: have oddly shaped sizes.

well ... good to know new things =)

I did not know that such API function existed.

Maybe it can be used to implement those Delphi properties?

This could be implemented on the widgetset and at least on Qt4 we also
know how to do that now.
--
Felipe Monteiro de Carvalho

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


[lazarus] packages, more packages...

2006-02-27 Thread Alain Michaud
Hi,

  may be I am too naive, but it seems that most questions about
installing Lazarus has to do with selectiong the right packages.

May be there should be a table published on the web page that would give
the list of the necessary packages.

May be it is impossible to write such list. I do  not know? 

Thanks 

Alain Michaud


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


Re: [lazarus] compile lazarus on opensuse 10.0

2006-02-27 Thread Uwe Grauer
Mattias Gaertner wrote:
 On Mon, 27 Feb 2006 15:24:50 +0100
 Uwe Grauer [EMAIL PROTECTED] wrote:
 
 Do i really need to have a gtk1-dev-package to compile lazarus?
 Opensuse has full gtk2-support. I don't want to mess up my system
 just to compile lazarus.
 What can i do?
 
 gtk1 and gtk2 lives happily together. They don't share anything. Installing
 any gtk1 part should not mess up any gtk2 installation.
 
 Maybe you got confused by the --force option, you need to install the lazrus
 fedora rpm on suse. If you don't want to use the --force option, do not
 install the rpm. Download the lazarus tgz, extract it and do 'make' to build
 it. Lazarus does not need any special directory name. The only executable
 are 'lazarus' and startlazarus.
 
 Mattias
 

Ok, i installed gtk-devel-1.2.10

Now i get:
make
...
Target OS: Linux for i386
Compiling lazarus.pp
Linking ../lazarus
/usr/bin/ld: cannot find -lgdk
lazarus.pp(113,1) Error: Error while linking
make[2]: *** [lazarus] Error 1
...

Any hint?
I have /opt/gnome/lib/libgdk-1.2.so.0 .
What am i missing?

Thanks,
Uwe

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


Re: [lazarus] Pretty looking TEdit

2006-02-27 Thread A.J. Venter
On Monday 27 February 2006 18:51, Mattias Gaertner wrote:
   font_desc:=pango_font_description_from_string(PChar(PangoDescStr));
   gtk_widget_modify_font(AWidget,font_desc);
   pango_font_description_free(font_desc);          

Right my patch is ALL BUT complete, one thing is missing though, 
This code FAILS is tfont.name is set to Default, I need to CATCH that and give 
it a SANE default font name in that case,
what should I use ? 
Ideally it should be whatever lazarus normally uses.

A.J.

-- 
A.J. Venter
Chief Software Architect
OpenLab International
www.getopenlab.com
www.silentcoder.co.za
+27 82 726 5103

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


Re: [lazarus] Pretty looking TEdit

2006-02-27 Thread Mattias Gaertner
On Mon, 27 Feb 2006 19:59:02 +0200
A.J. Venter [EMAIL PROTECTED] wrote:

 On Monday 27 February 2006 18:51, Mattias Gaertner wrote:
    font_desc:=pango_font_description_from_string(PChar(PangoDescStr));
    gtk_widget_modify_font(AWidget,font_desc);
    pango_font_description_free(font_desc);          
 
 Right my patch is ALL BUT complete, one thing is missing though, 
 This code FAILS is tfont.name is set to Default, I need to CATCH that and
 give  it a SANE default font name in that case,
 what should I use ? 
 Ideally it should be whatever lazarus normally uses.

Make this: ... whatever gtk2 uses.
I just tested: 'default 29' works here.
Maybe you can use 

  Style:=gtk_widget_get_style(AWidget);
  if Stylenil then begin
font_desc:=Style^.font_desc;

  end;

Mattias

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


[lazarus] GTK2 Font patch - build 1

2006-02-27 Thread A.J. Venter
This is very nearly ready, but it still has two bugs I don't know how to fix - 
hopefully though it will provide enough of a basis that somebody can help me 
finish it off.

Bugs:
1) Tedit doesn't display unless the font is EXPLICITELY set (e.g. my current 
catch code doesn't seem to work for it)
2) TLable sets the font at designtime but not at runtime
-- 
A.J. Venter
Chief Software Architect
OpenLab International
www.getopenlab.com
www.silentcoder.co.za
+27 82 726 5103
Index: components/fpcunit/Makefile.fpc
===
--- components/fpcunit/Makefile.fpc	(revision 8836)
+++ components/fpcunit/Makefile.fpc	(working copy)
@@ -7,7 +7,7 @@
 [compiler]
 unittargetdir=lib/$(CPU_TARGET)-$(OS_TARGET)
 unitdir=../../lcl/units/$(CPU_TARGET)-$(OS_TARGET)/ ../../lcl/units/$(CPU_TARGET)-$(OS_TARGET)/$(LCL_PLATFORM)/ ../../packager/units/$(CPU_TARGET)-$(OS_TARGET)/
-options=-dLCL -dLCLgtk -S2 -gl
+options=-dLCL -dLCL$(LCL_PLATFORM) -S2 -gl
 
 [target]
 units=fpcunittestrunner.pas
@@ -18,6 +18,16 @@
   $(wildcard $(COMPILER_UNITTARGETDIR)/*$(RSTEXT)) \
   $(wildcard $(COMPILER_UNITTARGETDIR)/*.compiled) \
   $(wildcard *$(OEXT)) $(wildcard *$(PPUEXT)) $(wildcard *$(RSTEXT))
+[prerules]
+# LCL Platform
+ifndef LCL_PLATFORM
+ifeq ($(OS_TARGET),win32)
+LCL_PLATFORM=win32
+else
+LCL_PLATFORM=gtk
+endif
+endif
+export LCL_PLATFORM
 
 [rules]
 .PHONY: cleartarget all
Index: components/fpcunit/Makefile
===
--- components/fpcunit/Makefile	(revision 8836)
+++ components/fpcunit/Makefile	(working copy)
@@ -1,5 +1,5 @@
 #
-# Don't edit, this file is generated by FPCMake Version 2.0.0 [2006/01/19]
+# Don't edit, this file is generated by FPCMake Version 2.0.0 [2005/12/07]
 #
 default: all
 MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-emx i386-watcom i386-netwlibc i386-wince m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos powerpc-linux powerpc-netbsd powerpc-macos powerpc-darwin powerpc-morphos sparc-linux sparc-netbsd sparc-solaris x86_64-linux x86_64-freebsd x86_64-win64 arm-linux arm-wince powerpc64-linux
@@ -231,6 +231,14 @@
 PACKAGESDIR:=$(wildcard $(FPCDIR) $(FPCDIR)/packages/base $(FPCDIR)/packages/extra)
 override PACKAGE_NAME=fpcunittestrunner
 override PACKAGE_VERSION=0.1
+ifndef LCL_PLATFORM
+ifeq ($(OS_TARGET),win32)
+LCL_PLATFORM=win32
+else
+LCL_PLATFORM=gtk
+endif
+endif
+export LCL_PLATFORM
 ifeq ($(FULL_TARGET),i386-linux)
 override TARGET_UNITS+=fpcunittestrunner.pas
 endif
@@ -454,115 +462,115 @@
 override CLEAN_FILES+=$(wildcard $(COMPILER_UNITTARGETDIR)/*$(OEXT)) $(wildcard $(COMPILER_UNITTARGETDIR)/*$(PPUEXT)) $(wildcard $(COMPILER_UNITTARGETDIR)/*$(RSTEXT)) $(wildcard $(COMPILER_UNITTARGETDIR)/*.compiled) $(wildcard *$(OEXT)) $(wildcard *$(PPUEXT)) $(wildcard *$(RSTEXT))
 endif
 ifeq ($(FULL_TARGET),i386-linux)
-override COMPILER_OPTIONS+=-dLCL -dLCLgtk -S2 -gl
+override COMPILER_OPTIONS+=-dLCL -dLCL$(LCL_PLATFORM) -S2 -gl
 endif
 ifeq ($(FULL_TARGET),i386-go32v2)
-override COMPILER_OPTIONS+=-dLCL -dLCLgtk -S2 -gl
+override COMPILER_OPTIONS+=-dLCL -dLCL$(LCL_PLATFORM) -S2 -gl
 endif
 ifeq ($(FULL_TARGET),i386-win32)
-override COMPILER_OPTIONS+=-dLCL -dLCLgtk -S2 -gl
+override COMPILER_OPTIONS+=-dLCL -dLCL$(LCL_PLATFORM) -S2 -gl
 endif
 ifeq ($(FULL_TARGET),i386-os2)
-override COMPILER_OPTIONS+=-dLCL -dLCLgtk -S2 -gl
+override COMPILER_OPTIONS+=-dLCL -dLCL$(LCL_PLATFORM) -S2 -gl
 endif
 ifeq ($(FULL_TARGET),i386-freebsd)
-override COMPILER_OPTIONS+=-dLCL -dLCLgtk -S2 -gl
+override COMPILER_OPTIONS+=-dLCL -dLCL$(LCL_PLATFORM) -S2 -gl
 endif
 ifeq ($(FULL_TARGET),i386-beos)
-override COMPILER_OPTIONS+=-dLCL -dLCLgtk -S2 -gl
+override COMPILER_OPTIONS+=-dLCL -dLCL$(LCL_PLATFORM) -S2 -gl
 endif
 ifeq ($(FULL_TARGET),i386-netbsd)
-override COMPILER_OPTIONS+=-dLCL -dLCLgtk -S2 -gl
+override COMPILER_OPTIONS+=-dLCL -dLCL$(LCL_PLATFORM) -S2 -gl
 endif
 ifeq ($(FULL_TARGET),i386-solaris)
-override COMPILER_OPTIONS+=-dLCL -dLCLgtk -S2 -gl
+override COMPILER_OPTIONS+=-dLCL -dLCL$(LCL_PLATFORM) -S2 -gl
 endif
 ifeq ($(FULL_TARGET),i386-qnx)
-override COMPILER_OPTIONS+=-dLCL -dLCLgtk -S2 -gl
+override COMPILER_OPTIONS+=-dLCL -dLCL$(LCL_PLATFORM) -S2 -gl
 endif
 ifeq ($(FULL_TARGET),i386-netware)
-override COMPILER_OPTIONS+=-dLCL -dLCLgtk -S2 -gl
+override COMPILER_OPTIONS+=-dLCL -dLCL$(LCL_PLATFORM) -S2 -gl
 endif
 ifeq ($(FULL_TARGET),i386-openbsd)
-override COMPILER_OPTIONS+=-dLCL -dLCLgtk -S2 -gl
+override COMPILER_OPTIONS+=-dLCL -dLCL$(LCL_PLATFORM) -S2 -gl
 endif
 ifeq ($(FULL_TARGET),i386-wdosx)
-override COMPILER_OPTIONS+=-dLCL -dLCLgtk -S2 -gl
+override COMPILER_OPTIONS+=-dLCL -dLCL$(LCL_PLATFORM) -S2 -gl
 endif
 ifeq ($(FULL_TARGET),i386-emx)
-override COMPILER_OPTIONS+=-dLCL -dLCLgtk -S2 -gl
+override COMPILER_OPTIONS+=-dLCL 

Re: [lazarus] Sqlite component cleanup

2006-02-27 Thread Vincent Snijders

Luiz Americo wrote:

The files sqlitedslaz.pas, sqlitedslaz.lpk, sqliteds.lrs, tableeditorform.pas, 
tableeditorform.lrs can be removed from the components/sqlite subversion 
repository since they are not used anymore and can lead to user confusion.



Thanks for the information. I removed them in revision 8839.

Regards,
Vincent

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


Re: [lazarus] compile lazarus on opensuse 10.0

2006-02-27 Thread Eric Chapman
 thank you for the info.
 I will try to find a gtk1-dev-package for suse 10.0 then.
 Any hints where to find it (suse 10.0 users)?

The package you want is called gtk-devel and it's on any of the normal SuSE 
mirrors or the installation DVD.

Eric

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


[lazarus] graphical shapes library or component

2006-02-27 Thread Marc Santhoff
Hi,

is anoyone aware of a library or a (set of) componet(s) for pitchforking
around some shapes, rectangles, elipses and the like and for creating
connectors between this shapes?

Of course it should be easily usable with fpc and lazarus. I'm searching
for the basic things making up a graphical editor.

Btw. the wiki seems to be down atm: (61) Connection refused.

TIA,
Marc


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


Re: [lazarus] transparent forms

2006-02-27 Thread xpete
sorry for the late reply.

I have been doing some test with this code:

procedure TForm1.FormCreate(Sender: TObject);
var
 Rgn : HRGN;
begin
Rgn := CreateEllipticRgn(1,1,217,217);
SetWindowRgn(Handle, Rgn, True);
end; 

And it works in Lazarus if i use unit Windows in windows.
The component
FormForma(http://brunobl.sites.uol.com.br/fonte/FormForma.zip) also
uses SetWindowRgn so i think it also shold be working but it didn't.
Please take a look at FormForma code.

to do the same thing in gtk2 please take a look at tests/testgtk.c in
gtk2 source tarball.


And i was asking about this plugger :
http://z505.com/cgi-bin/qkcont/qkcont.cgi?p=PluggerPlugger

On Mon, 27 Feb 2006 17:49:12 -0500
Den Jean [EMAIL PROTECTED] wrote:

 On Monday 27 February 2006 03:38 am, Micha Nelissen wrote:
  I think SetWindowRgn makes part of a window transparent (the parts
  not in the region). For example, winamp can do it: have oddly
  shaped sizes.
 
 
 Here is a sample of using regions with FPC/Qt4 to get oddly shaped
 sizes. http://users.pandora.be/Jan.Van.hijfte/qtforfpc/shapedclock.png
 
 I was just working on this so ...
 
 
 
 
 _
  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] String functions on non latin text

2006-02-27 Thread Jesus Reyes

 --- Panagiotis Sidiropoulos [EMAIL PROTECTED] escribió:

 Please download sample project at:
 - www.magentadb.gr/ftp/pos-sample.zip
 
 Panagiotis
 

result := Pos(UTF8Decode(SubStr), UTF8Decode(Str));

seems to work, I think Pos(UTF8String,UTF8String) is yet to be
implemented.

Jesus Reyes A.





___ 
Do You Yahoo!? 
La mejor conexión a Internet y b 2GB/b extra a tu correo por $100 al mes. 
http://net.yahoo.com.mx 

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


[lazarus] New Lazarus addon - Procedure List

2006-02-27 Thread Graeme Geldenhuys
Hi

The procedure list enables you to view a list of Free Pascal / Lazarus
procedures in the current unit and quickly jump to the implementation
of a given procedure. Include files are also supported.
This is the first of a few GExpert addons I want to convert to Lazarus.

For more information and to download the source have a look at:
   http://opensoft.homeip.net/lazarus/procedurelist.html

Please give me some feedback if you experience any problems.

Regards,
  - Graeme -

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


Re: [lazarus] graphical shapes library or component

2006-02-27 Thread Michael Van Canneyt


On Mon, 27 Feb 2006, Marc Santhoff wrote:

 Hi,

 is anoyone aware of a library or a (set of) componet(s) for pitchforking
 around some shapes, rectangles, elipses and the like and for creating
 connectors between this shapes?

 Of course it should be easily usable with fpc and lazarus. I'm searching
 for the basic things making up a graphical editor.

 Btw. the wiki seems to be down atm: (61) Connection refused.

This is known.
The machine hosting the wiki has been compromised. We don't know why yet.

Michael.

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


Re: [lazarus] String functions on non latin text

2006-02-27 Thread Mattias Gaertner
On Mon, 27 Feb 2006 13:41:13 -0600 (CST)
Jesus Reyes [EMAIL PROTECTED] wrote:

 
  --- Panagiotis Sidiropoulos [EMAIL PROTECTED] escribió:
 
  Please download sample project at:
  - www.magentadb.gr/ftp/pos-sample.zip
  
  Panagiotis
  
 
 result := Pos(UTF8Decode(SubStr), UTF8Decode(Str));
 
 seems to work, I think Pos(UTF8String,UTF8String) is yet to be
 implemented.

It does not need to be implemented. One nice feature of UTF8 is, that you
can find out the start of an UTF8 character without parsing the whole
string. A simple substring search works with UTF8 and is unambiguous.
On the other hand: UTF8Decode will fail on some character sets, not fitting
into 2byte characters.

My guess, why a simple Pos does not work for Panagiotis, is a either a FPC
bug or a gtk1 bug with greek characters.


Mattias

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


[lazarus] GTK2 SetFont Patch - final (for now)

2006-02-27 Thread A.J. Venter
Right then, I tested this a bit and it seems to work pretty well unless I am 
still missing something, this version ALSO includes font.color support.

As a whole this should probably ALL be considered experimental code but it 
(probably) won't crash your apps.
At least I believe it provides a good base from which it can now be improved 
as any special cases reveal themselves and if any bugs are reported I will do 
my best to help fix them.

For now though, that's three patches in one night so I think I tortured 
everyone's mailboxes quite enough :p

Ciao
A.J.
-- 
A.J. Venter
Chief Software Architect
OpenLab International
www.getopenlab.com
www.silentcoder.co.za
+27 82 726 5103
Index: lcl/interfaces/gtk/gtkwscontrols.pp
===
--- lcl/interfaces/gtk/gtkwscontrols.pp	(revision 8836)
+++ lcl/interfaces/gtk/gtkwscontrols.pp	(working copy)
@@ -30,7 +30,7 @@
 
 uses
   {$IFDEF GTK2}
-  Gtk2, Glib2, Gdk2,
+  Gtk2, Glib2, Gdk2,Pango,
   {$ELSE}
   Gtk, Glib, Gdk,
   {$ENDIF}
@@ -392,6 +392,14 @@
   const AFont: TFont);
 var
   Widget: PGtkWidget;
+{$IFDEF Gtk2}
+  PangoDescStr,DescOpts : String;
+  NewFontDescription : PPangoFontDescription;
+  Size : Integer;
+  Name : String;
+  xfg: TGDKColor;
+  State : Longint;
+{$ENDIF}
 begin
   if not AWinControl.HandleAllocated then exit;
   Widget:=pGtkWidget(AWinControl.handle);
@@ -399,13 +407,59 @@
 exit;
 
   if AFont.IsDefault then exit;
+{$IFDEF Gtk}
   DebugLn('TGtkWSWinControl.SetFont ',DbgSName(AWinControl));
   GtkWidgetSet.SetWidgetFont(Widget,Afont);
   GtkWidgetSet.SetWidgetColor(Widget,AWinControl.font.color, clNone,
   [GTK_STATE_NORMAL,GTK_STATE_ACTIVE,
GTK_STATE_PRELIGHT,GTK_STATE_SELECTED]);
+{$ENDIF}
+{$IFDEF Gtk2}
+
+  If Afont.IsDefault then Exit;
+
+ If AFont.Size = 0 then
+ 	Size := 10
+ else
+   Size := AFont.Size;
+
+ if (length(AFont.Name) = 0) or
+(upperCase(AFont.Name) = 'DEFAULT') then
+	Name := 'Sans'
+ else
+ 	Name := AFont.Name;
+ DebugLn('TGtkWSWinControl.SetFont(GTK2) ',DbgSName(AWinControl));
+ PangoDescStr := Name;
+ DescOpts := '';
+  If FSBold in AFont.Style then
+		DescOpts := DescOpts + ' bold';
+  If FSItalic in AFont.Style then
+		DescOpts := DescOpts + ' italic';
+  If FSUnderline in AFont.Style then
+		DescOpts := DescOpts + ' underline';
+  If FSStrikeOut in AFont.Style then
+		DescOpts := DescOpts + ' strikethrough';
+
+   PangoDescStr := PangoDescStr+DescOpts+' '+intToStr(Size);
+//Pango does not appear to have a way to set the character set in the
+//font description but seems to default to UTF-8 this probably
+//requires some or other todo item.
+try
+NewFontDescription := PPangoFontDescription(PangoDescStr);
+NewFontDescription :=pango_font_description_from_string(PChar(PangoDescStr));
+ gtk_widget_modify_font(Widget,NewFontDescription);
+pango_font_description_free(NewFontDescription);
+//And now the font color
+	xfg:=AllocGDKColor(colorToRGB(AFont.Color));
+for State :=  GTK_STATE_NORMAL to GTK_STATE_SELECTED do
+	gtk_widget_modify_fg(Widget, State ,@xfg);
+except
+debugln('COULD NOT SET FONT');
 end;
 
+{$ENDIF}
+end;
+
 procedure TGtkWSWinControl.SetPos(const AWinControl: TWinControl;
   const ALeft, ATop: Integer);
 var
Index: lcl/interfaces/gtk2/gtk2int.pas
===
--- lcl/interfaces/gtk2/gtk2int.pas	(revision 8836)
+++ lcl/interfaces/gtk2/gtk2int.pas	(working copy)
@@ -54,6 +54,7 @@
 
   TGtk2WidgetSet = class(TGtkWidgetSet)
   protected
+procedure SetWidgetFont(const AWidget: PGTKWidget; const Afont: tFont);
 procedure AppendText(Sender: TObject; Str: PChar);
 function CreateComponent(Sender : TObject): THandle; override;
 function GetText(Sender: TComponent; var Text: String): Boolean;
@@ -120,6 +121,7 @@
 property Sorted : boolean read FSorted write SetSorted;
 property Owner: TWinControl read FOwner;
   end;
+  
 
 {$IfDef GTK2_2}
 procedure gdk_display_get_pointer(display : PGdkDisplay; screen :PGdkScreen; x :Pgint; y : Pgint; mask : PGdkModifierType); cdecl; external gdklib;
Index: lcl/interfaces/gtk2/gtk2object.inc
===
--- lcl/interfaces/gtk2/gtk2object.inc	(revision 8836)
+++ lcl/interfaces/gtk2/gtk2object.inc	(working copy)
@@ -959,6 +959,69 @@
 
   Applies a Message to the sender
  --}
+
+Procedure TGTK2WidgetSet.SetWidgetFont(const AWidget: PGTKWidget; const Afont: tFont);
+Var 
+  PangoDescStr,DescOpts : String;
+  NewFontDescription : PPangoFontDescription;
+  Size : Integer;
+  Name : String;
+  xfg: TGDKColor;
+  State: Longint;
+Begin
+{$IFDEF GTK2}
+If Afont.IsDefault then Exit;
+
+ If AFont.Size = 0 then 
+ 	Size := 

Re: [lazarus] Changing SynEdit

2006-02-27 Thread Flávio Etrusco
   is there some kind of official maintainer for the SynEdit component
   in Lazarus? I'd like to discuss some changes that were to the original
   SynEdit code and some new features (and refactors and restructuing ;-)
   I'd like to play with...
  
   Best regards,
   Flávio
 
 L505 wrote:
  I'm not the maintainer and I have no right to say this but I think you
  guys should merge efforts and include the lazarus ifdef's right into the
  releases of the Delphi synedit project.

On 2/27/06, Mattias Gaertner wrote:
 Yes.


Basically, yes. But as a matter of fact, what I was thinking about it
to stop wasting my time developing for Delphi and finally shift my
focus to Lazarus...

One of the things I expected was to get free of the annoyance of
supporting several compilers, worst yet I only have access to
Delphi5 and only at workplace (and I don't feel like staying
afterhours like I used to ;-) , so the main question is: why did you
keep the IFDEFs for old Delphi versions and why the IFDEF for Lazarus
bits?

The other few questions I have ATM are purely technical so I'll save
them for a next round ;-)

Cheers,
Flávio

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


Re: [lazarus] Changing SynEdit

2006-02-27 Thread L505
 Basically, yes. But as a matter of fact, what I was thinking about it
 to stop wasting my time developing for Delphi and finally shift my
 focus to Lazarus...

How does M.H. and the rest of the Synedit developers feel?
I have Delphi 5 too btw.

Some of the ifdefs might even be able to be taken out but I'm not sure. Because
FPC/Delphi compatibility has gotten better and better with time and I think M.G.
made those ifdefs way long ago back when FPC/Delphi compatibility was not as
good as it is today.


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


Re: [lazarus] Changing SynEdit

2006-02-27 Thread Mattias Gaertner
On Mon, 27 Feb 2006 19:03:07 -0700
L505 [EMAIL PROTECTED] wrote:

  Basically, yes. But as a matter of fact, what I was thinking about it
  to stop wasting my time developing for Delphi and finally shift my
  focus to Lazarus...
 
 How does M.H. and the rest of the Synedit developers feel?
 I have Delphi 5 too btw.
 
 Some of the ifdefs might even be able to be taken out but I'm not sure.
 Because FPC/Delphi compatibility has gotten better and better with time
 and I think M.G. made those ifdefs way long ago back when FPC/Delphi
 compatibility was not as good as it is today.

The IFDEFs were added
- because of the MPL license
- to easier merge the changes into the original synedit

The original SynEdit has developed some nice features over the years. 


Mattias

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


Re: [lazarus] String functions on non latin text

2006-02-27 Thread Jesus Reyes

- Original Message - 
From: Mattias Gaertner [EMAIL PROTECTED]
To: lazarus@miraclec.com
Sent: Monday, February 27, 2006 2:45 PM
Subject: Re: [lazarus] String functions on non latin text


 On Mon, 27 Feb 2006 13:41:13 -0600 (CST)
 Jesus Reyes [EMAIL PROTECTED] wrote:
 
  
   --- Panagiotis Sidiropoulos [EMAIL PROTECTED] escribió:
  
   Please download sample project at:
   - www.magentadb.gr/ftp/pos-sample.zip
   
   Panagiotis
   
  
  result := Pos(UTF8Decode(SubStr), UTF8Decode(Str));
  
  seems to work, I think Pos(UTF8String,UTF8String) is yet to be
  implemented.
 
 It does not need to be implemented. One nice feature of UTF8 is, that you
 can find out the start of an UTF8 character without parsing the whole
 string. A simple substring search works with UTF8 and is unambiguous.

I guess it would depend on the need for the pos function return value, if some
 feedback should be made to the user about the position the substring matched 
then current pos functions doesn't not return a visually right position, I mean 
counting characters form  left to right, the correct position should be 21 not 
41.

If the value is to be user with other string functions then the return value is
right.

if the function is ever implemented I think it should be for something like
pos(UTFString,UTFString) where UTFString should represent any UTF Encoding
in use. Unlikely? maybe :D

 On the other hand: UTF8Decode will fail on some character sets, not fitting
 into 2byte characters.

it seems to have support for at least 3 byte chars. I didn't test tho..

 
 My guess, why a simple Pos does not work for Panagiotis, is a either a FPC
 bug or a gtk1 bug with greek characters.
 

I compiled the test first for gtk1 and results looked right to me, so if there 
is
something wrong with the sample I thought it should be gtk2 and the only 
problem I
found was the position returned mismatched visually the substring

 
 Mattias
 

Jesus Reyes A.

__
Correo Yahoo!
Espacio para todos tus mensajes, antivirus y antispam ¡gratis! 
Regístrate ya - http://correo.yahoo.com.mx/ 

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


Re: [lazarus] TListView selection

2006-02-27 Thread George Lober

George Lober wrote:


Vincent Snijders wrote:


[EMAIL PROTECTED] wrote:


George,

This feature does not work under win32. I have attached a patch that
should fix this.



I looked at the patch I don't understand the part in 
win32wscustomlistview.pas.

You add
  SetProperty(TListView(AWinControl), lvpHideSelection, True);
and then you seem to comment out the implementation of 
TWin32WSCustomListView.SetProperty.


Is that new line actually doing anything?

Vincent

P.S. if you use // to comment blocks more can be read from the patch.



Darius, I managed to apply your patch but it doesn't do what I need it 
to do. While a grayed out selection remains on the ListViews, it's 
only visual. Logic wise, if for example I have two selected ListViews 
on a form, only one of them will be  Listview.selected  nil, I need 
both to be nil.



My apologies guys, I made a mistake in my test. The patch works. When a 
couple of ListViews are selected they are both ListView.Selected  nil.


George

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


RE: [lazarus] String functions on non latin text

2006-02-27 Thread Panagiotis Sidiropoulos
result := Pos(UTF8Decode(SubStr), UTF8Decode(Str));
seems to work, I think Pos(UTF8String,UTF8String) is yet to be
implemented.

UTF8Decode return ? for me for each Greek character (non latin).
Is it normal? Should I check something else but my code?

Panagiotis

-Original Message-
From: Jesus Reyes [mailto:[EMAIL PROTECTED] 
Sent: Monday, February 27, 2006 9:41 PM
To: lazarus@miraclec.com
Subject: RE: [lazarus] String functions on non latin text



 --- Panagiotis Sidiropoulos [EMAIL PROTECTED] escribió:

 Please download sample project at:
 - www.magentadb.gr/ftp/pos-sample.zip
 
 Panagiotis
 

result := Pos(UTF8Decode(SubStr), UTF8Decode(Str));

seems to work, I think Pos(UTF8String,UTF8String) is yet to be
implemented.

Jesus Reyes A.





___ 
Do You Yahoo!? 
La mejor conexión a Internet y b 2GB/b extra a tu correo por $100 al
mes. http://net.yahoo.com.mx 

_
 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] String functions on non latin text

2006-02-27 Thread Vincent Snijders

Panagiotis Sidiropoulos wrote:

It returns 41. Seems to be correct.
I'm using fpc 2.0.2.



Greek k suggested when sample project I up, is in position 21 in the
string, not 41.
When using sample project, I get following relults while search for each
character in String to search in edit box:
- 1st: position: 1 - correct
- 2nd: position: 3 - wrong
- 3rd: position: 5 - wrong
- 4th: position: 7 - wrong
and so on

I also use FPC 2.0.2 downloaded a few days ago at
ftp://ftp.de.freepascal.org/pub/fpc/dist/i386-linux-2.0.2/fpc-2.0.2.i386
-linux.tar.
An ftp server choosed in Germany, I suppose all server support same
build.


pos return the position is bytes not in chars

I think you can use the UTF8Length to get the character position.
http://lazarus-ccr.sourceforge.net/docs/lcl/lclproc/utf8length.html

ps := pos(c,s);
if (ps0) then
CharacterPos := UTF8Length(Copy(s,1,ps-1)+
else
CharacterPos := 0;

Vincent.

P

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


RE: [lazarus] String functions on non latin text

2006-02-27 Thread Panagiotis Sidiropoulos
My guess, why a simple Pos does not work for Panagiotis, 
is a either a FPC bug 

FPC is 2.0.2 downloaded a few days ago from a German ftp server directed
through www.freepascal.org.

or a gtk1 bug with greek characters.

I'm compiling for GTK2.

Panagiotis


-Original Message-
From: Mattias Gaertner [mailto:[EMAIL PROTECTED] 
Sent: Monday, February 27, 2006 10:46 PM
To: lazarus@miraclec.com
Subject: Re: [lazarus] String functions on non latin text


On Mon, 27 Feb 2006 13:41:13 -0600 (CST)
Jesus Reyes [EMAIL PROTECTED] wrote:

 
  --- Panagiotis Sidiropoulos [EMAIL PROTECTED] escribió:
 
  Please download sample project at:
  - www.magentadb.gr/ftp/pos-sample.zip
  
  Panagiotis
  
 
 result := Pos(UTF8Decode(SubStr), UTF8Decode(Str));
 
 seems to work, I think Pos(UTF8String,UTF8String) is yet to be 
 implemented.

It does not need to be implemented. One nice feature of UTF8 is, that
you can find out the start of an UTF8 character without parsing the
whole string. A simple substring search works with UTF8 and is
unambiguous. On the other hand: UTF8Decode will fail on some character
sets, not fitting into 2byte characters.

My guess, why a simple Pos does not work for Panagiotis, is a either a
FPC bug or a gtk1 bug with greek characters.


Mattias

_
 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] String functions on non latin text

2006-02-27 Thread Panagiotis Sidiropoulos
so if there is something wrong with the sample I thought it should 
be gtk2 and the only problem I found was the position returned 
mismatched visually the substring

I tried to find a relation between results but there is no any kind of
pattern, for example, for the first character give 1, the second 3 and
21st give 41. Visually mismatch is the problem, I need to rearrange
characters for indexing reasons and can't trace what character is what
into convertion table.

I will try to update Lazarus and FPC, just to be sure.

Panagiotis

-Original Message-
From: Jesus Reyes [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, February 28, 2006 8:30 AM
To: lazarus@miraclec.com
Subject: Re: [lazarus] String functions on non latin text



- Original Message - 
From: Mattias Gaertner [EMAIL PROTECTED]
To: lazarus@miraclec.com
Sent: Monday, February 27, 2006 2:45 PM
Subject: Re: [lazarus] String functions on non latin text


 On Mon, 27 Feb 2006 13:41:13 -0600 (CST)
 Jesus Reyes [EMAIL PROTECTED] wrote:
 
  
   --- Panagiotis Sidiropoulos [EMAIL PROTECTED] escribió:
  
   Please download sample project at:
   - www.magentadb.gr/ftp/pos-sample.zip
   
   Panagiotis
   
  
  result := Pos(UTF8Decode(SubStr), UTF8Decode(Str));
  
  seems to work, I think Pos(UTF8String,UTF8String) is yet to be 
  implemented.
 
 It does not need to be implemented. One nice feature of UTF8 is, that 
 you can find out the start of an UTF8 character without parsing the 
 whole string. A simple substring search works with UTF8 and is 
 unambiguous.

I guess it would depend on the need for the pos function return value,
if some  feedback should be made to the user about the position the
substring matched 
then current pos functions doesn't not return a visually right position,
I mean 
counting characters form  left to right, the correct position should be
21 not 41.

If the value is to be user with other string functions then the return
value is right.

if the function is ever implemented I think it should be for something
like
pos(UTFString,UTFString) where UTFString should represent any UTF
Encoding in use. Unlikely? maybe :D

 On the other hand: UTF8Decode will fail on some character sets, not 
 fitting into 2byte characters.

it seems to have support for at least 3 byte chars. I didn't test tho..

 
 My guess, why a simple Pos does not work for Panagiotis, is a either a

 FPC bug or a gtk1 bug with greek characters.
 

I compiled the test first for gtk1 and results looked right to me, so if
there is something wrong with the sample I thought it should be gtk2 and
the only problem I found was the position returned mismatched visually
the substring

 
 Mattias
 

Jesus Reyes A.

__
Correo Yahoo!
Espacio para todos tus mensajes, antivirus y antispam ¡gratis! 
Regístrate ya - http://correo.yahoo.com.mx/ 

_
 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