Re: [Lazarus] Dragging documented

2009-04-18 Thread Hans-Peter Diettrich
Felipe Monteiro de Carvalho schrieb:

 So I couldn't resist to add some criticism about the current LCL
 implementation. Any comments are welcome :-)
 
 I think you should be more specific if you want to do a criticism. In
 the way you put it one can have no idea what exactly you are taking
 about.

[ ] You have read section 3: LCL Implementation

DoDi

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


Re: [Lazarus] lNet and several threads

2009-04-18 Thread Aleš Katona
On Thu, 16 Apr 2009 20:01:57 +0200
User usuarioanonimomy...@gmail.com wrote:

 How I can use several threads with lNet visual library?
 
 I need some examples.
 
 Best regards!

Hello. lNet is inheritedly not thread-safe but it can be used with threads in 
some ways. When it comes to the visual components, you must remember that the 
main program loop (handled by the widgetsets) calls the lNet callbacks 
(OnReceive etc.) so they are all executed inside the main thread no matter 
where you work with the components otherwise.

I'd need some specific use case to give more info.

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


Re: [Lazarus] lNet and several threads

2009-04-18 Thread User
Hello, I will explain better my doubt. I need to program a multithread
server that processes requests of several clients at the same time. At the
moment the server processes requests of several clients one to one by the
OnReceive callback:

procedure TConnectionHandler.Receive(aSocket: TLSocket);
var
  Message: String;
begin
  if aSocket.GetMessage(Message)  0 then
MessagesManager.ProcessMessage(Message);
end;

I want to change the behavior of the server so that it works with one thread
for each client request.

Is it possible?

Best regards.

2009/4/18 Aleš Katona almin...@gmail.com

 On Thu, 16 Apr 2009 20:01:57 +0200
 User usuarioanonimomy...@gmail.com wrote:

  How I can use several threads with lNet visual library?
 
  I need some examples.
 
  Best regards!

 Hello. lNet is inheritedly not thread-safe but it can be used with threads
 in some ways. When it comes to the visual components, you must remember that
 the main program loop (handled by the widgetsets) calls the lNet callbacks
 (OnReceive etc.) so they are all executed inside the main thread no matter
 where you work with the components otherwise.

 I'd need some specific use case to give more info.

 Ales
 ___
 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


Re: [Lazarus] lNet and several threads

2009-04-18 Thread Aleš Katona
On Sat, 18 Apr 2009 10:36:04 +0200
User usuarioanonimomy...@gmail.com wrote:

 Hello, I will explain better my doubt. I need to program a multithread
 server that processes requests of several clients at the same time. At the
 moment the server processes requests of several clients one to one by the
 OnReceive callback:
 
 procedure TConnectionHandler.Receive(aSocket: TLSocket);
 var
   Message: String;
 begin
   if aSocket.GetMessage(Message)  0 then
 MessagesManager.ProcessMessage(Message);
 end;
 
 I want to change the behavior of the server so that it works with one thread
 for each client request.
 
 Is it possible?
 
 Best regards.
 
 2009/4/18 Aleš Katona almin...@gmail.com
 
  On Thu, 16 Apr 2009 20:01:57 +0200
  User usuarioanonimomy...@gmail.com wrote:
 
   How I can use several threads with lNet visual library?
  
   I need some examples.
  
   Best regards!
 
  Hello. lNet is inheritedly not thread-safe but it can be used with threads
  in some ways. When it comes to the visual components, you must remember that
  the main program loop (handled by the widgetsets) calls the lNet callbacks
  (OnReceive etc.) so they are all executed inside the main thread no matter
  where you work with the components otherwise.
 
  I'd need some specific use case to give more info.
 
  Ales
  ___
  Lazarus mailing list
  Lazarus@lazarus.freepascal.org
  http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
 

Yes, but you need to do the sends inside the main loop. lNet is a state-machine 
so everything related to network states needs to be kept in the same thread. 
You can however start a new thread for each request and process the data there. 
When you have replies ready to send, push them in some send-buffer (per client) 
so that the main thread can do the sending then. This requires some sort of 
messaging between the threads of course.

It's not the simplest of methods but it's safe. Doing sending inside the 
work-threads could cause lNet to run into a state-change race-condition and 
stop working properly.

Ales

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


Re: [Lazarus] Dragging documented

2009-04-18 Thread Felipe Monteiro de Carvalho
On Sat, Apr 18, 2009 at 3:41 AM, Hans-Peter Diettrich
drdiettri...@aol.com wrote:
 [ ] You have read section 3: LCL Implementation

I had just assumed you would never write the critics to the wiki. The
Wiki is the wrong place for criticism. It is a documentation and not a
discussion forum or a blog. Could you modify the page to make it more
professional looking? thanks

Please post criticism in the mailling list instead.

thanks,
-- 
Felipe Monteiro de Carvalho
___
Lazarus mailing list
Lazarus@lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Why we chose Object Pascal instead

2009-04-18 Thread Giuliano Colla
waldo kitty ha scritto:
 Hans-Peter Diettrich wrote:
 Graeme Geldenhuys schrieb:

 I can't agree more... We have had this exact same issue in our company
 (before I arrived). They hired cheap (inexperienced) developers that
 caused havoc in the code. They make the GUI seem fine for a while, but
 underneath the design (if there actually was a design) is totally
 rubbish and unable to cope with new requirements. Hence the reason I
 was commissioned to do a total rewrite.
 That's why neither Cobol nor VB will ever die: they make secure 
 long-term jobs
 
 that's also why real coders do not comment their source code ;)
 

We had a guy who'd found an even more clever way. He did comment the 
code, but his comments reported what the code didn't do, instead of what 
the code was doing. Sort of an embedded and disguised TODO list, which 
could easily lead to believe that a feature was implemented, when 
actually it wasn't!


-- 
Giuliano Colla

Whenever people agree with me, I always feel I must be wrong (O. Wilde)
___
Lazarus mailing list
Lazarus@lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Why we chose Object Pascal instead

2009-04-18 Thread Coppola Ing. Salvatore
Giuliano Colla wrote:
 waldo kitty ha scritto:
   
 Hans-Peter Diettrich wrote:
 
 Graeme Geldenhuys schrieb:

   
 I can't agree more... We have had this exact same issue in our company
 (before I arrived). They hired cheap (inexperienced) developers that
 caused havoc in the code. They make the GUI seem fine for a while, but
 underneath the design (if there actually was a design) is totally
 rubbish and unable to cope with new requirements. Hence the reason I
 was commissioned to do a total rewrite.
 
 That's why neither Cobol nor VB will ever die: they make secure 
 long-term jobs
   
 that's also why real coders do not comment their source code ;)

 

 We had a guy who'd found an even more clever way. He did comment the 
 code, but his comments reported what the code didn't do, instead of what 
 the code was doing. Sort of an embedded and disguised TODO list, which 
 could easily lead to believe that a feature was implemented, when 
 actually it wasn't!


   
he, he.. !! very funny (ho riso di cuore!) :-D
___
Lazarus mailing list
Lazarus@lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] lNet and several threads

2009-04-18 Thread Bogusław Brandys
User pisze:
 Which is the simplest method?


You can use synapse.It will be good for a multithreaded server if fpc 
thread support is stable and for just a few clients. It depends on what 
you want to archieve.


Boguslaw

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


Re: [Lazarus] lNet and several threads

2009-04-18 Thread User
Ok, you know some examples?

Best regards.

2009/4/18 Bogusław Brandys bran...@o2.pl

 User pisze:
  Which is the simplest method?


 You can use synapse.It will be good for a multithreaded server if fpc
 thread support is stable and for just a few clients. It depends on what
 you want to archieve.


 Boguslaw

 ___
 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] AutoCreate with Forms from a Package (.lpk)

2009-04-18 Thread Osvaldo Filho
Is it possible i use AutoCreate statement ( and component comunication
like datasource-dataset) with a form in a package?

One project use a package (.lpk)
Forms on project use datamodules components in a package.

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


Re: [Lazarus] AutoCreate with Forms from a Package (.lpk)

2009-04-18 Thread Mattias Gaertner
On Sat, 18 Apr 2009 15:45:25 -0300
Osvaldo Filho arquivos...@gmail.com wrote:

 Is it possible i use AutoCreate statement ( and component comunication
 like datasource-dataset) with a form in a package?
 
 One project use a package (.lpk)
 Forms on project use datamodules components in a package.

At runtime it should already work.
It does not yet work at designtime.


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


Re: [Lazarus] ide enhancement - method or cursor location belongs to what class?

2009-04-18 Thread Martin Friebe
Graeme Geldenhuys wrote:
 Hi,

 I often have large classes that are bigger than what the source editor
 can display at once.  I'm mainly talking about tiOPF project here.
 Anyway, I receive patches for large methods and use the IDE 'goto
 line' command to maybe review or modify a received patch.  Again, the
 IDE only shows me lines of code, I can't clearly see which class I am
 currently working in. Ctrl+Shift+UpArrow doesn't reveal this info
 either, because again the class declaration is large and doesn't fit
 into the source editor all at once.

 Is there a way to quickly see what class I am currently in without
 loosing my current position in the source code?  I was thinking of
 maybe some editor shortcut that could display for a few seconds the
 classname in the top right corner of the editor and then simply fade
 away. Is this possible? Is there already something similar in Lazarus
 IDE or another way of know what class I am currently in?
   
There is now revision 19499

you need the mouse (so it isn't as quick and convenient as a key-command 
driven hint).
The Fold-Gutter part now has it's own Pop-up menu. (only at lines that 
have folding present). And it shows all the nested levels.

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