Re: [Lazarus] DOM and GTK 12: how to set encoding?

2009-04-26 Thread Marc Santhoff
Am Freitag, den 17.04.2009, 16:05 +0200 schrieb Mattias Gaertner:
 On Fri, 17 Apr 2009 15:13:37 +0200
 Marc Santhoff m.santh...@web.de wrote:
 
 [...]
  I have a DOM model read from a xml file that has no encoding named
  inside it. The var TXMLDocument.Encoding is empty after the file is
  loaded.
 [...] How can make GTK 2 show those chars as in GTK 1?
 
 convert the xml file to UTF-8
 
 OR
 
 convert the xml file before passing it to the xml reader
 
 OR
 
 convert the strings before passing them to the LCL
 
 See unit lconvencoding GuessEncoding and ConvertEncoding.

I like cookbook-style compressed receipes. :)

Many Thanks,
-- 
Marc Santhoff m.santh...@web.de

___
Lazarus mailing list
Lazarus@lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] DOM and GTK 12: how to set encoding?

2009-04-26 Thread Marc Santhoff
Am Freitag, den 17.04.2009, 18:19 +0400 schrieb Sergei Gorelkin:
 Marc Santhoff wrote:
  Hi,
  
  I have a DOM model read from a xml file that has no encoding named
  inside it. The var TXMLDocument.Encoding is empty after the file is
  loaded.
  
 TXMLDocument.Encoding is currently not functional. The XML reader 
 assumes that files without specified encoding are UTF-8 (or UTF-16 if a 
 BOM is present).
 In your case, however, it appears that the file does not contain 
 non-ASCII characters in literal (they are 'escaped' by character 
 entities). The encoding is not relevant in this case, because character 
 entities are directly converted to Unicode code points.

I see, hopefully I'll get used to this stuff really soon ...

  WHen compiling the program for GTK 1 the german umlauts are shown
  correctly, I assume GTK 1 defaults to system encoding (or so ;). The
  files have been written in a GUI using the same system encoding
  (ISO-8859-1).
 
 The DOM is based on WideStrings (UTF-16 encoding). When you assign DOM 
 properties to AnsiStrings, the compiler inserts implicit conversions 
 into system encoding.
 
  When compiled for GTK 2 the umlauts are not shown corrctly and on the
  console messages like this appear when handing over strings to gtk
  widgets:
  
  Pango-WARNING **: Invalid UTF-8 string passed to pango_layout_set_t ext()
  
  When the texts are not used as caption but as text inside a memo, the
  warning differs:
  
  Gtk-CRITICAL **: gtk_text_buffer_emit_insert: assertion `g_utf8_val
  idate (text, len, NULL)' failed
  
  and the strings in question are left out up to the next newline.
  
 GTK 2 requires UTF-8 everywhere, so implicit conversions inserted by 
 compiler will work correctly only when your system locale is UTF-8. 
 Otherwise, you'll need to manually convert strings using UTF8Encode() 
 and UTF8Decode().

One more question on this topic:

How do other OS handle encodings?

I have to decide whether to put the encoding routine calls inside the
data classes, that would mean any OSes GUI is handed over UTF8 strings,
or if I have to do it in the GUI glue code differently on any platform.

  The encoding inside the file löooks like this:
  
  Stichw#246;rter:
  
  for the Letter ö.
  
  How can make GTK 2 show those chars as in GTK 1?
  
 Regards,
 Sergei

That are very helpful explanations, thanks a lot!

-- 
Marc Santhoff m.santh...@web.de


___
Lazarus mailing list
Lazarus@lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] DOM and GTK 12: how to set encoding?

2009-04-17 Thread Marc Santhoff
Hi,

I have a DOM model read from a xml file that has no encoding named
inside it. The var TXMLDocument.Encoding is empty after the file is
loaded.

WHen compiling the program for GTK 1 the german umlauts are shown
correctly, I assume GTK 1 defaults to system encoding (or so ;). The
files have been written in a GUI using the same system encoding
(ISO-8859-1).

When compiled for GTK 2 the umlauts are not shown corrctly and on the
console messages like this appear when handing over strings to gtk
widgets:

Pango-WARNING **: Invalid UTF-8 string passed to pango_layout_set_t ext()

When the texts are not used as caption but as text inside a memo, the
warning differs:

Gtk-CRITICAL **: gtk_text_buffer_emit_insert: assertion `g_utf8_val
idate (text, len, NULL)' failed

and the strings in question are left out up to the next newline.

The encoding inside the file löooks like this:

Stichw#246;rter:

for the Letter ö.

How can make GTK 2 show those chars as in GTK 1?


Regards,
-- 
Marc Santhoff m.santh...@web.de


___
Lazarus mailing list
Lazarus@lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] windowmanager interaction of lcl

2009-04-15 Thread Marc Santhoff
Hi,

I'm still having trouble using GTK or GTK2 when running Window Maker
(http://www.windowmaker.info/). Every time virtual desktops are switched
lazarus itself and any application built with it are minimized.

Is this a known bug?
Where in the LCL is the handling of window manager events?

Regards,
-- 
Marc Santhoff m.santh...@web.de

___
Lazarus mailing list
Lazarus@lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] How to update a running application

2008-12-07 Thread Marc Santhoff
Am Sonntag, den 07.12.2008, 12:24 +0100 schrieb Roland Turcan:
 Hello all,
 
 I write a small systray application which I know, that time to time we
 will need to change/add/remove something, but this application is
 started from user's startup and runs until his log off.
 
 When our update process gets newer version of it I need to close that
 application, exchange its components and start it again.
 
 On windows I solve it using messaging, but on Linux I don't know what
 is the way to inform application about my wish to terminate it.
 
 How can I solve this problem?
 
 PS: I though about : 1) signal file as flag to close itself

This is the normal way on Unix-like system. Send your program a SIGTERM
or SIGUSR1 or so. I'm not really sure if programs compiled with fpc will
terminate automatically on SIGTERM but in all cases you can register a
signal handler for SIGUSR1 and do from the program whatever you like to
to (except setting the users cat on fire maybe ;).

Try:
$ man kill
$ man sigaction

(on FreeBSD, should be similar on Lunix)

HTH,
Marc


___
Lazarus mailing list
Lazarus@lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] libusb access from Lazarus

2008-11-24 Thread Marc Santhoff
Am Montag, den 24.11.2008, 10:55 + schrieb Mark Morgan Lloyd:
 Henry Vermaak wrote:
 
  the ftdi chip is practically a usb to serial converter, so you can
  actually use that.  if you look at their windows dll api, you'll see
  that they've got a set of functions that mimic the windows serial
  functions.  otherwise there are serial comms units for fpc (but i
  haven't used any of them).
 
 I'll be looking at comms coding at some point, but more important is 
 making sure that I can run legacy arcane protocols- hence my interest in 
 DOSemu, which is good enough to run things like EPROM blasters.
 
 Does anybody use libusb-win32? If so could I have a copy of the unpacked 
 binaries- I've got NT4 systems here which do have USB low-level drivers 
 but the installer insists on NT5 and I don't want to start working out 
 how to rebuild them.

I have installed that stuff once on w2k, can you give the exact names of
the DLLs you need? (... attention, henn and egg problem
approaching ... ;)

Marc


___
Lazarus mailing list
Lazarus@lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] using two versions of RTL from lazarus

2008-11-10 Thread Marc Santhoff
Am Montag, den 10.11.2008, 16:30 +0100 schrieb Marc Santhoff:
 I'll try do use some conditionals inside my fpc.cfg, although I'm not
 sure where to find documentation on this topic someone here or on the
 fpc list showed an example some time ago (regarding compiler versions
 IIRC).

Replying to myself:

The docs are in the users guide. :)

Marc


___
Lazarus mailing list
Lazarus@lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] using two versions of RTL from lazarus

2008-11-10 Thread Marc Santhoff
Am Montag, den 10.11.2008, 10:52 + schrieb Martin:
 Florian Klaempfl wrote:
  Henry Vermaak schrieb:

  How can I use lazarus to switch between those two?

  easiest is probably to install the ppu files to different locations,
  then invent a custom define and add it to your fpc.cfg to switch
  between different versions (where the -Fu paths are defined).
 
  you don't really need to do this if you are just worried about debug
  info, since you can strip the debug info afterwards.
  
 
  This is not completetly true, when debugging it's also better to turn
  the optimizer off to get better results.

I remember a switch definition for compiling releases in fpg.cfg ...

 Another option, not perfect, but doanle, is to use --primary-config-path
 You could have to shortcuts / two startup scripts, passing a diff config 
 directory to lazarus. Each would have one of the rtl-path in it's 
 enviroment conf.
 
 It does mean to restart lazarus, in order to build releases (or start a 
 2nd instance).
 
 Alternatively, you may be able to swap you fpc.cfg file, while lazarus 
 is running, the next compile should pick up the new config.

... together with this remark it makes an idea.

I'll try do use some conditionals inside my fpc.cfg, although I'm not
sure where to find documentation on this topic someone here or on the
fpc list showed an example some time ago (regarding compiler versions
IIRC).

Thank you all,
Marc


___
Lazarus mailing list
Lazarus@lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] using two versions of RTL from lazarus

2008-11-09 Thread Marc Santhoff
Hi,

I'd like to use two version of the fpc libraries from inside lazarus,
one RTL for release/normal usage and another one compiled with debugging
symbols included.

How can I use lazarus to switch between those two?

TIA,
Marc


___
Lazarus mailing list
Lazarus@lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Lazarus repository in Git (summary)

2008-11-06 Thread Marc Santhoff
Am Donnerstag, den 06.11.2008, 15:33 +0100 schrieb
[EMAIL PROTECTED]:
  On 11/6/08, Marc Santhoff [EMAIL PROTECTED] wrote:
 
  I don't know TC and it's GUI, but for cvs and svn there is always TkCVS.
 
  Thanks, I'll take a look - though I love my CLI interface and it's
  consistent across platforms.  Maybe the next new developer in our
  company can start of with a GUI if they wish.
 
  As for Team Coherence. The website is here:
 http://www.teamcoherence.com/
 
  And here's a screenshot:
http://www.teamcoherence.com/images/vmmain.jpg
 
 BTW, Lazarus has it's own SVN GUI interface plugin in case you didn't
 know. It's named lazsvnpkg and can be found under ./components.
 Mind you it's still under developement (working on the repository browser
 right now), but basic stuff is in.

Thanks for pointing this out, I didn't know yet and will test it as soon
as possible.

I'd love to have one tool less, although the graphical tree (depending
on special comments in cvs's modules file :( ), tkdiff and lots of
warning dialogs are really helpful.

Regards,
Marc


___
Lazarus mailing list
Lazarus@lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] configure tools: show output of command

2008-10-31 Thread Marc Santhoff
Hi,

is it possible to open a window or source editor page showing the
oputput of a system command in lazarus?

E.g. I want to have a man page shown for a system function where the
cursor is at or inside the name of this function like ($CurToken()).

Can this be done by assembling a configuration item in the tools -
Configure custom tools ...-menu?

TIA,
Marc


___
Lazarus mailing list
Lazarus@lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] Delphi Modbus Library

2008-08-18 Thread Marc Santhoff
Hi,

has anyone tried translating and using this one with fpc/lazarus?:

http://sourceforge.net/projects/delphimodbus

Regards,
Marc


___
Lazarus mailing list
Lazarus@lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] unknown property when changing platform

2008-08-02 Thread Marc Santhoff
Am Donnerstag, den 31.07.2008, 18:59 +0200 schrieb Mattias Gaertner:
 On Thu, 31 Jul 2008 15:40:02 +0200
 Marc Santhoff [EMAIL PROTECTED] wrote:
 
  Hi,
  
  I have a lazarus project created and working on FreeBSD. This project
  is checked into CVS.
  
  Now I'm starting to port the project to win32, using exactly the same
  lazarus version (svn update from FreeBSD, copied over to win32, make
  clean all, project checked out from CVS).
  
  When I open the project I get a message box saying:
  
  Error reading TJITForms
  Error reading TMFrame.LCLVersion: Unknown property: LCLVersion
 
 TFrame.LCLVersion was added one or two months ago. Maybe your windows
 version of lazarus is older?

I had to do sort of a binary search to find a compilable version of
Lazarus which is 14640 currently and that's the source I copied over to
windows after make cleanall.

I think I must have started Lazarus with an intermediate version that
didn't work properly and saved my project ... although I don't remember
doing so ...
 
I think I'll fetch a precompiled binary and shut up. ;)

Thank you anyways,
Marc


___
Lazarus mailing list
Lazarus@lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] unknown property when changing platform

2008-07-31 Thread Marc Santhoff
Hi,

I have a lazarus project created and working on FreeBSD. This project is
checked into CVS.

Now I'm starting to port the project to win32, using exactly the same
lazarus version (svn update from FreeBSD, copied over to win32, make
clean all, project checked out from CVS).

When I open the project I get a message box saying:

Error reading TJITForms
Error reading TMFrame.LCLVersion: Unknown property: LCLVersion

(see attached screenshot)

My questions:

Why does this happen? The only difference is the pascal compiler, this
cannot be the cause, I think.

Will it do any harm? If IIRC it happens any time the project is opened
again.

TIA,
Marc

attachment: LCLVersion.jpg___
Lazarus mailing list
Lazarus@lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] importing program into lazarus project

2008-07-21 Thread Marc Santhoff
Am Montag, den 21.07.2008, 08:45 +0200 schrieb Graeme Geldenhuys:
 On Mon, Jul 21, 2008 at 12:38 AM, Marc Santhoff [EMAIL PROTECTED] wrote:
  I have a program written using fpc only that I'd like to import into a
  lazarus project. How can this be done the easiest way?
 
 Simply load Lazarus with a blank Lazarus project. Then open the main
 unit (program) of your fpc project using 'File | Open'...  Lazarus
 will detect it's a 'program' and ask if it can manage it. Say yes.
 Lazarus would now have created a new .lpi file for your fpc program.
 Save the project and you are ready to go.

That was it. I knew it could be done very simple, but using file-open
slipped me while looking at all those project types. :)

  And what is the difference between custom program and program
  project types,
 
 No idea what's the difference. All I know is that program is a Free
 Pascal program and Lazarus maintains the .lpi (Lazarus Project
 Information) file for that program.

The descriptions of the projects tell something about that topic.
Command line parsing may be an issue, the uses line is mostly fixed.

Thanks,
Marc


___
Lazarus mailing list
Lazarus@lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] importing program into lazarus project

2008-07-21 Thread Marc Santhoff
Am Montag, den 21.07.2008, 17:52 +0200 schrieb Vincent Snijders:
 Marc Santhoff schreef:
  Am Montag, den 21.07.2008, 08:45 +0200 schrieb Graeme Geldenhuys:
  On Mon, Jul 21, 2008 at 12:38 AM, Marc Santhoff [EMAIL PROTECTED] wrote:
  I have a program written using fpc only that I'd like to import into a
  lazarus project. How can this be done the easiest way?
  Simply load Lazarus with a blank Lazarus project. Then open the main
  unit (program) of your fpc project using 'File | Open'...  Lazarus
  will detect it's a 'program' and ask if it can manage it. Say yes.
  Lazarus would now have created a new .lpi file for your fpc program.
  Save the project and you are ready to go.
  
  That was it. I knew it could be done very simple, but using file-open
  slipped me while looking at all those project types. :)
  
 
 I'd choose Project - New project from source.

Antoher new menu entry. Those thingies seem to hide from me when I need
them. ;)

Thank you,
Marc


___
Lazarus mailing list
Lazarus@lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] smart tabs but 2 spaces tab width

2008-07-21 Thread Marc Santhoff
Am Dienstag, den 22.07.2008, 00:33 +0200 schrieb Mattias Gaertner:
 On Sat, 19 Jul 2008 06:01:43 +0200
 Marc Santhoff [EMAIL PROTECTED] wrote:

[ ... long explanation ... ]

  Can someone follow me?
 
 Yes. Smart tabs jumps to next word start of previous lines.
 
  Is this behaviour possible with any combination of editor settings?
 
 No. That's why they are called 'smart'.

LOL

I appreciate your humor very much. It was the company formerly known as
Borland who invented this feature, wasn't it? ;)

As a solution I changed my expextations of indentation style a little, I
can live with that.

Thanks,
Marc


___
Lazarus mailing list
Lazarus@lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] smart tabs but 2 spaces tab width

2008-07-18 Thread Marc Santhoff
Hi,

I'm not really happy with lazarus' tab indentation feature.

When the next line has an indentation wider than standard tab width,
which is set to 2 spaces in my case, the cursor jumps to the (delphi
like IIRC) next position aligned under the next space in the previous
line (me thinks ;).

I want to have smart tabs on, because I don't need to hit tab several
times for deep indentations, but the stop should be only 2 places more
than the start of the word in the previous line above ... difficult to
explain.

Look here, if I have this:

case ButtonType of
nbFirst:  lb.ItemIndex := 0;
nbLast:   begin

and want to write that:

  case ButtonType of
nbFirst:  begin
lb.ItemIndex := 0;
...
  end;
nbLast:   begin

When hitting enter with the cursor before lb.itemIndex it is indented
to align with nbFirst. If I hit TAB with smart tabs off I have to do
that a couple of times - too often.

If I do the same with smart tabs on, the first TAB aligns with the colon
after nbFirst, the second aligns one char after the of two lines
above (the case line). This second TAB should align two spaces wide,
not to any end of word.

Can someone follow me?
Is this behaviour possible with any combination of editor settings?

TIA,
Marc


___
Lazarus mailing list
Lazarus@lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Java's Document Elements model

2008-06-27 Thread Marc Santhoff
Am Freitag, den 27.06.2008, 09:09 +0200 schrieb Graeme Geldenhuys:
 On 27/06/2008, Mattias Gaertner [EMAIL PROTECTED] wrote:

   Please try something like fpc/packages/univint/src/MacOSAll.pas.
   Jump to the end of the file and see what happens to the highlighting
   and your CPU.
 
 That is impressive. SynEdit handles a 10.2Mb file without problems.
 Even Gnomes gEdit slows down on that file, but it's way better that
 KDE's Kate or KWrite editors. The latter two are quite slow, until
 it's all caches.  Even Midnight Commanders internal 'mcedit' editor
 works quicker than KDE's ones. That's clearly something the KDE
 developers screwed up - seeing that Qt rates performance quite high.

FWIW:

I tried that in JEdit (a Java editor having pascal syntax highlighting
using the swing toolkit). It appears that:

- I had to increase the java heap size to get that file loaded (in a
session having 15 or so other files, some small, some big) from 32MB to
64 MB - other programs would not have this limit but suck in system
memory at will

- loading the file took some time (~1-3 seconds) amongst all other files

- when hitting CTRL-Down the first time the CPU usage goes up a
noticable step and a short pause occured (~2s)

- when browsing around by keyboard after the first move to the eof I did
*not* note any slow down or extraordinary load

- when scrolling the file using mouse and scrollbar the cpu load does go
up, but it works without delay

Concluding I'd say JEdit handles this file without problems.

Marc


___
Lazarus mailing list
Lazarus@lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Bug using Lazarus under KDE (minimizing)

2008-06-06 Thread Marc Santhoff
Am Freitag, den 06.06.2008, 11:32 +0200 schrieb Graeme Geldenhuys:
 Hi,
 
 Another issue when using Lazarus under KDE. This seems to be a Lazarus
 issue, because my fpGUI based applications do not behave like this.
 Every time I switch desktops and return to the desktop that is running
 Lazarus, all the Lazarus windows are minimized. That's 5-7 windows I
 have to restore one by one, every time!!
 
 Under Gnome, FVWM2 this never happened.  I'm running Lazarus v0.9.25
 r15115M i386-linux-gtk.  This is enough to make me stop using Lazarus,
 as I switch desktops quite often during my work.
 
 Anybody got a work-around or other solution for this?  And compiling
 Lazarus to GTK2 or KDE is not an option. GTK1 is far more stable and
 responsive.

Me too.

When using WindowMaker on FreeBSD and the same happens every time when
switching virtual desktops.

If single windows (editor+messages) are restored (not the main window)
they mostly hold their state after switching and (CTRL-)F9 works, too.

svn rev. 14640 here ...

Marc


___
Lazarus mailing list
Lazarus@lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Bug using Lazarus under KDE (minimizing)

2008-06-06 Thread Marc Santhoff
Am Freitag, den 06.06.2008, 12:11 +0200 schrieb Marc Santhoff:

 Me too.

Using GTK1 and GTK2 triggers this behaviour.

Marc


___
Lazarus mailing list
Lazarus@lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Postgres Dlls not found

2008-05-31 Thread Marc Santhoff
Am Samstag, den 31.05.2008, 13:31 +0200 schrieb Dave Coventry: 
 Yes, DLL hell it is.
 
 That's why I was dismayed to see that PQconnection used the DLL (and
 not just one, it uses several).
 
 But I suppose if there's a good reason for it

Most databases do it that way, e.g. Firebird and MySQL do have a client
side installation relying on a dll/so, too.

The library is the communication stub on the client side. Inside there
is the implementation of the communication protocoll which is mostly
unique for each sql server.

If the communication was done using the command line this would involve
a shell, the utility program and ssh/ssl. Looking at ssh would be using
what? A library implementing the communication protocoll on the client
side ... but one had to deal with moving query and result to and from a
TProcess or something. How would you do that when multiple result were
to transfer from the server? What if the variable $LANG was set by the
user? Do the lines transferrred as text end on #10, #13 or #10 + #13?
How would error codes from the server or the connection shell would be
differentiated from each other and handled?

Having a library eliminating a lot of such problems and encapsulating
the rest is not that bad. It costs you having to care for one thing: the
client computer has to have the correct dll/so or client package
installed that fits the server version in use.

Regards,
Marc


___
Lazarus mailing list
Lazarus@lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Postgres database again...

2008-05-28 Thread Marc Santhoff
Am Mittwoch, den 28.05.2008, 12:15 +0200 schrieb Graeme Geldenhuys:
 2008/5/28 Graeme Geldenhuys [EMAIL PROTECTED]:
  2008/5/28 Bogusław Brandys [EMAIL PROTECTED]:
  straight GUIDs (e.g. generated by Delphi written application) has their
  significant part at the end which does not provide for optimal indexing. 
  Use
  of the UDF generating UUID (reverse GUID) is said to improve performance
  over the PK dramatically.
 
  I'll try and find the code for the 'UDF generating UUID (reverse
  GUID)' and create a tiOPF OID generator for it.
 
 Under Linux, it seems FPC gets the kernels UUID when you ask to create
 a GUID via CreateGUID().  Plus the GUID/UUID returned is totally
 random, to parts are the same as the previous request.
 
 eg;
 
 [EMAIL PROTECTED]:~$ cat /proc/sys/kernel/random/uuid
 ca65c9ce-b097-4ff0-8a1a-7f41628e9982
 [EMAIL PROTECTED]:~$ cat /proc/sys/kernel/random/uuid
 c29650af-5562-4669-967d-5227402c0252
 [EMAIL PROTECTED]:~$ cat /proc/sys/kernel/random/uuid
 f757c538-70eb-4432-b094-dc3ad5b824f5
 [EMAIL PROTECTED]:~$ cat /proc/sys/kernel/random/uuid
 4a8dca85-2040-4fe5-afa2-dfeb5066c731
 [EMAIL PROTECTED]:~$ cat /proc/sys/kernel/random/uuid
 e576429b-fdf9-485a-b9f5-3319a2067b24
 [EMAIL PROTECTED]:~$ cat /proc/sys/kernel/random/uuid
 f7335eb4-26bc-4467-8d99-04a3ef8702fd
 
 
 So I can't see the point in reversing the returned string.  Maybe
 Delphi or Windows works different and some parts are the same as the
 previous request.

This is where the low-high-scheme may be a good appraoch.

Get the high part from the key server at startup  or when needed because
the lower part space is exhausted once and add a timestamp for the lower
part on every new key. That way the ids are pretty compressable.

Marc


___
Lazarus mailing list
Lazarus@lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Inactive Dataset

2008-05-28 Thread Marc Santhoff
Hi,

I'm not really sure if this is a cp-error or the like, but ...

Am Mittwoch, den 28.05.2008, 10:32 +0200 schrieb Dave Coventry:
 Sorry,
 
 I should have been more specific
 
 SQLQuery1.SQL.Text:='SELECT fname,
 sname,id,comboboxcourse,studentnumber,enquirydate,enquiryreferencenumber
 from registration WHERE fname=''Dave''';
   StringGrid1.RowCount:=2;
   SQLQuery1.SQL.Text:=sqlq;

... here you assign another string named sqlq and overwrite the nice SQL
from above.

Maybe that line is still in your code messing up the query?

HTH,
Marc

   SQLQuery1.Open;
   SQLQuery1.First;
   while not SQLQuery1.EOF do
   begin
 StringGrid1.Cells[0,i]:=SQLQuery1.FieldByName('fname').AsString;
 StringGrid1.Cells[1,i]:=SQLQuery1.FieldByName('sname').AsString;
 StringGrid1.Cells[2,i]:=SQLQuery1.FieldByName('id').AsString;
 StringGrid1.Cells[3,i]:=SQLQuery1.FieldByName('comboboxcourse').AsString;
 StringGrid1.Cells[4,i]:=SQLQuery1.FieldByName('studentnumber').AsString;
 StringGrid1.Cells[5,i]:=SQLQuery1.FieldByName('enquirydate').AsString;
 
 RecNumber:=RecNumber+','+SQLQuery1.FieldByName('enquiryreferencenumber').AsString;
 inc(i);
 StringGrid1.RowCount:=i+1;
   end;
   SQLQuery1.Close;
 
 On Wed, May 28, 2008 at 9:01 AM, Dave Coventry [EMAIL PROTECTED] wrote:
  Hi,
 
  I'm getting this: operation cannot be performed on an inactive dataset.
 
  Googling (I'm on a slow dialup on someone else's line) seems to
  indicate that the problem is with my Lazarus version.
 
  The version I'm using is 0.9.23 beta SVN rev 12712.
 
  I obviously can't download a new version of Lazarus...
 
  Can anyone advise me?
 
 ___
 Lazarus mailing list
 Lazarus@lazarus.freepascal.org
 http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
 

___
Lazarus mailing list
Lazarus@lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] layout managers

2008-05-23 Thread Marc Santhoff
Hi,

is there something like Javas layout managers available for Lazarus?

I think a simple TBorderLayout would suffice, although I'd like to know
other approaches that are similarly easy to use, especially when writing
form building code by hand. Or maybe a tutorial explaning how to use
Lazarus' standard classes in an efficient way.

The only thing I found so far is the widgetgrid from MSEgui - that could
be a starting point.

TIA,
Marc


___
Lazarus mailing list
Lazarus@lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] target filename extension

2008-05-21 Thread Marc Santhoff
Am Mittwoch, den 21.05.2008, 14:13 +0200 schrieb Graeme Geldenhuys:

 Example:
 
 [EMAIL PROTECTED]:tmp$ ls -l untit*
 -rw-r--r-- 1 graemeg graemeg  7280 2008-05-21 13:50 untitled1
 -rw-r--r-- 1 graemeg graemeg  2311 2008-05-21 13:51 untitled2
 -rw-r--r-- 1 graemeg graemeg 96256 2008-05-21 13:51 untitled3
 
 Here it lists three files of different types. OpenDocument Text, Rich 
 Text and MS Word respectively.  You have no idea knowing that from the 
 command line, other than using some hex editor to peak at the first 3-5 
 bytes of the file (a process way above the avg user).
 
 As a test, I opened Nautilus. As with most Linux apps, it normally 
 detects the file via it's magic number or something, not the file 
 extension. The first two worked by simply double clicking on them, but 
 it had no idea what 'untitled3' was (MS Word document). Strange!

$ file unti*

should do:

$ file *
Physik_Praktikum 6.xls: Microsoft Office Document
Versuch 3a.doc: Microsoft Office Document
Versuch 6a.doc: Microsoft Office Document
Zugefestigkeit: directory
Zugversuch.pdf: PDF document, version 1.4

So file does know at least ms-word documents. I think

$ man file

or

$ man magic

wil tell a lot about it. MAc does have a BSD userland too and thus there
is magic (=the database for detecting file types).

 Using file extensions simply gives you a nice fallback option (hint) as 
 to what mime type it is.

Connecting applications and MIME types is a different thing.

  .linux or .elf
 
 I like .elf!  :-)

$ file enum
enum: ELF 32-bit LSB executable, Intel 80386, version 1 (FreeBSD), statically 
linked, stripped

H... ;)

Marc


___
Lazarus mailing list
Lazarus@lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] embedding fomrs into forms

2008-05-19 Thread Marc Santhoff
Am Montag, den 19.05.2008, 09:09 +0200 schrieb Marco van de Voort:
 On Mon, May 19, 2008 at 12:06:40AM +0200, Marc Santhoff wrote:
  
My goal is to have a core programm and some additional parts delivered
separately. Compiling the program for every permutation of combinations
is not quite usable if the count of extras goes up.
   
   Packages is the only long term way. Unless your interface between the DLL
   and the program can be really limited and rigid. Then you might have luck
   the manual way.
  
  I don't understand, do you say, packages are dynamically loadable? I
  thought of them as statically linkable organizational containers.
  
  If a user has installed the basic program, can I send him a package that
  can be loaded at statup extending the program?
 
 Only by loadlibrary calls. (which must then be in the startup), and of
 course the interface must be known. But in general yes.

The interface will be small and I'm free to define it at will. But that
doesn't solve the problems using LCL in libraries, does it?

The wiki article about library packages showed that someone actually
succeded in compiling the RTl to a dynlib, that may be woth a test
(combined with loadlibrary).

 Keep in mind that designtime packages are implemented using library packages
 inside Delphi.  Delphi isn't recompiled for them :_)

Interesting, I stopped using Delphi shortly after version 3 was out. ;)

Marc


___
Lazarus mailing list
Lazarus@lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] embedding fomrs into forms

2008-05-19 Thread Marc Santhoff
Am Montag, den 19.05.2008, 19:58 +0200 schrieb Mattias Gaertner:
 On Mon, 19 May 2008 12:54:45 +0200
 Marc Santhoff [EMAIL PROTECTED] wrote:
 
  Am Montag, den 19.05.2008, 09:09 +0200 schrieb Marco van de Voort:
   On Mon, May 19, 2008 at 12:06:40AM +0200, Marc Santhoff wrote:

  My goal is to have a core programm and some additional parts
  delivered separately. Compiling the program for every
  permutation of combinations is not quite usable if the count
  of extras goes up.
 
 Packages is the only long term way. Unless your interface
 between the DLL and the program can be really limited and
 rigid. Then you might have luck the manual way.

I don't understand, do you say, packages are dynamically
loadable? I thought of them as statically linkable organizational
containers.
 
 Note:
 The term 'package' has many meanings.
 A 'lazarus package' is a set of files/directories with some extras
 like compiler settings, output directory, i18n directory. It can be
 used to compile ppus, or to compile a static or dynamic library.
 A 'delphi package' is almost always a set of units with a dll (named
 bpl) as target. 

That part is clearly described in the wiki.

 It uses some compiler magic to allow sharing
 classes/types and RTL between dynamic linked libraries.
 FPC fully supports static libraries and 'normal' dynamic libs and
 platform independently. But is does not yet provide the compiler magic
 to share classes/types between dynamic libs. So, you can use the LCL as
 static lib, but not as dynamic lib (at least not comfortable). When it
 will, lazarus packages can be compiled to dynamic libs. It is possible
 to do the magic manually, but it is complicated.

I see. Thanks for being verbose.

If a user has installed the basic program, can I send him a
package that can be loaded at statup extending the program?
   
   Only by loadlibrary calls. (which must then be in the startup), and
   of course the interface must be known. But in general yes.
  
  The interface will be small and I'm free to define it at will. But
  that doesn't solve the problems using LCL in libraries, does it?
  
  The wiki article about library packages showed that someone actually
  succeded in compiling the RTl to a dynlib, that may be woth a test
  (combined with loadlibrary).
 
 Yes, it is possible with loadlibrary. But you also must call the
 initialization/finalization sections manually of *all* used units in
 the correct order.

Okay, so I can only reject that idea. My knowledge of such internals is
too small to take that risk.

   Keep in mind that designtime packages are implemented using library
   packages inside Delphi.  Delphi isn't recompiled for them :_)
  
  Interesting, I stopped using Delphi shortly after version 3 was
  out. ;)
 
 Keep in mind, that all dynamic libs must fit exactly. This means
 every package must be compiled and provided for every supported
 version. In case of Delphi this means a a new version every 1-3 years.
 In case of lazarus/fpc it means several versions a year multiplied by
 all supported platforms. And all the users that use snapshots or svn
 must compile the packages anyway.
 So dynamic libs are least useful for developers, which is why there is
 not much done yet.

Not very attractive regarding lazarus itself ...

  Probably someone must provide a bounty.

Maybe next time. Even if I would, the time frame for waiting on this
feature and the risk with new implementations would both be too big.

I'll have to try to convince anybody involved that change concept is
better than use java then. :(

Thanks for making things clear,
Marc

-- 
I am Microsoft of Borg. Resistance izkxGPF 0x5654 8820
Application RESIST.EXE has performed an illegal operation and will be
shut down.

___
Lazarus mailing list
Lazarus@lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] embedding fomrs into forms

2008-05-18 Thread Marc Santhoff
Am Samstag, den 17.05.2008, 16:30 +0200 schrieb Mattias Gaertner:
 Putting LCL controls into a dynamic linked library is only possible
 with more or less dirty tricks. This is independent of nesting forms.

What are these tricks?

I read about shared libs in the wiki reagrding RTL/VMT duplication and
having a shared memory manager. A quick test switching program and
form-contaning dll to cmem did not help.

My goal is to have a core programm and some additional parts delivered
separately. Compiling the program for every permutation of combinations
is not quite usable if the count of extras goes up.

Marc


___
Lazarus mailing list
Lazarus@lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] embedding fomrs into forms

2008-05-18 Thread Marc Santhoff
Am Sonntag, den 18.05.2008, 23:18 +0200 schrieb Marco van de Voort:
 On Sun, May 18, 2008 at 06:12:27PM +0200, Marc Santhoff wrote:
  Am Samstag, den 17.05.2008, 16:30 +0200 schrieb Mattias Gaertner:
   Putting LCL controls into a dynamic linked library is only possible
   with more or less dirty tricks. This is independent of nesting forms.
  
  What are these tricks?
 
 Exactly controlling the state of the RTL. Either to be exactly the same in
 the dynlib and the mainprogram, at least for the cases that matter.
  
  I read about shared libs in the wiki reagrding RTL/VMT duplication and
  having a shared memory manager. A quick test switching program and
  form-contaning dll to cmem did not help.
 
 That is correct, those are the most important ones. There is no end user
 safe way to my knowledge, just limited experiments of people that knew what
 they were doing. (or were lucky)

So no way to go for production software (at least for me ;).

  My goal is to have a core programm and some additional parts delivered
  separately. Compiling the program for every permutation of combinations
  is not quite usable if the count of extras goes up.
 
 Packages is the only long term way. Unless your interface between the DLL
 and the program can be really limited and rigid. Then you might have luck
 the manual way.

I don't understand, do you say, packages are dynamically loadable? I
thought of them as statically linkable organizational containers.

If a user has installed the basic program, can I send him a package that
can be loaded at statup extending the program?

Marc


___
Lazarus mailing list
Lazarus@lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] embedding fomrs into forms

2008-05-17 Thread Marc Santhoff
Hi,

is it possible to use a TForm inside a TForm?

Imagine a program consisting of a frame and some plug-ins. The plug-ins
should get designed using lazarus, each having it own form. When loaded
those forms would be embedded into the main applications form as a
frame, e.g. each on a tab of a notebook or similar.

If it is not possible, what alternative ways of designing something like
that should I consider?

TIA,
Marc


___
Lazarus mailing list
Lazarus@lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] embedding fomrs into forms

2008-05-17 Thread Marc Santhoff
Am Samstag, den 17.05.2008, 14:15 +0200 schrieb Marc Santhoff:
 Hi,
 
 is it possible to use a TForm inside a TForm?
 
 Imagine a program consisting of a frame and some plug-ins. The plug-ins
 should get designed using lazarus, each having it own form. When loaded
 those forms would be embedded into the main applications form as a
 frame, e.g. each on a tab of a notebook or similar.

Testing showed it does not work, if done like this:

procedure TForm1.FormCreate(Sender: TObject);
var
  f2: TForm;
begin
  f2 := TForm2.Create(Panel2);
  f2.show;
end;

the secomd form is shown seperately and managed by the window manager.
Using MDI didn't do it either.

 If it is not possible, what alternative ways of designing something like
 that should I consider?

The last possibilities I see are streaming parts of the form myself or
using the dock manager thingy. Can someone explain how docking would be
done (or point me to the docs), please?

Marc


___
Lazarus mailing list
Lazarus@lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] embedding fomrs into forms

2008-05-17 Thread Marc Santhoff
Am Samstag, den 17.05.2008, 16:34 +0300 schrieb
Kostafile:home/marc/.evolution/cache/tmp/drag-n-drop-CzHRMD/Nachrichten_von_Lazaruss
 Michalopoulos:
 It is possible. Check the Lazarus Forum for a procedure i posted a while 
 back that embeds a form inside a TWinControl by reparenting the form 
 controls and keeping the form itself in memory so local (in form class) 
 variables will still work.

I'll do that, thanks.

 However currently it is not possible to use LCL with a DLL. I tried it, in 
 order to create a control from a DLL that will be used and it failed 
 (crashes, etc). I don't know enough about LCL internals to say why though.

Hmm, that makes the complete idea of plugins obolete somehow ...

Did you link your program against the dll or was the loading done
dynamically? (On *nix there is dlopen/dlclose and dlsym for dynamically
loading libraries, I don't know the windows equivalent of those)

Many thanks,
Marc


___
Lazarus mailing list
Lazarus@lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] menus, buttons and actions

2008-05-16 Thread Marc Santhoff
Hi,

I'm not very often using lazarus (hoping this will change ;) and I did
not find anything in the sources, so I'd like to know:

Is there anything like javas action objects that can be bound to menus
and buttons executing the command and managing activation state
prefabricated in lazarus?

TIA,
Marc


___
Lazarus mailing list
Lazarus@lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] menus, buttons and actions

2008-05-16 Thread Marc Santhoff
Am Freitag, den 16.05.2008, 22:08 +0200 schrieb Marc Santhoff:
 Hi,
 
 I'm not very often using lazarus (hoping this will change ;) and I did
 not find anything in the sources, so I'd like to know:
 
 Is there anything like javas action objects that can be bound to menus
 and buttons executing the command and managing activation state
 prefabricated in lazarus?

Forget about it, I was spontaneously healed from temporary blindness and
am using TActionList and TAction from now on. X-)

Marc


___
Lazarus mailing list
Lazarus@lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] compiling 0.9.24 on win32 fails

2008-04-22 Thread Marc Santhoff
Hi,

at first I'd like to ask, if Windows 98 (SE) is still on the list of
supported platforms. Is it?

If the answer is yes notice the following report, please:

make clean all:

Compiling FindRenameIdentifier.pas
Compiling CleanDirDlg.pas
Main.pp(1110,35) Warning: Constructing a class TPkgManager with abstract metho
ds
Compiling resource lazarus.rc
GCC.EXE: installation problem, cannot exec `cpp': No such file or directory
D:\FPC\2.2.0\bin\i386-win32\windres.exe: no resources
lazarus.pp(114,1) Error: Error while linking
lazarus.pp(114,1) Fatal: There were 1 errors compiling module, stopping
Fatal: Compilation aborted
MAKE.EXE[2]: *** [lazarus.exe] Error 1
MAKE.EXE[2]: Leaving directory `D:/lazarus/ide'
MAKE.EXE[1]: *** [ide] Error 2
MAKE.EXE[1]: Leaving directory `D:/lazarus/ide'
D:\FPC\22~1.0\BIN\I386-W~1\MAKE.EXE: *** [ide] Error 2

D:\lazaruscpp -v
GNU CPP version 2.95 19990728 (release) (80386, BSD syntax)
#include ... search starts here:
End of search list.
The following default directories have been omitted from the search path:
 /gcc-2.95/lib/gcc-lib/i386-mingw32/2.95/../../../../include/g++-3
 /gcc-2.95/lib/gcc-lib/i386-mingw32/2.95/../../../../include
 /gcc-2.95/lib/gcc-lib/i386-mingw32/2.95/../../../../i386-mingw32/include
 /gcc-2.95/lib/gcc-lib/i386-mingw32/2.95/include
 /usr/local/i386-mingw32/include
End of omitted list.

Versions:

fpc-2.2.0.i386-win32.exe
fpcbuild-2.2.0.tar.gz
lazarus-0.9.24-0.tar.gz

I've done:

- Download the packages listed above
- Installed fpc to d:\fpc\2.2.0\ (system partition and drive)
- Unpacked the lazarus archive to d:\lazarus

The bin directory of fpc is in the path.

How can I continue?

TIA,
Marc


___
Lazarus mailing list
Lazarus@lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] compiling 0.9.24 on win32 fails

2008-04-22 Thread Marc Santhoff
Am Dienstag, den 22.04.2008, 16:57 +0200 schrieb Bernd Mueller:
  Compiling resource lazarus.rc
  GCC.EXE: installation problem, cannot exec `cpp': No such file or directory
 
 it works for me (Win98SE), if you copy cpp.exe into the lazarus\ide 
 directory.

Thank you, so I can continue using this workaround.

But still there is something fishy and some potential to shoot in the
own foot, e.g. when a new version of cpp is used ... but it is zombified
win98 nonetheless.

Marc

___
Lazarus mailing list
Lazarus@lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] compiling 0.9.24 on win32 fails

2008-04-22 Thread Marc Santhoff
Am Dienstag, den 22.04.2008, 17:06 +0200 schrieb Vincent Snijders:
 Marc Santhoff schreef:
  Hi,
  
  at first I'd like to ask, if Windows 98 (SE) is still on the list of
  supported platforms. Is it?
  
 
 Yes. But it needs special care.
 
  If the answer is yes notice the following report, please:
  
 
 Add D:\FPC\2.2.0\bin\i386-win32\ to your PATH

I did, see the end of the problem report.

 or
 Use fpc 2.2.1 ot later.

I see, so this problem is known and adressed already.

Good news, thank you very much,
Marc


___
Lazarus mailing list
Lazarus@lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] I only would like to understand...

2008-04-19 Thread Marc Santhoff
Am Freitag, den 18.04.2008, 23:33 +0200 schrieb Vincent Snijders:
 Arí Ricardo Ody schreef:
  I posted a question about hexadecimal addresses of interruptions in 
  FPC/Lazarus. I need to post the same questions 3 times till receive 
  some answer. The answers was given by too guys that are in a certain 
  view friends of mine. I think that answered because of these kind of 
  friendship.
  
  I would like to understand why some questions are never answered 
  here... This is not the first time I post a question and nobody answer...
  
  I'm only trying to understand. No offense.
 
 I never had to tackle that question, because if I want to have more 
 information, I compile with -gl.
 
 Usually, if you compile with -gl, you don't need to interprete the 
 hexadecimal addresses, because you get a file and line number.
 
 I have no explanation, why you don't have file and line number, so I 
 cannot help you.

The cause may be that only the current unit is compiled with -gl and
others belonging to the project are not.

In that case the switch -B for build all is helpful.

fpc -gl -B main program source

HTH,
Marc


___
Lazarus mailing list
Lazarus@lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Supported Lazarus platforms

2008-02-22 Thread Marc Santhoff
Am Freitag, den 22.02.2008, 12:44 +0200 schrieb Graeme Geldenhuys:
 On 22/02/2008, Marco van de Voort [EMAIL PROTECTED] wrote:
 
  Like? Note that the password stuff is now in both 2.2.1 and 2.3.x in the
   users package.
 
 getgrgid()  - Used for getting the Group ID Name from the Group ID.
 getpwuid() - Used for getting the User Name from the User ID.
 
 Both of these are used in a FileGrid component (eg: File Open Dialog)
 to display a files User and Group names like  graemeg:usersinstead
 of  5000:3000
 
 My work-around for FreeBSD is to display the numeric values only. I'm
 thinking of looking up the values manually in /etc/groups and
 /etc/passwd but was told it can be inaccurate.

Seems you did not read the answer I gave you on that issue:


 The functions getlogin(2), getpwnam(3) and getgrnam(3) should be it.
 Look at the man pages how to use them.
 (this is on freebsd 4, should not have changed moving to 6 or 7)
 
 I don't know if they are wrapped by fpc or what the names would be
 (maybe fpXxxx as always).

But that would need ifdefs and libc, too. ;)

Have fun,
Marc


___
Lazarus mailing list
Lazarus@lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus