[lazarus] Freeing runtime components.

2008-01-14 Thread Patrick Shepherd
Sorry for such a simple question but I'm just getting back to programming
(as a hobby).  Haven't done much since TP5.

Anyway, if I create a component eg TPanel during runtime and set it's owner
property to a form, do I have to write code to free the panel or is there
already code in the forms destructor to free owned classes?


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


Re: [lazarus] how to receive an http request

2007-06-04 Thread patrick feillant

Hello, for acces to and URL html, i use the Lnet Package , and the visual
components TLHttpClientComponent, it's very Easy. There are also components
not visual.
I can send you an example if you want, but you have to download, open the
package file in Lazarus, and rebuilt Lazarus, the installation  text is in
the download.
Bye

2007/6/4, Carlos Avogaro <[EMAIL PROTECTED]>:


Hi,

I need to receive this from my lazarus program:

http://201.204.xxx.xx:8090/?setVar1=3000

I need to read that parameter in that port from my lazarus application,
what unit I have to use?

Thanks

--
Building a website is a piece of cake.
Yahoo! Small Business gives you all the tools to get 
online.




[lazarus] international dates

2007-06-02 Thread patrick feillant

Thanks at every one for the responses.
Finally this morning i put in the Initialization section of my main unit a
call to this simply routine i had create, and after all the routine dates i
use are ok. i take the english initialization in sysinth.inc.
The array must begin at 1 and not at 0 !
But is not a generic solution for all the others params.
thanks.

{Initialisation des données francaises pour unix}
Procedure InitFrancais;
begin
  DateSeparator:='/';

  { Format used for short date notation }
  ShortDateFormat:= 'dd/mm/';

  { Format used for long date notation }
  LongDateFormat:= 'dd" "" "';

  { Short names of months. }
  ShortMonthNames[1]:= 'Jan';
  ShortMonthNames[2]:= 'Fév';
  ShortMonthNames[3]:= 'Mar';
  ShortMonthNames[4]:= 'Avr';
  ShortMonthNames[5]:= 'Mai';
  ShortMonthNames[6]:= 'Jui';
  ShortMonthNames[7]:= 'Jul';
  ShortMonthNames[8]:= 'Aou';
  ShortMonthNames[9]:= 'Sep';
  ShortMonthNames[10]:= 'Oct';
  ShortMonthNames[11]:='Nov';
  ShortMonthNames[12]:='Déc';

  { Long names of months. }
  LongMonthNames[1]:= 'Janvier';
  LongMonthNames[2]:= 'Février';
  LongMonthNames[3]:= 'Mars';
  LongMonthNames[4]:= 'Avril';
  LongMonthNames[5]:= 'Mai';
  LongMonthNames[6]:= 'Juin';
  LongMonthNames[7]:= 'Juillet';
  LongMonthNames[8]:= 'Aout';
  LongMonthNames[9]:= 'Septembre';
  LongMonthNames[10]:= 'Octobre';
  LongMonthNames[11]:='Novembre';
  LongMonthNames[12]:='Décembre';

  { Short names of days }
  ShortDayNames[1]:='Dim';
  ShortDayNames[2]:='Lun';
  ShortDayNames[3]:='Mar';
  ShortDayNames[4]:='Mer';
  ShortDayNames[5]:='Jeu';
  ShortDayNames[6]:='Ven';
  ShortDayNames[7]:='Sam';


  { Full names of days }
  LongDayNames[1]:= 'Dimanche';
  LongDayNames[2]:= 'Lundi';
  LongDayNames[3]:= 'Mardi';
  LongDayNames[4]:= 'Mercredi';
  LongDayNames[5]:= 'Jeudi';
  LongDayNames[6]:= 'Vendredi';
  LongDayNames[7]:= 'Samedi';
end;


[lazarus] international dates

2007-06-01 Thread patrick feillant

Hi,
I have a Ubuntu 7.04 french installation, so if i type $date ---> vendredi 1
juin 2007, 23:14:41 (UTC+0200)
That's ok.
In Lazarus, the variables   ShortDateFormat,  LongDateFormat,
ShortMonthNames, LongMonthNames ,ShortDayNames.. are initialize in the
sysutils initialization section, from the system parameters by the
InitInternational routine ..
But i always have the date in the english format, Sunday ...
I don't resolve this problem.
Somebody can help me to try the solution.
Thanks.


Re: [lazarus] Wince Crossbin utils windows installer don't works

2007-06-01 Thread patrick feillant

hello
try this, free download with image os
http://www.microsoft.com/downloads/details.aspx?FamilyId=C62D54A5-183A-4A1E-A7E2-CC500ED1F19A&displaylang=en

Then i write in another message

"
When you run your emulateur, you give the repertorie witch is shared between
lazarus (compile exe) and the emulator.
ex : "C:\Program Files\Microsoft Device Emulator\1.0\DeviceEmulator.exe"
pocketpc.nb0 /skin Pocket_PC.xml /memsize 128 /sharedfolder C:\LzProjet\man\

Here i lunch the emulator with
image Os Wince : pocketpc.nb0 (same directorie as exe of emulator)
Picture of the pocket Pc model : /skin pocket_pc.xml  (one in the emulator
install)
size of Ram : /memsize 128 (for exemple 128 meg)
directorie share : /sharefolder C:\LzProjet\man\  ( my lazarus project is,
and for exemple with an test.exe

You compile under lazarus to have a test.exe

Under the emulator, you lunch "file explorator" (programs), and you go to
"Sd card", your Sd Card is the shared directorie.
You click on test.exe.

You had to stop the run each time before recompile, or the file will be
busy (test.exe used by emulator). The (X) on the rigth of the windows don't
stop the run on pocket pc, you must stop the run by a button witch close the
main window. (or you stop the process under system / memory / stop process.

I also access to the web under the emulator, test that in a first time.
bye.
Patrick from France, excuse me for my english..
"
For web access in the emulator, i have made a somes succesfulls test with
the Lnet package of Ales in wince.
I can give you the solutions if you need for the connexion of the emulator
to the web with ActiveSync if you now. (i find a very simple solution on the
web).
All that is on Windows.

I'll like to test all that on Ubuntu 7.04 with Wine for the emulator, but i
don't know today if it's possible to run Cross compiler wince on linux i386.

i'll make an inventory of all the problems i detect on wince, there are many
simple screen objects then don't run correctly (i declare in bug tracker).

I hope respond to yours answers.
bye

2007/6/1, Carlos Avogaro <[EMAIL PROTECTED]>:


Hi patrick

where I can find the pocket pc emulator ?

Thank you

*patrick feillant <[EMAIL PROTECTED]>* wrote:

Hello
 I install today, Lazarus-0.9.23-fpc-2.1.5-20070531-win32.exe
Lazarus-0.9.23-fpc-2.1.5-20070531-cross-arm-wince-win32.exe (i see in your
mail here that it exist !!)
Is the Cross-arm-wince make every day , is not accessible in the
snapshots.

I test my prog on pocket pc emulator, it'is ok.

Another question, i try to access with SVN to the trunc as ask to me for
download source wince, i don't have any user and password, what is the
procedure. Finally your mail permit me to update my configuration.

Thanks




2007/5/31, Vincent Snijders <[EMAIL PROTECTED]>:
>
> [EMAIL PROTECTED] schreef:
> > Hi ;)
> >
> > I just downloaded and installed the new lazarus+crosswince but they
> don't
> > works.
> >
> > The file I downloaded are:
> > Lazarus-0.9.23-fpc-2.1.3-20070424-win32.exe
> > Lazarus-0.9.23-fpc-2.1.3-20070422-cross-arm-wince-win32.exe
> >
> > After installing, I opened lazarus and pressed F9 to compile a idle
> > project, it worked.
> >
> > After changing target os and cpu to wince and arm (in al the three
> > comboboxes), I pressed control + f9 and got this errors:
> > project1.lpr(19) Warning: Object wincemenures.or not found, Linking
> may
> > fail !
> > project1.lpr(19) Warning: Object wincemenures.or not found, Linking
> may
> > fail !
> > project1.lpr(19) Error: Can't open object file: wincemenures.or
> > project1.lpr(19) Fatal: There were 1 errors compiling module, stopping
> >
>
> I have uploaded a new arm-wince cross installer. In this version (with
> fpc 2.1.5)
> this bug has been fixed.
>
> You can download it from
> ftp://ftp.hu.freepascal.org/pub/lazarus/cross
>
> Vincent
>
> _
> To unsubscribe: mail [EMAIL PROTECTED] with
>"unsubscribe" as the Subject
>   archives at http://www.lazarus.freepascal.org/mailarchives
>


--
Fussy? Opinionated? Impossible to please? Perfect. Join Yahoo!'s user
panel<http://us.rd.yahoo.com/evt=48516/*http://surveylink.yahoo.com/gmrs/yahoo_panel_invite.asp?a=7+>and
 lay it on us.




Re: [lazarus] Wince Crossbin utils windows installer don't works

2007-05-31 Thread patrick feillant

I use that, find in page "http://www.freepascal.org/develop.html#svn"; in
tortoise svn on windows
(http://svn.freepascal.org/svn/fpc/trunk fpc), it'is the first time i use
it, may be is not correct.

To retrieve the full fpc source repository, type

svn checkout http://svn.freepascal.org/svn/fpc/trunk fpc



2007/5/31, Vincent Snijders <[EMAIL PROTECTED]>:


patrick feillant schreef:
> Hello
>  I install today,
> Lazarus-0.9.23-fpc-2.1.5-20070531-win32.exe
> Lazarus-0.9.23-fpc-2.1.5-20070531-cross-arm-wince-win32.exe (i see
> in your mail here that it exist !!)
> Is the Cross-arm-wince make every day , is not accessible in the
snapshots.
>

No, it is not made every day. Maybe in the future it will.

> I test my prog on pocket pc emulator, it'is ok.

Thanks for testing. :-)


>
> Another question, i try to access with SVN to the trunc as ask to me for
> download source wince, i don't have any user and password, what is the
> procedure. Finally your mail permit me to update my configuration.

What svn url did you use?

http://svn.freepascal.org/svn/fpc/trunk ?

Vincent

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



Re: [lazarus] Wince Crossbin utils windows installer don't works

2007-05-31 Thread patrick feillant

Hello
I install today, Lazarus-0.9.23-fpc-2.1.5-20070531-win32.exe
Lazarus-0.9.23-fpc-2.1.5-20070531-cross-arm-wince-win32.exe (i see in your
mail here that it exist !!)
Is the Cross-arm-wince make every day , is not accessible in the snapshots.

I test my prog on pocket pc emulator, it'is ok.

Another question, i try to access with SVN to the trunc as ask to me for
download source wince, i don't have any user and password, what is the
procedure. Finally your mail permit me to update my configuration.

Thanks




2007/5/31, Vincent Snijders <[EMAIL PROTECTED]>:


[EMAIL PROTECTED] schreef:
> Hi ;)
>
> I just downloaded and installed the new lazarus+crosswince but they
don't
> works.
>
> The file I downloaded are:
> Lazarus-0.9.23-fpc-2.1.3-20070424-win32.exe
> Lazarus-0.9.23-fpc-2.1.3-20070422-cross-arm-wince-win32.exe
>
> After installing, I opened lazarus and pressed F9 to compile a idle
> project, it worked.
>
> After changing target os and cpu to wince and arm (in al the three
> comboboxes), I pressed control + f9 and got this errors:
> project1.lpr(19) Warning: Object wincemenures.or not found, Linking may
> fail !
> project1.lpr(19) Warning: Object wincemenures.or not found, Linking may
> fail !
> project1.lpr(19) Error: Can't open object file: wincemenures.or
> project1.lpr(19) Fatal: There were 1 errors compiling module, stopping
>

I have uploaded a new arm-wince cross installer. In this version (with fpc
2.1.5)
this bug has been fixed.

You can download it from
ftp://ftp.hu.freepascal.org/pub/lazarus/cross

Vincent

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



Re: [lazarus] Burn to CD

2007-05-26 Thread patrick feillant

hello, ISOBUSTER is very efficient for recover the files on CD, i use it
once time, but you have to find a key (on Windows).

2007/5/26, Darmawan Sugiarto <[EMAIL PROTECTED]>:


Hey anyone know... how to read file in CD (burn CD)
Thanks


=INTOSOFT
ALEXIO CHAOS
[EMAIL PROTECTED]
Yahoo Messager
=

--
Building a website is a piece of cake.
Yahoo! Small Business gives you all the tools to get 
online.



Re: [lazarus] Support for Wince Dialog OK button

2007-05-11 Thread Patrick Chevalley

All change to WindowProc must compile without problem with any FPC because
IDOK and IDCANCEL are also defined in LCLType.pp that take precedence to the
one in rtl/wince/wininc/define.inc

OK button fully work with current 2.1 FPC.

Cancel event IDCANCEL compile now but the cancel button cannot be activated
until the new constant SHDB_SHOWCANCEL is include to FPC.
At the moment this constant is not used by Lazarus and the event processing
in WindowProc is just a convenience for people that want to add this button
themself.

Patrick


Re: [lazarus] Support for Wince Dialog OK button

2007-05-10 Thread Patrick Chevalley

2007/5/10, Mattias Gaertner <[EMAIL PROTECTED]>:


Or, if the 'ok' button of the wince form is merely a 'default' button,
then
  if (TheForm.DefaultControl<>nil) then
TheForm.DefaultControl.ExecuteDefaultAction;



Thanks Mattias! , I really like this solution as it also work for mbYes and
other. It work very well and I think this is safe to use because the
messagedialog default button is consistently set by ModalDefaultButton().

I also add IDCANCEL to execute TheForm.CancelControl.ExecuteCancelAction in
the same manner because I finally get SHDoneButton to change the OK button
by Cancel to test that, you must call it with parameter SHDB_SHOWCANCEL
whose value is $0004. I send the change for the wince RTL to add this
constant now.
Not sure if it is a good idea to put a Cancel button on the top bar but this
is good to have if someone need that.

If no other remark, I think this patch can be applied now.

Patrick


wince_top_btn.patch
Description: Binary data


Re: [lazarus] Support for Wince Dialog OK button

2007-05-09 Thread Patrick Chevalley

2007/5/8, Mattias Gaertner <[EMAIL PROTECTED]>:



I'm not sure. No other widget set supports forms with Ok buttons. Only
close buttons. That's why everyone puts an OK-TButton on every
dialog.



Right, in this case it is best to do all in wince interface and not pollute
the LCL with that.

How does the wince intf know, that the LCL form supports a Result

of mrOK?



Maybe testing fsModal in FormState.
In this case the button do nothing if the form is not modal, but generally
if you select a borderstyle of bsDialog this is for a modal form.
The only other solution to show this button on the top bar is to call the
SHDoneButton api, otherwise it show the X button that put the application in
the background without any message for us.

This give :
if (WindowInfo^.WinControl is TCustomForm) and
 (fsModal in TCustomForm(WindowInfo^.WinControl).FormState) then
   case lo(WParam) of
 IDOK: TCustomForm(WindowInfo^.WinControl).ModalResult:=mrOK;
   end;

Do this look right ?

The "case .." is because we can also trap an IDCANCEL message after changing
the OK button by a Cancel button with a SHDoneButton call but I still not
manage to find the right parameter for that.

Patrick


[lazarus] Support for Wince Dialog OK button

2007-05-08 Thread Patrick Chevalley
This patch add support for the small OK button that appear in the top menu 
when a form borderstyle is bsDialog. This work as documented, this button send 
WN_COMMAND with IDOK.


The patch directly set ModalResult to mrOK on this event, I am not sure if 
this is the right way to do or if a LCL message must be raised for that?


Anyway it work and we can now close a modal form or a showmessage with this OK 
button.


Patrick


Index: lcl/interfaces/wince/wincecallback.inc
===
--- lcl/interfaces/wince/wincecallback.inc	(revision 11105)
+++ lcl/interfaces/wince/wincecallback.inc	(working copy)
@@ -1127,6 +1127,11 @@
 CBN_CLOSEUP:
   UpdateComboBoxText(TCustomComboBox(lWinControl));
   end;
+{ WINCE menubar OK button }
+if WindowInfo^.WinControl is TCustomForm then
+  case lo(WParam) of
+IDOK: TCustomForm(WindowInfo^.WinControl).ModalResult:=mrOK;
+  end;
   end;
 
   // no specific message found? try send a general msg


Re: [lazarus] WinCE onMouseMove patch

2007-05-03 Thread Patrick Chevalley

Thank you Vincent to apply this.

Make me know how does it works, I use only the windows installers 
libraries (created by fpcfan and uploaded into the /cross/ ftp path) 
due to compilation issues...

Now it work at least with the svn version.

I also find more easy to use the precompiled installer for the 
cross-compiler but I also like to update from the svn.

This is how I do :
- install the last snapshot Lazarus-full-fpc 2.1.3 and last 
cross-arm-wince installer
- on a separate directory (i.e. C:\lazsvn) get the lazarus source from 
the svn
- copy all the content of C:\lazsvn over your Lazarus directory, 
including the .svn directories.
- launch Lazarus, Build Lazarus with clean all, then rebuild the wince 
LCL as after a standard svn update.

now you can regularly update Lazarus from the svn.
If a compiler update is require just restart the whole procedure.
I never have any compilation issues since I use this method.

Maybe some day I will learn how to build correctly a cross-compiler :-)

Patrick


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


[lazarus] WinCE onMouseMove patch

2007-05-02 Thread Patrick Chevalley

Hi,

Any clue why WM_MOUSEMOVE message processing is commented out in
wincecallback.inc ?

The following patch remove the comment and all is working fine.
On a PocketPC the mousemove event is raised when you drag the stylus on the
screen surface.
With this change I am now able pan a big image on the screen using the
stylus.

If no objection can someone apply this patch, thanks!

Patrick
Index: lcl/interfaces/wince/wincecallback.inc
===
--- lcl/interfaces/wince/wincecallback.inc	(revision 11043)
+++ lcl/interfaces/wince/wincecallback.inc	(working copy)
@@ -1516,8 +1516,7 @@
   NotifyUserInput := True;
   LMessage.Msg := LM_LEAVE;
 End;
-//roozbeh : we dont have mousemove right?so any need for this?
-{WM_MOUSEMOVE:
+WM_MOUSEMOVE:
 Begin
   NotifyUserInput := True;
   PLMsg:[EMAIL PROTECTED];
@@ -1541,7 +1540,7 @@
   WindowInfo^.MouseY := YPos;
 end;
   End;
-End;}
+End;
 WM_MOUSEWHEEL:
 Begin
   NotifyUserInput := True;


Re: [lazarus] Managing Cross Platform Projects

2007-03-22 Thread Patrick Chevalley


The other major concern that held me back was about
how much disk space an SVN implementation consumes over time as it
grows, and how big a backup of the SVN server data would be compared to
my present method. What are your experiences?



I use rsync to backup my sourceforge project svn, this is quite efficient in
term of backup time.
The full svn repository is now 82MB whereas a source snapshot is 30MB.
(single man, win/linux project with about 700 updates)

SVN and Packages is really the way to go for cross platform project. It is
very easy and reliable to update/commit on any platform.
In the past I do myself some fright by manually copy the files to a Samba
share ...


Re: [lazarus] TexOut incompability

2007-02-05 Thread Patrick Chevalley

With this morning version (10597) TLabel are working as expected but I have
still problem with Canvas.Textout because it ignore
Canvas.TextStyle.Opaquesetting to false.

To reproduce put a bitmap on a TImage and do the following:
Image1.Picture.Bitmap.Canvas.TextStyle.Opaque:=true;
Image1.Picture.Bitmap.Canvas.TextOut(10,10,'opaque');
Image1.Picture.Bitmap.Canvas.TextStyle.Opaque:=false;
Image1.Picture.Bitmap.Canvas.TextOut(10,40,'transparent');

Both text appear on a white background.

Maybe this is related to this IDE problems:
- on "Configure Build Lazarus" each text is on a gray background instead of
white.
- on the property editor  you cannot read a combobox current line when
dropped, the text is white on white instead of white on blue (rest of the
line is blue).

Patrick


Re: [lazarus] Fullscreen?

2006-12-24 Thread Patrick Chevalley

Hi,

In my application I use successfully SetWindowFullScreen for Gtk.

For Win32 I use the following function since Delphi time for many years.
To try just put a checkbox in a form and assign onChange to the following.
This can probably be adapted to implement SetWindowFullScreen for Win32.

Patrick


Uses Windows;

procedure TForm1.CheckBox1Change(Sender: TObject);
var NewLong: LongInt;
begin
if CheckBox1.Checked then begin
  NewLong := GetWindowLong(Form1.handle, GWL_STYLE);
  SetWindowLong(Form1.handle, GWL_STYLE, (NewLong And (Not 
WS_THICKFRAME) And (Not WS_BORDER) And (Not WS_CAPTION) And (Not 
WS_MINIMIZEBOX) And (Not WS_MAXIMIZEBOX)));
  SetWindowPos(Form1.handle, 0, 0, 0, 0, 0, SWP_FRAMECHANGED Or 
SWP_NOMOVE Or SWP_NOSIZE Or SWP_NOZORDER);

  WindowState:=wsMaximized;
end
else
begin
  NewLong := GetWindowLong(Form1.handle, GWL_STYLE);
  SetWindowLong(Form1.handle, GWL_STYLE, (NewLong Or WS_THICKFRAME Or 
WS_BORDER Or WS_CAPTION Or WS_MINIMIZEBOX Or WS_MAXIMIZEBOX));
  SetWindowPos(Form1.handle, 0, 0, 0, 0, 0, SWP_FRAMECHANGED Or 
SWP_NOMOVE Or SWP_NOSIZE Or SWP_NOZORDER);

  WindowState:=wsNormal;
end;
end;



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


Re: [lazarus] Changes in TDateEdit

2006-11-28 Thread Patrick Chevalley

I agree Text is not necessary.
The only problem is it break compatibility with existing .lfm so you have to
remove it manually from the file.


Re: [lazarus] Stretchdraw implemented.

2006-11-26 Thread Patrick Chevalley


Never mind, the docs say this. Applied the patch, thanks.



Thanks!

I confirm the bug report 1907, 6983 and 7356 can be marked as resolved,
zooming in the example imgviewer and the sample application submitted with
7356 produce nice result.

Patrick


Re: [lazarus] Stretchdraw implemented.

2006-11-25 Thread Patrick Chevalley

Thank you Mattias and Christian for your informations!
I first think that TCanvas and TFPCanvas where much more related but this is
not the case.

Using your informations I do the following patch for  win32winapi.inc
TWin32WidgetSet.StretchMaskBlt and this solve the problem!

I think this solve the bug report 1907 and 6983.

TFPCanvas.StretchDraw remain interesting in specific case, particulary if
you want non pixelized zooming but I understand that speed is more important
for the default function.

Patrick


win32winapi.patch
Description: Binary data


Re: [lazarus] Stretchdraw implemented.

2006-11-24 Thread Patrick Chevalley

Hi,

I start to play with you new stretchdraw,  this work fine with today Lazarus
snapshot.
I quickly hack TCanvas.StretchDraw to use it and I am pleased with the first
result as this solve the ugly stretchdraw we have previously on Win32. See
the attached image that show the result,new stretchdraw on right :) , this
is a TImage with Stretch property to true.

This is how I change TCanvas.StretchDraw, any idea to avoid this multiple
conversion from TGraphic to TBitmap to TFPCustomImage ?

procedure TCanvas.StretchDraw(const DestRect: TRect; SrcGraphic: TGraphic);
var img: TLazIntfImage;
   bmp: TBitmap;
begin
 if not Assigned(SrcGraphic) then exit;
 Changing;
 RequiredState([csHandleValid]);
//  SrcGraphic.Draw(Self, DestRect);
// added for FPCanvas.Strechdraw
 bmp:=TBitmap.Create;
 bmp.Assign(SrcGraphic);
 img:=bmp.CreateIntfImage;
 Inherited StretchDraw(DestRect.Left,DestRect.Top,
  DestRect.Right-DestRect.Left,DestRect.Bottom-DestRect.Top
,img);
 img.free;
 bmp.free;
//
 Changed;
end;
<>


Re: [lazarus] Background Painting Problem in Linux

2006-06-16 Thread Patrick Chevalley
Nice simplification Paul! I just want to confirm that "DoubleBuffered := True" is necessary for Win32, otherwise there is a lot of flickering.  It seem to do nothing on Gtk1 so I avoid a $ifdef.Patrick



Re: [lazarus] Background Painting Problem in Linux

2006-06-15 Thread Patrick Chevalley
In a first time I set the background of the underlaying panel to black 
but this is not necessary and now it is clBtnface.
The sky chart is first draw to a Tbitmap. In the drawing component 
onPaint  I just draw this bitmap to the canvas along with temporary 
drawing if any (selection mark, ...).
Using a Timage there is a lot of flicker, when resizing, but also when 
drawing a temporary lines directly with pen.mode=pmXor.

With the drawing component there is no problem.

This is unfortunately not the  most simple application to use as an 
example but if you want to look at the source code it is at: 
http://svn.sourceforge.net/viewcvs.cgi/skychart/trunk/skychart/

The drawing component is in pu_chart.pas.

Patrick

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


Re: [lazarus] Background Painting Problem in Linux

2006-06-15 Thread Patrick Chevalley
My app will redraw the entire client from a bitmap and not needthe background fill first.
Do you look at 
http://wiki.lazarus.freepascal.org/index.php/Developing_with_Graphics#Motion_Graphics_-_How_to_Avoid_flickering


I use the custom control option for my Skychart application and this work very well.

Patrick


Re: [lazarus] MacOSX Intel and Lazarus

2006-05-10 Thread Patrick Chevalley



Can you please help me on the procedure?
How can I rebuild these libraries from source?



Instead of :
sudo /sw/bin/apt-get install gdk-pixbuf gtk+ gtk+-data gtk+-shlibs 
gtk-doc gtk-engines

run :
fink install gdk-pixbuf gtk+ gtk+-data gtk+-shlibs gtk-doc gtk-engines
you may have to remove your ppc lib first.

look also at the fink faq
http://fink.sourceforge.net/faq/index.php
and the command usage:
http://fink.sourceforge.net/doc/bundled/usage.php

Patrick

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


Re: [lazarus] MacOSX Intel and Lazarus

2006-05-10 Thread Patrick Chevalley

Hi,

I install Lazarus on Mac/Intel without problem using the Lazarus 
snapshot package.

The procedure is almost the same as describe in the wiki for ppc.
The only difference is Fink do not have  binary  package for Intel at 
the moment so it is necessary to accept to rebuild from source. Do not 
set the option to bypass architecture test!  This is very easy and 
automated, it just take some time.


Patrick

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


Re: [lazarus] Problem with the Calendar Component

2006-04-11 Thread Patrick Chevalley
Maybe this is more what you want:Calendar1.DateTime:=Calendar1.DateTime+1;


Re: [lazarus] Combobox error after svn8961

2006-03-27 Thread Patrick Chevalley
Please test with my last tcomboBox patch (for me it helps)I tested with last svn 9027 and apply the patch from your yesterday message. 
This solve all the problem!  both my application and Lazarus debugger options work without problem. Thank you!


Re: [lazarus] Combobox seg fault after 8961

2006-03-27 Thread Patrick Chevalley
Seems the same as issue 1927:
http://www.lazarus.freepascal.org/mantis/view.php?id=1927Yes, this look very similar. I am sorry for the double post, maybe we continue on the other thread. Patrick


Re: [lazarus] Resizable forms

2006-03-14 Thread Patrick Chevalley
Hi, Even on my computer, that has a slightly bigger standard font on
Windows, most forms from the IDE look bad.I also remark this problem with my application,  only with Windows big font, all the testing I do with Gtk at different screen resolution do not show this problem.
I solve by calling this function after form.create : scale := Screen.PixelsPerInch / myform.PixelsPerInch{$ifdef win32}ScaleForm(myform,scale);
{$endif}procedure ScaleForm(form: TForm; scale: single);var
 i: integer;beginif abs(1-scale)>0.1 then  // 
do not scale for 10%with form do begin
   width := round( width * scale );   height := round( height * scale );   for i := 0 to ComponentCount-1 
do begin  if ( Components[i] is TControl ) then with (Components[i] as TControl) 
do begin width := round( width * scale ); height := round( height * scale ); top := round( top * scale ); left := round( left * scale );
  end;   end;end;end;Maybe this can be implemented in TCustomForm ? but this is outside of my competence.
If I remember Delphi as a TForm.Scaled property that do something like that.Patrick


Re: [lazarus] Showing URL in default browser

2006-02-22 Thread Patrick Chevalley
I think it is nice to first try to launch the default application defined in KDE or GNOME, this not necessarily Konqueror or Galeon.To do that use  "kfmclient exec" or "gnome-open".This work not only for url but also for any mime type.  For example launch Xpdf or Acroread as defined in the desktop preference for a pdf file.
Patrick


[lazarus] Component for to do backup !!

2006-02-11 Thread Patrick



does anybody know any backup component ??? 

like the file attached.
if anybody to get compile it tell me pls 
!!!


backup.pas
Description: Binary data


[lazarus] C:\lazarus_ins\lcl\FileUtil.pas(111,2) Fatal: Can't open include file "fileutil.inc"

2006-02-11 Thread Patrick



I don't know what is this, but I created a package 
put it on just a unit (uses classes, sysutils, Dialogs) when I try build appear 
this unit with error
 
Thanks
Patrick Carvalho


Re: [lazarus] Scaling an image

2006-02-02 Thread Patrick Chevalley
I think your output image miss some header or color table from the input one.
The solution I use is to load the destinterface using the input bitmap.

Try to remove :
  bmpEnlargedDisplay.Width := CXScreen * 2;
  bmpEnlargedDisplay.Height := CYScreen * 2;

Replace :
   DestInterface.LoadFromBitmap(bmpDisplay.Handle, 0);

Add:
   DestInterface.SetSize(CXScreen * 2,CYScreen * 2);

Also beware that this line may eat resources:
DestInterface.CreateBitmap(TempHandle, TempMask, false); 

If you really not want the mask use:

   DestInterface.CreateBitmap(TempHandle, TempMask, false);
   TrashBmp.Handle=TempMask;
   TrashBmp.FreeImage;
   bmpEnlargedDisplay.FreeImage;
   bmpEnlargedDisplay.Handle := TempHandle;

Any better idea ??

Patrick


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


Re: [lazarus] "tooltip expression evaluation" feature?

2006-01-31 Thread Patrick Chevalley

I never mind this feature was implemented as it never worked for me.

Just try now on Win2k, WinXP and Linux using 0.9.11 svn, I alway get the 
same behavior:

- tool bar button hint work
- object inspector hint work
- form designer hint work
- but nothing in the code editor

In debug ctrl+alt+L show the local variable but not in the editor.

The Editor Option, Code Tools show:
- Identifier completion: checked
- Tooltip symbol Tools: disabled unchecked
- Code parameters: disabled checked
- Tooltip expression evaluation: checked

Patrick

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


Re: [lazarus] revision 8625

2006-01-28 Thread Patrick Chevalley
Finally found the problem after I take a full diff with 8624 and add 
debugln at each change.


The faulty is TGtkWidgetSet.Frame3d
It really not like the nil here :

  gtk_paint_shadow(theStyle,
   AWindow, GTK_STATE_NORMAL,
   ShadowType,
   @Area,
   {ClientWidget}nil,
   {'button'}nil,
   ARect.Left+DCOrigin.X, ARect.Top+DCOrigin.Y,
   ARect.Right-ARect.Left, ARect.Bottom-ARect.Top);

Commenting this call or revert the following change and all work fine, 
no need for DisableWidgetColor conditional.


Patrick

--- gtkwinapi.inc   (revision 8625)
+++ gtkwinapi.inc   (revisiom 8624)
@@ -3954,7 +3954,7 @@
   (GTK_SHADOW_NONE, GTK_SHADOW_ETCHED_IN, GTK_SHADOW_ETCHED_OUT, 
GTK_SHADOW_NONE);


 var
-  //Widget, ClientWidget: PGtkWidget;
+  Widget, ClientWidget: PGtkWidget;
   i : integer;
   DCOrigin: TPoint;
   TheStyle: PGtkStyle;
@@ -3975,6 +3975,13 @@
   Result:= False;
   exit;
 end;
+Widget:=PGtkWidget(TDeviceContext(DC).Wnd);
+ClientWidget:=Widget;
+if Widget<>nil then begin
+  ClientWidget:=GetFixedWidget(Widget);
+  if ClientWidget=nil then
+ClientWidget:=Widget;
+end;
 AWindow:=Drawable;
 DCOrigin:=GetDCOffset(TDeviceContext(DC));
 Area.X:=ARect.Left+DCOrigin.X;
@@ -3991,12 +3998,12 @@
 //'');

 for i:= 1 to FrameWidth do begin
-  gtk_paint_shadow(theStyle,
+  gtk_paint_shadow(TheStyle,
AWindow, GTK_STATE_NORMAL,
ShadowType,
@Area,
-   {ClientWidget}nil,
-   {'button'}nil,
+   ClientWidget,
+   'button',
ARect.Left+DCOrigin.X, ARect.Top+DCOrigin.Y,
ARect.Right-ARect.Left, ARect.Bottom-ARect.Top);
   // inflate the rectangle (! ARect will be returned to the user 
with this)


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


Re: [lazarus] revision 8625

2006-01-27 Thread Patrick Chevalley

> Can you update and try compiling lazarus with -dDisableWidgetColor?

This not change the problem.
I add a few DebugLn in SetWidgetColor, just before your ifdef.
By comparison of the trace with a working theme the segfault occur after 
the last passage to SetWidgetColor.


Starting program: /home/pch/lazarus/lazarus
Reading symbols from shared object read from target memory...done.
.
SetWidgetColor Start
SetWidgetColor ChangeFGColor:=FALSE
SetWidgetColor ChangeBGColor:=TRUE
SetWidgetColor DisableWidgetColor exit
.
SetWidgetColor Start
SetWidgetColor ChangeFGColor:=FALSE
SetWidgetColor ChangeBGColor:=FALSE
SetWidgetColor exit
SetWidgetColor Start
SetWidgetColor ChangeFGColor:=FALSE
SetWidgetColor ChangeBGColor:=FALSE
SetWidgetColor exit

Gtk-WARNING **: invalid cast from (NULL) pointer to `GtkWidget'

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1213147456 (LWP 8596)]
0xb79ad411 in gdk_rgb_find_color () from 
/usr/lib/gtk/themes/engines/libgalaxy.so

Current language:  auto; currently c
(gdb) bt
#0  0xb79ad411 in gdk_rgb_find_color () from 
/usr/lib/gtk/themes/engines/libgalaxy.so

#1  0x in ?? ()


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


Re: [lazarus] revision 8625

2006-01-27 Thread Patrick Chevalley

Hi,

I just install the last svn 8634 on MDK 2006 and get the same error, 
previously 8614 worked.


The fault is with the Galaxy theme.
Type "export GTK_RC_FILES=" to use an empty theme, or use another one 
like "export GTK_RC_FILES=/usr/share/themes/BrushedMetal/gtk/gtkrc"

and this work fine.

The problem is that any application will now crash by default on 
Mandriva :-(


Patrick

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