Re: [lazarus] New Version of Lazarus (FPC 2.0.4)

2006-09-28 Thread Marc Weustink

Bisma Jayadi wrote:

Is v.0.9.18 based on FPC 2.0.4?

Yes.


Why there's no official news or press release about 0.9.18? I found this 
new version after I visit Lazarus download link, but I can't find any 
news regarding this on the Lazarus main page.


The start of this thread:

Mattias Gaertner wrote:
 On Wed, 27 Sep 2006 17:28:21 +0100
 Kris Leech [EMAIL PROTECTED] wrote:

 Is the new version of Lazarus that uses FPC 2.0.4 offically released
 yet?

 Not yet.
 I have some hardware problems.


 Mattias

So it is not officially released yet, so no news.

Marc

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


Re: Lazarus bug report

2006-09-28 Thread Marc Weustink

Christian Ulrich wrote:

Marc Weustink wrote:


Christian Ulrich wrote:
 


and maybe an forum integrated as in freepascal site, but thats no main
task i think.
  


Why do you think moving the forum is easy ?

Marc
 

I donsend have sayed thats easy to move the forum but registering dont 
work so its no main task to move it because its mostly useless.

must the forum be moved ??


You think 12234 articles and 1557 users is useless ?


the forum is an standart forum, isnt it ?


Yes it is. If you cannot register, it usually means that the 
subscription email cannot be delivered to you.
It might that you or your provider is blocking mail from miraclec.com, 
or that there is something with the address used that the forum software 
doesn't understand.



so maybe it can be used and only the design changed to the wiki style.


A forum on wiki
They have 2 totally different purposes.

Marc



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


[lazarus] avoiding multi-instance detection

2006-09-28 Thread Alejandro Lucas Baldres
Hello, I'm buy a program, this no can allow more of a instance. ¿How to for no allow more of one instance?Thank you and sorry for my bad english-- Lucas BaldrésUsuario linux #: 425616
Maquina #: 333252


[lazarus] Sqlite for a newbie

2006-09-28 Thread Sezer KUTLUK
Hi,
I read the wiki and tried to install the sqlite
components. But Lazarus couln't be built, there was a
compilation problem, saying something like can't find
the unit...

Is there any other document about installing and basic
using for dummies ?

Thanks.

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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


Re: [lazarus] avoiding multi-instance detection

2006-09-28 Thread Bogusław Brandys

Alejandro Lucas Baldres wrote:
Hello, I'm buy a program, this no can allow more of a instance. ¿How to 
for no allow more of one instance?


Thank you and sorry for my bad english

--
Lucas Baldrés
Usuario linux #: 425616
Maquina #: 333252


Try to describe in simpler words :)
Which platform ? Linux,Windows,Mac ?
You buy or you made and sell ?
Program disallow more then one instance or you want it to do this ?


Regards
Boguslaw

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


Re: [lazarus] avoiding multi-instance detection

2006-09-28 Thread Alejandro Lucas Baldres
My plataform i386 with Linux (ubuntu dapper 6.06), the future of program is free and opensource.I want the program disallow more then one instance.2006/9/28, Bogusław Brandys 
[EMAIL PROTECTED]:Alejandro Lucas Baldres wrote:
 Hello, I'm buy a program, this no can allow more of a instance. ¿How to for no allow more of one instance? Thank you and sorry for my bad english -- Lucas Baldrés Usuario linux #: 425616
 Maquina #: 333252Try to describe in simpler words :)Which platform ? Linux,Windows,Mac ?You buy or you made and sell ?Program disallow more then one instance or you want it to do this ?
RegardsBoguslaw_ To unsubscribe: mail [EMAIL PROTECTED] withunsubscribe as the Subject
 archives at http://www.lazarus.freepascal.org/mailarchives-- Lucas BaldrésUsuario linux #: 425616
Maquina #: 333252


[lazarus] Re: Lazde extension

2006-09-28 Thread Funky Beast

Graeme Geldenhuys wrote:

Hi,

Any objections if I extend Lazde, so we can insert special characters
much easier in the documentation.  I was thinking of doing something
like Lazarus - using a screen like the Character Map.

For example.  If I wanted to insert a ampersand (), select it from
the Character Map like screen and it will insert the escaped version
amp;

Any better ideas?

Regards,
 - Graeme -




Hi Graeme,

I have an incompletely extended Lazde whick i worked on as
a hobby over 4 months ago which can achieve that. You type your
amperand () or less than () or greater tnan () characters
in the editor as you would, and it will get converted into its
escaped version back into the document tree. Likewise, it converts
the escaped version to your usual single character version before
displaying it on the editor.

Other extensions include:
***
Editing tables -- Parse and extract tables and their positions and content
from the currently focused memo content to a form where you an select
a specific table from a table list and edit its content. After you're done
editing your tables and click OK, it will be inserted back into the memo's
content at the exact position where the original tables were with your
modified table.

Inserting and editing lists -- li ul ol
A form for inserting lists. The editing part is roughly the same concept as
editing tables above.

Inserting topic when a package node is selected will insert the topic as
a package topic.

Inserting a topic when a package topic node is selected will insert the topic
as a subtopic of the package topic. (Of course it will check if the sublevel
is more than 2, which is fpdoc's convention)

Inserting topic when a module node is selected will insert the topic as a
module topic.

View as plain text capabilities for Short, Description, and error contents.
That is your can preview your contents as plain text by clicking a checkbox.
*

Its incomplete because over 4 months ago, my laptop K.O.ed (my only development 
tool)
before i could solve all the AVs and execptions from the original lazde
which im sure you've encountered.
After I've got myself a new laptop i decided to try out a source-base distro 
(Gentoo)
after using so many binary distros, where i spent 2 months of RTFM to get my
laptop to do everything exactly i want it to.
And now i have backlog projects from my boss :-( (actually wishlist projects).

I'm not sure how much xml has evolved in FPC during these 4 months, and if
it broke what i wrote. I haven't touched it for more than 4 months, must have
a lot of conflicts with the svn version.

So if you're interested, i can try to clear all the conflicts,
zip the whole doceditor directory and write a summary of what
as far as i can remember what i've added to lazde and email to you.

Regards
Funky Beast.

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


Re: [lazarus] Re: Lazde extension

2006-09-28 Thread Graeme Geldenhuys

On 28/09/06, Funky Beast [EMAIL PROTECTED] wrote:

So if you're interested, i can try to clear all the conflicts,
zip the whole doceditor directory and write a summary of what
as far as i can remember what i've added to lazde and email to you.

Regards
Funky Beast.


Some of your ideas I wanted to start implementing, like the list
editor, etc...  Your code should same me some time, so please send the
code, and I will implement them back into lazde.  You email it to my
current email address.

Regards,
 - Graeme -

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


Re: Lazarus bug report

2006-09-28 Thread Howard Lee Harkness
Yup. Yesterday, I got emails to all of the email addresses I used while trying to register over the past few days. I'm now successfully registered.
On 9/28/06, Michael A. Hess [EMAIL PROTECTED] wrote:
On Thu, 28 Sep 2006, Christian Ulrich wrote: I donsend have sayed thats easy to move the forum but registering dont
 work so its no main task to move it because its mostly useless. must the forum be moved ?? the forum is an standart forum, isnt it ? so maybe it can be used and only the design changed to the wiki style.
The forum server had an issue with it's mail server due to a hardwareproblem a few days earlier. It was resolved yesterday and should beworking now.-- Programming my first best destiny! 
Michael A. HessMiracle Concepts, Inc.[EMAIL PROTECTED] http://www.miraclec.comPhone: 570-388-2211Fax: 570-388-6101
_To unsubscribe: mail [EMAIL PROTECTED] with unsubscribe as the Subject
archives at http://www.lazarus.freepascal.org/mailarchives-- 
[EMAIL PROTECTED] 


Re: [lazarus] avoiding multi-instance detection

2006-09-28 Thread Bogusław Brandys

Alejandro Lucas Baldres wrote:
My plataform i386 with Linux (ubuntu dapper 6.06), the future of program 
is free and opensource.

I want the program disallow more then one instance.


The simplest solution: let program check if /tmp/filename file exists 
and create it,then on exit delete.If file exists then instance is 
already running.

More complex would be using IPC (maybe others could describe)

Regards
Boguslaw

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


Re: [lazarus] avoiding multi-instance detection

2006-09-28 Thread ik

Another way, that is easier to control, is to use mutexes.
Mutex is a place in memory that is locked until someone free it. So
you can check if that place (usually mapped to a name, alto I do not
remember at the moment how Linux implement it) exists, and if so, you
stop your own execution, otherwise you can continue the loading.

Ido

On 9/28/06, Bogusław Brandys [EMAIL PROTECTED] wrote:

Alejandro Lucas Baldres wrote:
 My plataform i386 with Linux (ubuntu dapper 6.06), the future of program
 is free and opensource.
 I want the program disallow more then one instance.

The simplest solution: let program check if /tmp/filename file exists
and create it,then on exit delete.If file exists then instance is
already running.
More complex would be using IPC (maybe others could describe)

Regards
Boguslaw

_
 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 bug report

2006-09-28 Thread Micha Nelissen
Howard Lee Harkness wrote:
 Yup. Yesterday, I got emails to all of the email addresses I used while
 trying to register over the past few days. I'm now successfully registered.

Thank you for confirming.

Micha

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


Re: Lazarus bug report

2006-09-28 Thread Christian Ulrich

Michael A. Hess wrote:


On Thu, 28 Sep 2006, Christian Ulrich wrote:

 


I donsend have sayed thats easy to move the forum but registering dont
work so its no main task to move it because its mostly useless.
must the forum be moved ??
the forum is an standart forum, isnt it ?
so maybe it can be used and only the design changed to the wiki style.
   



The forum server had an issue with it's mail server due to a hardware
problem a few days earlier. It was resolved yesterday and should be
working now.
 



I have registered bevore 1 year and cannot acces my account since 2 
month after i registered.
Thats no mail server issue, i read on several delphi forums around that 
the people coudnt register to lazarus forum and so on.
my username is christian if you wnat to take a look. but i dosend hear 
for first time that users cant log in.


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


Re: Lazarus bug report

2006-09-28 Thread Christian Ulrich

You think 12234 articles and 1557 users is useless ?

no, but i think if most users cant login or whatever its useless.



Yes it is. If you cannot register, it usually means that the 
subscription email cannot be delivered to you.
It might that you or your provider is blocking mail from miraclec.com, 
or that there is something with the address used that the forum 
software doesn't understand.


no, iam registered since an year or so and my account was active but 
someday i cant login and this is so till today.



A forum on wiki
They have 2 totally different purposes.



right, an forum and an news page are also 2 diffrent purposes but on 
lazarus site, there are an forum and an newspage 
its no real big thing to change the forum design a little bit to looks 
mostly like the wiki it schould not work like the wiki only look ...


at example the mantis on the fpc site integrates good in the site and 
mantis has no big options to customize the design

actual forum software can look mostly like you want.

Christian

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


Re: Lazarus bug report

2006-09-28 Thread Christian Ulrich

[EMAIL PROTECTED] is delivered to me, i have not only one adress.

Michael A. Hess wrote:


On Thu, 28 Sep 2006, Christian Ulrich wrote:

 


Michael A. Hess wrote:

I have registered bevore 1 year and cannot acces my account since 2
month after i registered.
Thats no mail server issue, i read on several delphi forums around that
the people coudnt register to lazarus forum and so on.
my username is christian if you wnat to take a look. but i dosend hear
for first time that users cant log in.
   



Your account is there but the email address points to

[EMAIL PROTECTED]

which isn't the same address that I see this email coming from. If you
requested a new password or did anything to modify your account it would
have tried to send the email to the above address.

You wouldn't have recieved it and this would mean you were locked out of
the account.

I can change the address for you and you can ask for a new password or I
can just set one for you to start.

 



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


Re: Lazarus bug report

2006-09-28 Thread Christian Ulrich



I can change the address for you and you can ask for a new password or I
can just set one for you to start.
 


you can change it to [EMAIL PROTECTED] or [EMAIL PROTECTED] like you want
maybe the mails are delivered then.
but i dont know why i must have mails delivered i know the password ive 
used, i have only

requested it becouse i coud not log in.

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


Re: [lazarus] Some problems

2006-09-28 Thread Christian Ulrich
attatched an test project, insert an row to the table, and post ist and 
then try to insert an second row with the button ...


Christian Ulrich wrote:





Should be fixed in r9979.
[snip]



Thanks :)

:( the insert problem i have noticed is also based on the dbgrid, when 
i connect an dbgrid to an datasource and
call .insert to the dataset linked to the datasource seems the dbgrid 
sends an cancel. when i append an row with the

dbgrid works fine. for me its not so bad i have this done so:
datasource.dataset.DisableControls;
datasource.dataset.insert;
datasource.dataset.enablecontrols;

this works.

best regards
Christian

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






test.zipped
Description: Binary data


Re: [lazarus] avoiding multi-instance detection

2006-09-28 Thread Bogusław Brandys

ik wrote:

Another way, that is easier to control, is to use mutexes.
Mutex is a place in memory that is locked until someone free it. So
you can check if that place (usually mapped to a name, alto I do not
remember at the moment how Linux implement it) exists, and if so, you
stop your own execution, otherwise you can continue the loading.

Ido


AFAIk there is no system wide mutexes in Linux, but I may be wrong.


Regards
Boguslaw

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


Re: [lazarus] avoiding multi-instance detection

2006-09-28 Thread John vd Waeter
Problem when program crashes. File is not deleted. Maybe refresh file 
every 5 minutes or so, put a timestamp in it. If timestamp older then 5 
minutes, program appearantly crashed, new instance may start.


John


Bogusław Brandys wrote:

Alejandro Lucas Baldres wrote:

My plataform i386 with Linux (ubuntu dapper 6.06), the future of 
program is free and opensource.

I want the program disallow more then one instance.



The simplest solution: let program check if /tmp/filename file exists 
and create it,then on exit delete.If file exists then instance is 
already running.

More complex would be using IPC (maybe others could describe)

Regards
Boguslaw

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





--
John vd Waeter
mailto:[EMAIL PROTECTED]
http://www.jvdw.nl
http://www.shotinthedark.nl

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


Re: [lazarus] avoiding multi-instance detection

2006-09-28 Thread Graeme Geldenhuys

On 28/09/06, John vd Waeter [EMAIL PROTECTED] wrote:

Problem when program crashes. File is not deleted. Maybe refresh file
every 5 minutes or so, put a timestamp in it. If timestamp older then 5
minutes, program appearantly crashed, new instance may start.

John



Simple solution, program with Unit Tests, so you app is rock solid and
will never crash. :-)

PS:
 Anybody know if mutexes in Linux is system wide?

Regards,
 - Graeme -

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


Re: [lazarus] code folding issue

2006-09-28 Thread Mattias Gaertner
On Thu, 28 Sep 2006 08:59:13 +0200
Sam Washkansky [EMAIL PROTECTED] wrote:

 hi Guys,
 
 I have just updated Lazarus (to rev 10002) and  found a bug with the
 code folding.  If  you have code folding checked in your editor
 options and fold a function, and then turn code folding off, the
 folded code block stays folded and there is no way of accessing the
 folded code. If you look at the line numbers in the margin you can
 see the break in the sequence. The only way to correct this is to
 enable the code folding, expand the code block and then disable code
 folding.

Fixed.

Mattias

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


Re: [lazarus] avoiding multi-instance detection

2006-09-28 Thread Bogusław Brandys

Graeme Geldenhuys wrote:

On 28/09/06, John vd Waeter [EMAIL PROTECTED] wrote:

Problem when program crashes. File is not deleted. Maybe refresh file
every 5 minutes or so, put a timestamp in it. If timestamp older then 5
minutes, program appearantly crashed, new instance may start.

John



Simple solution, program with Unit Tests, so you app is rock solid and
will never crash. :-)

PS:
 Anybody know if mutexes in Linux is system wide?

Regards,
 - Graeme -


According to pthreads docs: Mutexes can be applied only to threads in a 
single process and do not work between processes as do semaphores.

Maybe semaphores are right solution ?


Regards
Boguslaw


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


Re: [lazarus] avoiding multi-instance detection

2006-09-28 Thread Marc Weustink
Graeme Geldenhuys wrote:
 On 28/09/06, John vd Waeter [EMAIL PROTECTED] wrote:
 Problem when program crashes. File is not deleted. Maybe refresh file
 every 5 minutes or so, put a timestamp in it. If timestamp older then 5
 minutes, program appearantly crashed, new instance may start.

 John
 
 
 Simple solution, program with Unit Tests, so you app is rock solid and
 will never crash. :-)
 
 PS:
  Anybody know if mutexes in Linux is system wide?

IIRC we tried something global. Problem was that if the program crashed
the lock wasn't released, so not other instence could start after a crash.

Marc


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


Re: [lazarus] avoiding multi-instance detection

2006-09-28 Thread Bogusław Brandys

Graeme Geldenhuys wrote:

On 28/09/06, John vd Waeter [EMAIL PROTECTED] wrote:

Problem when program crashes. File is not deleted. Maybe refresh file
every 5 minutes or so, put a timestamp in it. If timestamp older then 5
minutes, program appearantly crashed, new instance may start.

John



Simple solution, program with Unit Tests, so you app is rock solid and
will never crash. :-)

PS:
 Anybody know if mutexes in Linux is system wide?

Regards,
 - Graeme -



Well.The main problem with linux in this particular case is that it's 
hard to find such global resource which is:
- atomic (no other process can get it in the same time like file lock or 
system-wide mutex)

- automatically released when application exit or crash or being killed

Maybe unix sockets ?
Someone with deeper linux knowledge ?


Regards
Boguslaw

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


Re: [lazarus] avoiding multi-instance detection

2006-09-28 Thread A.J. Venter

Just a simple question: would that be possible to simply query the

list of actual processes that are running? 'ps ax' for example; then
you can find your application?
Yep, you could do this with a TProcess - however, having said that - as 
I said before when this same question was discussed - the best tool for 
the job is xlsclients - which lists open WINDOWS in the current X server.
If your app is in there, you know it's already running - at least if 
it's a graphical app.


So you could tprocess around xlsclients, or better yet, somebody can 
read the xlsclients source code, and write a wrapper component mapping 
the appropriate xlib calls into lazarus once and for all :)


A.J.

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


Re: [lazarus] New Version of Lazarus (FPC 2.0.4)

2006-09-28 Thread Bisma Jayadi

Kris Leech wrote:
  It looks like the is an unoffical release, we will have to wait until
Mattias's computer is fixed before we get an offical release! Will be 
good to use FPC 2.0.4. Looking forward to it, especially for Linux as Im 
not great on linux desktop and have not been able to recompile Laz with 
FPC 2.0.4...


I see. But, the next official release is gonna be v.0.9.18 or v.0.9.20? I'm 
preparing a short description (article) of Lazarus and the comparison with 
Delphi to attract Delphi developers in my country. So, I need to make sure 
which version is the latest official release. Thank you.


-Bee-

has Bee.ography at:
http://beeography.wordpress.com

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


[lazarus] fpc svn compile error

2006-09-28 Thread Nataraj S Narayan

Hi

I  have been getting this for some time after giving a 'make clean all' 
after an svn update fpc.


My lazarus is showing no problem since its getting compiled using 
previous installed fpc.


Plz help to fix.

/usr/local/bin/ppc386 -Ur -Ur -Xs -O2 -n -Fi../inc -Fi../i386 -Fi../unix 
-Fii386 -FE. -FU/root/fpc/rtl/units/i386-linux -di386 -dRELEASE -Us -Sg 
system.pp

systemh.inc(72,15) Error: Duplicate identifier Real
varianth.inc(253,12) Error: Function is already declared Public/Forward 
operator :=(const Double):Variant
varianth.inc(303,12) Error: Function is already declared Public/Forward 
operator :=(const Variant):Double
varianth.inc(384,12) Error: Function is already declared Public/Forward 
operator :=(const OleVariant):Double
varianth.inc(434,12) Error: Function is already declared Public/Forward 
operator :=(const Double):OleVariant

system.pp(36,1) Fatal: There were 5 errors compiling module, stopping
Fatal: Compilation aborted
make[7]: *** [system.ppu] Error 1
make[7]: Leaving directory `/root/fpc/rtl/linux'
make[6]: *** [linux_all] Error 2
make[6]: Leaving directory `/root/fpc/rtl'
make[5]: *** [rtl] Error 2
make[5]: Leaving directory `/root/fpc/compiler'
make[4]: *** [next] Error 2
make[4]: Leaving directory `/root/fpc/compiler'
make[3]: *** [ppc1] Error 2
make[3]: Leaving directory `/root/fpc/compiler'
make[2]: *** [cycle] Error 2
make[2]: Leaving directory `/root/fpc/compiler'
make[1]: *** [compiler_cycle] Error 2
make[1]: Leaving directory `/root/fpc'
make: *** [build-stamp.i386-linux] Error 2


regards

Nataraj
begin:vcard
fn:http://www.gsis.ac.in
n:S Narayan;Nataraj
org:Good Shepherd International School;Software
adr:Niligiris, ;;M.Palada;Ootacamund;TN;643004;INDIA
email;internet:[EMAIL PROTECTED]
title:Project Coordinator
tel;work:0423 2550371 - 307
x-mozilla-html:TRUE
url:http://www.gsis.ac.in
version:2.1
end:vcard



[lazarus] QtComboBox Update

2006-09-28 Thread Luis R. Hilario B.

Hello,

ComboBox update in file qtcombobox.diff
Any correction is welcome.
--
http://luisdigital.com
Index: ide/revision.inc
===
--- ide/revision.inc	(revision 10003)
+++ ide/revision.inc	(working copy)
@@ -1,2 +1,2 @@
 // Created by Svn2RevisionInc
-const RevisionStr = '9891';
+const RevisionStr = '10002M';
Index: lcl/interfaces/qt/qtobjects.pas
===
--- lcl/interfaces/qt/qtobjects.pas	(revision 10003)
+++ lcl/interfaces/qt/qtobjects.pas	(working copy)
@@ -8,6 +8,38 @@
 
 type
 
+  { TQtComboStrings }
+
+  TQtComboStrings = class(TStrings)
+  private
+FComboChanged: Boolean; // StringList and QtComboBox out of sync
+FStringList: TStringList; // Holds the items to show
+FQtComboBox: QComboBoxH;  // Qt Widget
+FOwner: TWinControl;  // Lazarus Control Owning ListStrings
+FUpdating: Boolean;   // We're changing Qt Widget
+procedure InternalUpdate;
+procedure ExternalUpdate(var Astr: TStringList; Clear: Boolean = True);
+procedure IsChanged; // OnChange triggered by program action
+  protected
+function GetTextStr: string; override;
+function GetCount: integer; override;
+function Get(Index : Integer) : string; override;
+//procedure SetSorted(Val : boolean); virtual;
+  public
+constructor Create(ComboBoxH : QComboBoxH; TheOwner: TWinControl);
+destructor Destroy; override;
+procedure Assign(Source : TPersistent); override;
+procedure Clear; override;
+procedure Delete(Index : integer); override;
+procedure Insert(Index : integer; const S: string); override;
+procedure SetText(TheText: PChar); override;
+//procedure Sort; virtual;
+  public
+//property Sorted: boolean read FSorted write SetSorted;
+property Owner: TWinControl read FOwner;
+  end;
+
+
   { TQtListStrings }
 
   TQtListStrings = class(TStrings)
@@ -567,5 +599,129 @@
   Result := QImage_numBytes(Handle);
 end;
 
+{ TQtComboStrings }
+
+procedure TQtComboStrings.InternalUpdate;
+begin
+
+end;
+
+procedure TQtComboStrings.ExternalUpdate(var Astr: TStringList; Clear: Boolean
+  );
+var
+  i: Integer;
+  data: QVariantH;
+begin
+
+  data := QVariant_create(10); //Creates dummy data
+
+  FUpdating := True;
+  if Clear then
+QComboBox_clear(FQtComboBox);
+  for i := 0 to AStr.Count -1 do
+QComboBox_additem(FQtComboBox, @WideString(Astr[i]), data);
+  FUpdating := False;
+  IsChanged;
+  FUpdating := False;
+
+  QVariant_destroy(data); // Clean up
+end;
+
+procedure TQtComboStrings.IsChanged;
+begin
+
+end;
+
+function TQtComboStrings.GetTextStr: string;
+begin
+  Result:=inherited GetTextStr;
+end;
+
+function TQtComboStrings.GetCount: integer;
+begin
+  if FComboChanged then InternalUpdate;
+  Result := FStringList.Count;
+end;
+
+function TQtComboStrings.Get(Index: Integer): string;
+begin
+  if FComboChanged then InternalUpdate;
+  if Index  FStringList.Count then
+ Result := FStringList.Strings[Index]
+  else Result := '';
+end;
+
+constructor TQtComboStrings.Create(ComboBoxH: QComboBoxH; TheOwner: TWinControl
+  );
+var
+  Method: TMethod;
+  Hook : QComboBox_hookH;
+//  Astr: WideString;
+  i: Integer;
+begin
+  inherited Create;
+
+  {$ifdef VerboseQt}
+if (ComboBoxH = nil) then WriteLn('TQtComboStrings.Create Unspecified ComboBoxH widget');
+if (TheOwner = nil) then WriteLn('TQtComboStrings.Create Unspecified owner');
+  {$endif}
+
+  FStringList := TStringList.Create;
+  FQtComboBox := ComboBoxH;
+  FStringList.Text := TCustomComboBox(TheOwner).Items.Text;
+  FOwner:=TheOwner;
+end;
+
+destructor TQtComboStrings.Destroy;
+begin
+  inherited Destroy;
+end;
+
+procedure TQtComboStrings.Assign(Source: TPersistent);
+begin
+  inherited Assign(Source);
+end;
+
+procedure TQtComboStrings.Clear;
+begin
+  FUpdating := True;
+  FStringList.Clear;
+  QComboBox_clear(FQtComboBox);
+  FComboChanged := False;
+  FUpdating := False;
+  IsChanged;
+end;
+
+procedure TQtComboStrings.Delete(Index: integer);
+begin
+  if FComboChanged then InternalUpdate;
+
+  if Index  FStringList.Count then
+  begin
+FStringList.Delete(Index);
+ExternalUpdate(FStringList,True);
+FComboChanged := False;
+  end;
+end;
+
+procedure TQtComboStrings.Insert(Index: integer; const S: string);
+begin
+  if FComboChanged then InternalUpdate;
+
+  if Index  0 then Index := 0;
+
+  if Index = FStringList.Count then
+  begin
+FStringList.Insert(Index,S);
+ExternalUpdate(FStringList,True);
+FComboChanged := False;
+  end;
+end;
+
+procedure TQtComboStrings.SetText(TheText: PChar);
+begin
+  inherited SetText(TheText);
+end;
+
 end.
 
Index: lcl/interfaces/qt/qtwsstdctrls.pp
===
--- lcl/interfaces/qt/qtwsstdctrls.pp	(revision 10003)
+++ lcl/interfaces/qt/qtwsstdctrls.pp	(working copy)
@@ -1071,10 +1071,11 @@
   Returns: The state of the control