[lazarus] Re: new patches

2006-04-22 Thread roozbeh gholizadeh
On Sun, 23 Apr 2006 01:37:01 +0330, roozbeh gholizadeh  
<[EMAIL PROTECTED]> wrote:



Here is another patch.
makes labels,brushes work.



Well i forgot this patch for graphics.pp.
it is related to a bug in fpc-which sometimes causes datatype  
misalignment,and becouse now labels are geting paint message,programs with  
labels without removal of packed record from ttextstyle will crash.
that {$packrecords c} i dont know if yet needed but it as far as i  
remember i added that and fixed some other bugs but related to ttextstyle  
too  but maybe with removal of packed record it might nomore be needed.
on chat on irc ppl suggested there was no use for packing that record and  
it could be safely removed,anyway i have no opinion about that.


Index: graphics.pp
===
--- graphics.pp (revision 9144)
+++ graphics.pp (working copy)
@@ -31,7 +31,11 @@
 {$ASSERTIONS ON}
 {$endif}

+{$IFDEF wince}
+{$PACKRECORDS c}
+{$ENDIF}

+
 uses
   SysUtils, Types, Classes, Contnrs, FPCAdds,
   FPImage, FPReadPNG, FPWritePNG, FPReadBMP, FPWriteBMP, FPReadPNM,  
FPWritePNM,

@@ -79,7 +83,8 @@
   { Reflects text style when drawn in a rectangle }

   TTextLayout = (tlTop, tlCenter, tlBottom);
-  TTextStyle = packed record
+//  TTextStyle = packed record
+  TTextStyle =  record
 Alignment : TAlignment;  // TextRect Only: horizontal alignment

 Layout: TTextLayout; // TextRect Only: vertical alignment

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


[lazarus] new patches

2006-04-22 Thread roozbeh gholizadeh

Here is another patch.
makes labels,brushes work.


Index: wincecallback.inc
===
--- wincecallback.inc   (revision 9161)
+++ wincecallback.inc   (working copy)
@@ -863,15 +863,15 @@
 End;
 WM_CLOSE:
 Begin
-//  if (Window = TWinCEWidgetSet(WidgetSet).AppHandle) and
-//(Application.MainForm <> nil) then
+  if (Window = TWinCEWidgetSet(WidgetSet).AppHandle) and
+(Application.MainForm <> nil) then
   begin
 Windows.SendMessage(Application.MainForm.Handle, WM_CLOSE, 0, 0);
-Application.Terminate;
+   // Application.Terminate;
+  end
+  else begin
+LMessage.Msg := LM_CLOSEQUERY;
   end;
-//  else begin
-//LMessage.Msg := LM_CLOSEQUERY;
-//  end;
   // default is to destroy window, inhibit
   WinProcess := false;
 End;
Index: winceobject.inc
===
--- winceobject.inc (revision 9161)
+++ winceobject.inc (working copy)
@@ -48,6 +48,9 @@
 end;

 procedure TWinCEWidgetSet.AppInit(var ScreenInfo: TScreenInfo);
+var
+  Handle: HWND;
+  DC: HDC;
 begin
   {$ifdef VerboseWinCE}
   WriteLn('TWinCEWidgetSet.AppInit');
@@ -84,13 +87,27 @@
   FStockWhiteBrush := CreateBrushIndirect(LogBrush);
 }

+  // Create parent of all windows, `button on taskbar'
+//does this work on wince?!
+  FAppHandle := CreateWindow(@ClsName,  
CreatePWideCharFromString(Application.Title), WS_POPUP or

+WS_CLIPSIBLINGS or WS_CAPTION or WS_SYSMENU or WS_MINIMIZEBOX,
+0, {Windows.GetSystemMetrics(SM_CXSCREEN) div 2,}
+0, {Windows.GetSystemMetrics(SM_CYSCREEN) div 2,}
+0, 0, HWND(nil), HMENU(nil), HInstance, nil);
+  AllocWindowInfo(FAppHandle);
+
+  // set nice main icon
+  SendMessage(FAppHandle, WM_SETICON, ICON_BIG,
+Windows.LoadIcon(MainInstance, 'MAINICON'));
+  // remove useless menuitems from sysmenu
+
  // initialize ScreenInfo
-{  Handle := GetDesktopWindow;
+  Handle := GetDesktopWindow;
   DC := Windows.GetDC(Handle);
   ScreenInfo.PixelsPerInchX := GetDeviceCaps(DC, LOGPIXELSX);
   ScreenInfo.PixelsPerInchY := GetDeviceCaps(DC, LOGPIXELSY);
   ScreenInfo.ColorDepth := GetDeviceCaps(DC, BITSPIXEL);
-  ReleaseDC(Handle, DC);}
+  ReleaseDC(Handle, DC);

 end;

Index: winceproc.pp
===
--- winceproc.pp(revision 9161)
+++ winceproc.pp(working copy)
@@ -45,6 +45,10 @@
 function DisposeWindowInfo(Window: HWND): boolean;
 function GetWindowInfo(Window: HWND): PWindowInfo;

+//roozbeh:these are simply copy-pasted from win32...i bet most of them  
can be changed

+//or not that much neccessary on wince!
+function LCLControlSizeNeedsUpdate(Sender: TWinControl;SendSizeMsgOnDiff:  
boolean): boolean;
+Procedure LCLBoundsToWin32Bounds(Sender: TObject;var Left, Top, Width,  
Height: Integer);
 procedure LCLFormSizeToWin32Size(Form: TCustomForm; var AWidth, AHeight:  
Integer);
 function GetLCLClientBoundsOffset(Sender: TObject; var ORect: TRect):  
boolean;

 function GetLCLClientBoundsOffset(Handle: HWnd; var Rect: TRect): boolean;
@@ -125,6 +129,25 @@



+function GetLCLClientBoundsOffset(Handle: HWnd; var Rect: TRect): boolean;
+var
+  OwnerObject: TObject;
+begin
+  OwnerObject := GetWindowInfo(Handle)^.WinControl;
+  Result:=GetLCLClientBoundsOffset(OwnerObject, Rect);
+end;
+
+Procedure LCLBoundsToWin32Bounds(Sender: TObject;
+  var Left, Top, Width, Height: Integer);
+var
+  ORect: TRect;
+Begin
+  if (Sender=nil) or (not (Sender is TWinControl)) then exit;
+  if not GetLCLClientBoundsOffset(TWinControl(Sender).Parent, ORect) then  
exit;

+  inc(Left, ORect.Left);
+  inc(Top, ORect.Top);
+End;
+
 
{---
   function GetLCLClientOriginOffset(Sender: TObject;
 var LeftOffset, TopOffset: integer): boolean;
@@ -194,13 +217,6 @@
   Result:=true;
 end;

-function GetLCLClientBoundsOffset(Handle: HWnd; var Rect: TRect): boolean;
-var
-  OwnerObject: TObject;
-begin
-  OwnerObject := GetWindowInfo(Handle)^.WinControl;
-  Result:=GetLCLClientBoundsOffset(OwnerObject, Rect);
-end;

 procedure GetWin32ControlPos(Window, Parent: HWND; var Left, Top:  
integer);

 var
@@ -212,6 +228,45 @@
   Top := winRect.Top - parRect.Top;
 end;

+
+{---
+  function LCLBoundsNeedsUpdate(Sender: TWinControl;
+SendSizeMsgOnDiff: boolean): boolean;
+
+  Returns true if LCL bounds and win32 bounds differ for the control.
+---}
+function LCLControlSizeNeedsUpdate(Sender: TWinControl;
+  SendSizeMsgOnDiff: boolean): boolean;
+var
+  Window:HWND;
+  LMessage: TLMSize;
+  IntfWidth, IntfHeight: integer;
+begin
+  Result:=false;
+  Window:= Sender.Handle;
+  LCLIntf.GetWindowSize(Window, IntfWidth, IntfHeight);
+  i

Re: [lazarus] DesignIntf and DesignEditors Units

2006-04-22 Thread Mattias Gaertner
On Sat, 22 Apr 2006 10:38:18 -1000
John Mitson <[EMAIL PROTECTED]> wrote:

> Mattias Gaertner wrote:
> > On Sat, 22 Apr 2006 09:49:30 -1000
> > John Mitson <[EMAIL PROTECTED]> wrote:
> >
> >   
> >> I am porting a Kylix component that I created to Lazarus that used 
> >> DesignIntf and DesignEditor units.  Does Lazarus have the equivalent 
> >> units and if so what are they named.
> >> 
> >
> > Add the IDEIntf package to your dependencies of your package.
> > Many things of DesignEditor are in PropEdits and ComponentEditors.
> > DesignIntf has no equivalent. What do you need from this unit?
> >
> >
> > Mattias
> >
> > _
> >  To unsubscribe: mail [EMAIL PROTECTED] with
> > "unsubscribe" as the Subject
> >archives at http://www.lazarus.freepascal.org/mailarchives
> >
> >
> >
> >   
> The component uses TIntegerProperty and TPropertyAttributes (see below):
> 
> TCardValueProperty = class(TIntegerProperty)
>   public
> function GetAttributes: TPropertyAttributes; override;
> function GetValue: string; override;
> procedure GetValues(Proc: TGetStrProc); override;
> procedure SetValue(const Value: string); override;
>   end;

Then DesignIntf is not needed.

Mattias

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


Re: [lazarus] DesignIntf and DesignEditors Units

2006-04-22 Thread John Mitson

Mattias Gaertner wrote:

On Sat, 22 Apr 2006 09:49:30 -1000
John Mitson <[EMAIL PROTECTED]> wrote:

  
I am porting a Kylix component that I created to Lazarus that used 
DesignIntf and DesignEditor units.  Does Lazarus have the equivalent 
units and if so what are they named.



Add the IDEIntf package to your dependencies of your package.
Many things of DesignEditor are in PropEdits and ComponentEditors.
DesignIntf has no equivalent. What do you need from this unit?


Mattias

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



  

The component uses TIntegerProperty and TPropertyAttributes (see below):

TCardValueProperty = class(TIntegerProperty)
 public
   function GetAttributes: TPropertyAttributes; override;
   function GetValue: string; override;
   procedure GetValues(Proc: TGetStrProc); override;
   procedure SetValue(const Value: string); override;
 end;

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


Re: [lazarus] Can get Lazarus running anymore

2006-04-22 Thread Rob
Op zaterdag 22 april 2006 00:32, schreef Mattias Gaertner:
> On Fri, 21 Apr 2006 22:40:17 +0200
>
> Rob <[EMAIL PROTECTED]> wrote:
> > Lazarus closed itself with error message about an illegal or invalid
> > floating  point. Now when I try to restart Lazarus it immediately closes
> > itself. The  problem is probably with a font setting for the code editor.
> > Does anybody  know which file I can replace, delete or what to modify to
> > solve this  problem. (running on Linux SuSE 10.0).
>
> ~/.lazarus/editoroptions.xml
>
> Mattias
>

Changed the size setting from 16 to 12 in the indicated file and Lazarus runs 
fine again.
Thanks, Rob.

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


Re: [lazarus] DesignIntf and DesignEditors Units

2006-04-22 Thread Mattias Gaertner
On Sat, 22 Apr 2006 09:49:30 -1000
John Mitson <[EMAIL PROTECTED]> wrote:

> I am porting a Kylix component that I created to Lazarus that used 
> DesignIntf and DesignEditor units.  Does Lazarus have the equivalent 
> units and if so what are they named.

Add the IDEIntf package to your dependencies of your package.
Many things of DesignEditor are in PropEdits and ComponentEditors.
DesignIntf has no equivalent. What do you need from this unit?


Mattias

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


[lazarus] DesignIntf and DesignEditors Units

2006-04-22 Thread John Mitson
I am porting a Kylix component that I created to Lazarus that used 
DesignIntf and DesignEditor units.  Does Lazarus have the equivalent 
units and if so what are they named.


Thank you, John

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


[lazarus] TComboBox OnChange when selecting

2006-04-22 Thread Armin Diehl
TComboBox does not fire an OnChange event in case an entry is selected 
in the drop down list that changes the entry in the edit. I think this 
should be fired, patch (one line only) attached.




Index: customcombobox.inc
===
--- customcombobox.inc  (revision 9159)
+++ customcombobox.inc  (working copy)
@@ -851,6 +851,7 @@
 begin
   if [csLoading,csDestroying,csDesigning]*ComponentState<>[] then exit;
   Select;
+  Change;
 end;
 
 {--


Re: [lazarus] FPC question

2006-04-22 Thread Vincent Snijders

Vincent Snijders wrote:

Micha Nelissen wrote:


On Fri, 21 Apr 2006 23:50:08 +0200
"Graeme Geldenhuys" <[EMAIL PROTECTED]> wrote:



Thanks for the help!

Any idea how to rename the title of a page? See the newly added tiOPF
page. Currently the title is TiOPF and it should read tiOPF.




I think MediaWiki automatically uppercases the first letter, I have no 
clue

why though. This will probably need some PHP hacking to get right :-/.



It is possible, look for example here:
http://forums.macrumors.com/showthread.php?t=167613
It also lists the drawbacks.

I don't know in what version of mediawiki this was added and how to set 
this flag, so if anybody can dig up that information, please send it to me.


Both Sven Heinig and Micha Nelissen told me that I need to set 
wgCapitalLinks to false. Thanks. I just made this change.


Doing this means that some links will get broken, i.e. links that start 
with a lowercase character, for example if the History page is 
referenced like [[history]]. This will need to be replaced by 
[[History|history]]. If you find them, please fix them.


Vincent.

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


Re: [lazarus] SQL error that shouldn't be.

2006-04-22 Thread johnf
On Saturday 22 April 2006 11:38, johnf wrote:
> On Saturday 22 April 2006 11:01, Jon Foster wrote:
> > Using TMySQL40Connection I tried to use the following query:
> >
> > SQLQuery1.sql.text:='SELECT organizations.name as org,
> > tests.name as test '+
> > 'FROM tests INNER JOIN organizations '+
> >'ON tests.organization=organizations.id '+
> > 'WHERE result<>''PASS'' '+
> > 'ORDER BY tests.name';
> >
> > When I try "open" the query I received an error indicating that I had an
> > error "near INNER JOIN ...". If I paste the query into the MySQL client
> > it works. I also removed the word "inner" and tried it but received the
> > same message except that it pointed to "join" instead of "inner".
> > Rewriting the query like below it worked:
> >
> > SQLQuery1.sql.text:='SELECT organizations.name as org,
> > tests.name as test '+
> > 'FROM tests, organizations '+
> > 'WHERE tests.organization=organizations.id AND
> > result<>''PASS'' '+
> > 'ORDER BY tests.name';
> >
> > Is there some filtering of the SQL that might be corrupting my query?
>
> Try using
> sqlquery1.TEXT:='SELECT organizations.name as org,
> tests.name as test FROM tests, organizations WHERE
> tests.organization=organizations.id AND result<>' + Quotedstr('PASS') +
> 'ORDER BY tests.name';
> Is 'result' in only one of the tables?
> John
I thought about this a little more.  I don't know much about MySQL but does it 
have a log.  Check the log and see what your program is passing.

John

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


Re: [lazarus] SQL error that shouldn't be.

2006-04-22 Thread johnf
On Saturday 22 April 2006 11:01, Jon Foster wrote:
> Using TMySQL40Connection I tried to use the following query:
>
> SQLQuery1.sql.text:='SELECT organizations.name as org,
> tests.name as test '+
> 'FROM tests INNER JOIN organizations '+
>'ON tests.organization=organizations.id '+
> 'WHERE result<>''PASS'' '+
> 'ORDER BY tests.name';
>
> When I try "open" the query I received an error indicating that I had an
> error "near INNER JOIN ...". If I paste the query into the MySQL client
> it works. I also removed the word "inner" and tried it but received the
> same message except that it pointed to "join" instead of "inner".
> Rewriting the query like below it worked:
>
> SQLQuery1.sql.text:='SELECT organizations.name as org,
> tests.name as test '+
> 'FROM tests, organizations '+
> 'WHERE tests.organization=organizations.id AND
> result<>''PASS'' '+
> 'ORDER BY tests.name';
>
> Is there some filtering of the SQL that might be corrupting my query?

Try using 
sqlquery1.TEXT:='SELECT organizations.name as org,
tests.name as test FROM tests, organizations WHERE 
tests.organization=organizations.id AND result<>' + Quotedstr('PASS') + 
'ORDER BY tests.name';
Is 'result' in only one of the tables?
John

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


[lazarus] Re: how tlabel works?

2006-04-22 Thread roozbeh gholizadeh
On Sat, 22 Apr 2006 21:33:43 +0330, roozbeh gholizadeh  
<[EMAIL PROTECTED]> wrote:


On Sat, 22 Apr 2006 20:17:13 +0330, Mattias Gaertner  
<[EMAIL PROTECTED]> wrote:




TCustomLabel is a TGraphicControl which calls Paint in WMPaint.
Check why the wince interface is not sending LM_PAINT messages.


Mattias



Well i checked everything...lm_paint message seems to be ok.
but i came to this that while trying to draw label  
TWidgetSet.RectVisible returns false,becouse GetClipRGN(DC,ClipRGN)  
returns 0.

i didnt find any call previous to selectcliprgn.
i find out that is only called if doublebuffering is true,which is  
not.am i right or not?


About doublebuffering i dont know much.should it also be activated on  
wince?



Well solvedwince rectvisible declerade in winceapi which uses winapi  
and now working ;)




--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/

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


[lazarus] How does Lazarus request compile?

2006-04-22 Thread Jon Foster




I had an interesting scenario recently where a form I was trying to
compile kept coming up empty when I ran the program. The unit name was
"unit1". I had placed several controls on the page and changed the
caption. When the program ran it came up with the default empty window
with the caption "Form1". I used "build all" to try to guarantee that
it rebuilt my unit.

I ended up discovering that there was a "unit1.pas" that was reachable
in by my -Fu path. So the question is: How do you tell FPC to build the
application? More specifically:


  Do you just pass the "*.lpr" project file to FPC and it does the
project build from there?
  Do you compile the individual units?
  How does the project location get passed to FPC?
  What happens when project files exist outside of the directory
where the "*.lpr" file is contained.

If you want just tell me where in the source code to find the calls to
FPC and I'll be happy to browse that.

THX - Jon

-- 
Jon Foster
JF Possibilities, Inc.
[EMAIL PROTECTED]
541-410-2760
Making computers work for you!




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


Re: [lazarus] Serial comms, events and other stuff

2006-04-22 Thread Marc Santhoff
Am Samstag, den 22.04.2006, 08:22 +0100 schrieb Ian bell:
> Marc Santhoff wrote:
> > Am Freitag, den 21.04.2006, 22:28 +0100 schrieb Ian bell:
> > 
> >>I am just starting to port some programs to fpc using Lazarus form 
> >>Tcl/Tk. I have some questions about things I can do fairly easily in 
> >>Tcl/Tk which I am not sure how to achieve in fpc/lazarus. At present I 
> >>only need Linux specific answers.
> >>
> >>1. I am connecting to an external microcontoller development board by 
> >>a serial interface. I need to be able to set this interface non 
> >>blocking. I can see how to open the serial interface using the serial 
> >>unit but it is not clear how to set it non blocking.
> > 
> > 
> > For Linux/*nix there is the "serial" unit, does something similar here.
> > See
> > 
> > /rtl/unix/serial.pp
> > 
> 
> Yes, as I mentioned above I looked at the 'serial' unit. It seems to 
> basicaly call fpopen as expected. To set the serial port paramaters, 
> which includes blocking, a call to ioctl is normaly needed which 
> appears to be implemented by a call to tcsetattr which I assume is in 
> the termio unit. I have now tracked this down and the tcsetattr seems 
> to be inplemented by a cal to fpioctl -surprise surprise! The only 
> other unit used by termio is BaseUnix.

Thats correct. If you want to know even more about Unix serial
programming you can read this one:

http://www.easysw.com/~mike/serial/serial.html

Programming examples are in C but you can do all of that in fpc, too.

Or you could try synapse, as someone in this thread mentioned, looks
pretty good (if I had known that it is bsd-licenced, cross plattform and
fpc compatible I would have uesd it from the start, I think ...).

-> http://www.ararat.cz/synapse/

> >>2. I need to respond to the occurence of input on the serial port. 
> >>This is trivial in Tcl - fileevent FileDescriptor FunctionName - how 
> >>do I achieve this in fpc?
> > 
> > 
> > Hum, not sure about this, but maybe a "select" on the port will help?
> > Another possibility would be to watch the status lines (in a separate
> > thread if necessary) or simply the input data ... depend on what event
> > you're waiting for.
> > 
> 
> I think this is an additional filed in the termios structure which I 
> gues is the same as the one used in C.

It's a system call, the doc mentioned above has a chapter about using
it. Or try "man select" in a terminal.

Regards,
Marc


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


[lazarus] Re: how tlabel works?

2006-04-22 Thread roozbeh gholizadeh
On Sat, 22 Apr 2006 20:17:13 +0330, Mattias Gaertner  
<[EMAIL PROTECTED]> wrote:




TCustomLabel is a TGraphicControl which calls Paint in WMPaint.
Check why the wince interface is not sending LM_PAINT messages.


Mattias



Well i checked everything...lm_paint message seems to be ok.
but i came to this that while trying to draw label TWidgetSet.RectVisible  
returns false,becouse GetClipRGN(DC,ClipRGN) returns 0.

i didnt find any call previous to selectcliprgn.
i find out that is only called if doublebuffering is true,which is not.am  
i right or not?


About doublebuffering i dont know much.should it also be activated on  
wince?



--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/

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


[lazarus] SQL error that shouldn't be.

2006-04-22 Thread Jon Foster

Using TMySQL40Connection I tried to use the following query:

   SQLQuery1.sql.text:='SELECT organizations.name as org, 
tests.name as test '+

   'FROM tests INNER JOIN organizations '+
  'ON tests.organization=organizations.id '+
   'WHERE result<>''PASS'' '+
   'ORDER BY tests.name';

When I try "open" the query I received an error indicating that I had an 
error "near INNER JOIN ...". If I paste the query into the MySQL client 
it works. I also removed the word "inner" and tried it but received the 
same message except that it pointed to "join" instead of "inner". 
Rewriting the query like below it worked:


   SQLQuery1.sql.text:='SELECT organizations.name as org, 
tests.name as test '+

   'FROM tests, organizations '+
   'WHERE tests.organization=organizations.id AND 
result<>''PASS'' '+

   'ORDER BY tests.name';

Is there some filtering of the SQL that might be corrupting my query?

--
Jon Foster
JF Possibilities, Inc.
[EMAIL PROTECTED]
541-410-2760
Making computers work for you!

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


Re: [lazarus] Serial comms, events and other stuff

2006-04-22 Thread Ian bell

L505 wrote:

The read-only property is from a User perspective.. user clicks on the edit 
widget and
can't do anythin'.



Can't write anything, I meant.. still can copy/paste, select things.



OK, will cut work?

IAn

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


Re: [lazarus] Serial comms, events and other stuff

2006-04-22 Thread Ian bell

L505 wrote:

Excellent - good to see a sense of humour here. Does this also prevent
me programmaticaly writing to the TMemo? Presumably not else it would
be nought but a BOG label.



The read-only property is from a User perspective.. user clicks on the edit 
widget and
can't do anythin'.
But the programmer can access the edit widget himself, even if read-only is on.


Excellent - precisely what I want.





Do you know where TMemo's methods are documented?



The Delphi docs have pretty similar functionality.. Most of us have a copy of 
Delphi so we
pull open the Delphi help files to look at 


I have several Delphis but they are all windows and I an running Linux 
here. Presumably Kylix is much the same?


- but if you don't have a Delphi CD there might

be some Delphi docs online. If no docs for Delphi online, it means Lazarus team 
and users
should start a documentation project real soon - as many users have asked for 
docs :(.



Sounds like a good idea ;-)

Ian

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


Re: [lazarus] Serial comms, events and other stuff

2006-04-22 Thread L505

> The read-only property is from a User perspective.. user clicks on the edit 
> widget and
> can't do anythin'.

Can't write anything, I meant.. still can copy/paste, select things.

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


Re: [lazarus] Serial comms, events and other stuff

2006-04-22 Thread L505

> Excellent - good to see a sense of humour here. Does this also prevent
> me programmaticaly writing to the TMemo? Presumably not else it would
> be nought but a BOG label.

The read-only property is from a User perspective.. user clicks on the edit 
widget and
can't do anythin'.
But the programmer can access the edit widget himself, even if read-only is on.

>
> Do you know where TMemo's methods are documented?

The Delphi docs have pretty similar functionality.. Most of us have a copy of 
Delphi so we
pull open the Delphi help files to look at - but if you don't have a Delphi CD 
there might
be some Delphi docs online. If no docs for Delphi online, it means Lazarus team 
and users
should start a documentation project real soon - as many users have asked for 
docs :(.

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


Re: [lazarus] how tlabel works?

2006-04-22 Thread Mattias Gaertner
On Sat, 22 Apr 2006 19:56:42 +0330
"roozbeh gholizadeh" <[EMAIL PROTECTED]> wrote:

> Well i have some issues with making tlabel work on wince.
> AS far as i debuged in wince i noticed drawing of label is from  
> TCustomLabel.calcsize and not paint method(why?)

TCustomLabel.CalcSize does not draw. It sets the DT_CalcRect flag to tell
the interface to only calculate the size of the text.
The label is painted in Paint.


> And when my forms startsup i cant see any labels on it.
> but when i do call tcustomlabel.paint method it is drawed.and also with  
> setting breakpoint i noticed the paint method is never called during  
> drawing of form and application startup.
> 
> I've added paint method to calcsize but again it seems to draw the  
> label,but after that forms redraw itselves so it is repainted by form.and 
> 
> nothing again is visible.
> 
> Any hints?and how repainting of labels are done?

TCustomLabel is a TGraphicControl which calls Paint in WMPaint.
Check why the wince interface is not sending LM_PAINT messages.


Mattias

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


[lazarus] how tlabel works?

2006-04-22 Thread roozbeh gholizadeh

Well i have some issues with making tlabel work on wince.
AS far as i debuged in wince i noticed drawing of label is from  
TCustomLabel.calcsize and not paint method(why?)

And when my forms startsup i cant see any labels on it.
but when i do call tcustomlabel.paint method it is drawed.and also with  
setting breakpoint i noticed the paint method is never called during  
drawing of form and application startup.


I've added paint method to calcsize but again it seems to draw the  
label,but after that forms redraw itselves so it is repainted by form.and  
nothing again is visible.


Any hints?and how repainting of labels are done?

regards

--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/

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


[lazarus] Codetools Defines

2006-04-22 Thread Mattias Gaertner
I extended the dialog to view the codetools directory values to show the
templates and how they were parsed.

This dialog is available via 
Source Editor -> Right Mouse click -> Unit Info -> Show CodeTools Values
or via
Environment -> Codetools Defines Editor -> Tools -> Open Preview


Mattias

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


Re: [lazarus] FPC question

2006-04-22 Thread Felipe Monteiro de Carvalho
On 4/21/06, Graeme Geldenhuys <[EMAIL PROTECTED]> wrote:
> Any idea how to rename the title of a page? See the newly added tiOPF
> page. Currently the title is TiOPF and it should read tiOPF.

Wikimedia automatically makes the first letter capitalized.

If you read wikipedia often you will see many articles have notices
saying that the first letter should not be capitalized but is, due to
technical restrictions.

This leads to the conclusion that only throught a hack on the software
you may be able to create a non-capitalized title. It is probably
easier to just use the title as it is and put a notice if you want to
make it clear of the correct name.

--
Felipe Monteiro de Carvalho

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


Re: [lazarus] Serial comms, events and other stuff

2006-04-22 Thread Ian bell

Micha Nelissen wrote:

On Sat, 22 Apr 2006 08:28:15 +0100
Ian bell <[EMAIL PROTECTED]> wrote:



Using BaseUnix, and fpfcntl (which is fcntl in unix) perhaps ?



I think I concluded that myself after some tracing through the source 
code. I can only find baseunix.ppu which is not plain text - is there 
some utility to view this?



The source is in a unit called baseunix.pas, and is in the fpc source tree
in the rtl/unix/ directory.




Thanks - I had it all along - just a question of knowing which subdir 
to look in.


Ian

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


[lazarus] Patch

2006-04-22 Thread Luc

a little patch it removes a declared variable which is not used
Index: F:/lazarus-svn/trunk/lcl/maps.pp
===
--- F:/lazarus-svn/trunk/lcl/maps.pp(revision 9158)
+++ F:/lazarus-svn/trunk/lcl/maps.pp(working copy)
@@ -533,8 +533,6 @@
   begin
 raise EInvalidOperation.Create('Cannot move past end');
   end;
-var
-  Node: TAvgLvlTreeNode;
 begin
   if FInvalid
   then begin
@@ -562,8 +560,6 @@
   begin
 raise EInvalidOperation.Create('Cannot move before start');
   end;
-var
-  Node: TAvgLvlTreeNode;
 begin
   if FBOM then Error;
   FInvalid := False;


Re: [lazarus] Serial comms, events and other stuff

2006-04-22 Thread Micha Nelissen
On Sat, 22 Apr 2006 08:28:15 +0100
Ian bell <[EMAIL PROTECTED]> wrote:

> > Using BaseUnix, and fpfcntl (which is fcntl in unix) perhaps ?
> >  
> 
> I think I concluded that myself after some tracing through the source 
> code. I can only find baseunix.ppu which is not plain text - is there 
> some utility to view this?

The source is in a unit called baseunix.pas, and is in the fpc source tree
in the rtl/unix/ directory.

Micha

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


Re: [lazarus] Serial comms, events and other stuff

2006-04-22 Thread Ian bell

Christian U. wrote:

1. I am connecting to an external microcontoller development board by
a serial interface. I need to be able to set this interface non
blocking. I can see how to open the serial interface using the serial
unit but it is not clear how to set it non blocking.



why you MUST use non-blocking mode ?


Because the device may not respond.

Ian

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


Re: [lazarus] language of version 0.9.14.1

2006-04-22 Thread Matthijs Willemstein
On Sat, 2006-04-22 at 11:34 +0200, Wilfried Mestdagh wrote:

> How to upgrade and keep the English language in the IDE ?
Go to environment -> Environment Options -> Desktop.
You will see a combobox to select the language. Choose English, not
Auto.
Then restart Lazarus.

Matthijs.

-- 
Matthijs Willemstein <[EMAIL PROTECTED]>

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


Re: [lazarus] mantis 436

2006-04-22 Thread Matthijs Willemstein
On Fri, 2006-04-21 at 20:24 +0200, [EMAIL PROTECTED] wrote:
> Can be closed
> http://www.lazarus.freepascal.org/mantis/view.php?id=436
> Verified with 0.9.15.
Done.
As this is an imported issue, the reporter cannot close it. So I closed
the issue.

Matthijs
-- 
Matthijs Willemstein <[EMAIL PROTECTED]>

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


Re: [lazarus] FPC question

2006-04-22 Thread Vincent Snijders

Micha Nelissen wrote:

On Fri, 21 Apr 2006 23:50:08 +0200
"Graeme Geldenhuys" <[EMAIL PROTECTED]> wrote:



Thanks for the help!

Any idea how to rename the title of a page? See the newly added tiOPF
page. Currently the title is TiOPF and it should read tiOPF.



I think MediaWiki automatically uppercases the first letter, I have no clue
why though. This will probably need some PHP hacking to get right :-/.



It is possible, look for example here:
http://forums.macrumors.com/showthread.php?t=167613
It also lists the drawbacks.

I don't know in what version of mediawiki this was added and how to set 
this flag, so if anybody can dig up that information, please send it to me.


Vincent

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


Re: [lazarus] Serial comms, events and other stuff

2006-04-22 Thread Christian U.
> > 1. I am connecting to an external microcontoller development board by
> > a serial interface. I need to be able to set this interface non
> > blocking. I can see how to open the serial interface using the serial
> > unit but it is not clear how to set it non blocking.

why you MUST use non-blocking mode ?
i use synaser and threads with 3 completely different serial communicating
devices at time
and havend any problems.


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


Re: [lazarus] Serial comms, events and other stuff

2006-04-22 Thread Ian bell

Micha Nelissen wrote:

On Fri, 21 Apr 2006 22:28:54 +0100
Ian bell <[EMAIL PROTECTED]> wrote:


1. I am connecting to an external microcontoller development board by 
a serial interface. I need to be able to set this interface non 
blocking. I can see how to open the serial interface using the serial 
unit but it is not clear how to set it non blocking.



Using BaseUnix, and fpfcntl (which is fcntl in unix) perhaps ?
 


I think I concluded that myself after some tracing through the source 
code. I can only find baseunix.ppu which is not plain text - is there 
some utility to view this?


2. I need to respond to the occurence of input on the serial port. 
This is trivial in Tcl - fileevent FileDescriptor FunctionName - how 
do I achieve this in fpc?



Try http://wiki.lazarus.freepascal.org/index.php/Main_Loop_Hooks.



I suspected as much; thanks for the confirmation.

Ian

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


Re: [lazarus] Serial comms, events and other stuff

2006-04-22 Thread Ian bell

Marc Santhoff wrote:

Am Freitag, den 21.04.2006, 22:28 +0100 schrieb Ian bell:

I am just starting to port some programs to fpc using Lazarus form 
Tcl/Tk. I have some questions about things I can do fairly easily in 
Tcl/Tk which I am not sure how to achieve in fpc/lazarus. At present I 
only need Linux specific answers.


1. I am connecting to an external microcontoller development board by 
a serial interface. I need to be able to set this interface non 
blocking. I can see how to open the serial interface using the serial 
unit but it is not clear how to set it non blocking.



For Linux/*nix there is the "serial" unit, does something similar here.
See

/rtl/unix/serial.pp



Yes, as I mentioned above I looked at the 'serial' unit. It seems to 
basicaly call fpopen as expected. To set the serial port paramaters, 
which includes blocking, a call to ioctl is normaly needed which 
appears to be implemented by a call to tcsetattr which I assume is in 
the termio unit. I have now tracked this down and the tcsetattr seems 
to be inplemented by a cal to fpioctl -surprise surprise! The only 
other unit used by termio is BaseUnix. However I can only find 
baseunix.ppu in the source tree - is there some utility that can make 
these human readable?


2. I need to respond to the occurence of input on the serial port. 
This is trivial in Tcl - fileevent FileDescriptor FunctionName - how 
do I achieve this in fpc?



Hum, not sure about this, but maybe a "select" on the port will help?
Another possibility would be to watch the status lines (in a separate
thread if necessary) or simply the input data ... depend on what event
you're waiting for.



I think this is an additional filed in the termios structure which I 
gues is the same as the one used in C.




3. In Tcl/Tk I use a textarea widget with keyboard entry disabled to 
show progress and data. The nearest equivalent in LCL seems to be 
TMemo. How do I disable keyboard input to this and where can I find 
documentation on this and other) components - the wiki seems fairly 
silent on this or do I just assume it work like a Delphi TMemo?



I think setting the property "ReadOnly" to TRUE should do.

Most people seem to use Delphis docs because they have used it before
trying fpc/lazarus. For the basics mostly any doc about Delphi/Object
Pascal would do (from the web, cheap books, ...).



That's handy; I stopped using Deplhi at V3 but I still have the books.

Thanks for the help.

Ian

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


Re: [lazarus] Serial comms, events and other stuff

2006-04-22 Thread Micha Nelissen
On Fri, 21 Apr 2006 22:28:54 +0100
Ian bell <[EMAIL PROTECTED]> wrote:

> 1. I am connecting to an external microcontoller development board by 
> a serial interface. I need to be able to set this interface non 
> blocking. I can see how to open the serial interface using the serial 
> unit but it is not clear how to set it non blocking.

Using BaseUnix, and fpfcntl (which is fcntl in unix) perhaps ?
 
> 2. I need to respond to the occurence of input on the serial port. 
> This is trivial in Tcl - fileevent FileDescriptor FunctionName - how 
> do I achieve this in fpc?

Try http://wiki.lazarus.freepascal.org/index.php/Main_Loop_Hooks.

Micha

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


Re: [lazarus] FPC question

2006-04-22 Thread Micha Nelissen
On Fri, 21 Apr 2006 23:50:08 +0200
"Graeme Geldenhuys" <[EMAIL PROTECTED]> wrote:

> Thanks for the help!
> 
> Any idea how to rename the title of a page? See the newly added tiOPF
> page. Currently the title is TiOPF and it should read tiOPF.

I think MediaWiki automatically uppercases the first letter, I have no clue
why though. This will probably need some PHP hacking to get right :-/.

Micha

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


Re: [lazarus] Serial comms, events and other stuff

2006-04-22 Thread Ian bell

L505 wrote:

Try the ReadOnly property, set it to false



Er, it seems to default to false; did you mean set it true? that would 
make sense.





Yes.. sorry. Do the opposite of what I say.

var
  CorrectAnswer: boolean;
begin
  if Lars.Responds  then
CorrectAnswer:= not Lars.Answer;
end;



Excellent - good to see a sense of humour here. Does this also prevent 
me programmaticaly writing to the TMemo? Presumably not else it would 
be nought but a BOG label.


Do you know where TMemo's methods are documented?

Ian

Ian

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