Re: [lazarus] postgres revisited

2008-02-08 Thread Marc Weustink

Alex du Plessis wrote:

Alex du Plessis wrote:

Hi all

Earlier I reported a problem finding libpq.dll.  I then suspected a 
problem on my disc and did a complete  Windows XP re-install, followed 
by a postgres 8.3 install and then  a  Lazarus 0.9.25  re-install.


I started by changing fpc.cfg to add the library path of the libpq.dll 
file to fpc.cfg and that had no effect.  The TPQConnection still could 
not find the file libpq.dll when trying to set the connection to 
active. Restarting Lazarus also did not improve this situation.(Maybe 
it needed to reread fpc.cfg?).


I finally resorted to copying the  libpq file into /windows/sytem32  
and  tried to connect again. This time  round Lazarus asked for  
ssleay32.dll as well as  vsinit.dll. After duly  downloading and 
copying these files into system32.


On trying to connect this time I get the message The ordinal 284 
could not be located in the link library SSLEAY32.DLL.  Even trying 
with different versions of ssleay32 does not solve the problem.  At 
this point Lazarus shows the connection as Active in the object 
inspector but seems to be frozen.  Switching to another task in the 
windows taskbar brings Lazarus out of its reverie and gives me the 
message Can not load the PostgreSQL client. Is it 
installed?(libpq.dll).


Does anybody have any idea how to rectify this problem?

Regards.

Alex

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


Thanx for the advice, I have already adjusted the PATH variable.  
However it still does not solve the problem of looking for an unknown 
ordinal value in ssleay32?


where did you find the SSLEAY32.dll ?
You said you downloaded and copied it ?

Marc

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


Re: [lazarus] Behavior of ClientToScreen in scrolling windows across different widget sets

2008-02-07 Thread Marc Weustink

Luiz Americo Pereira Camara wrote:
While debugging scrolling bugs in LCL i found that ClientToScreen acts 
differently according to the widget set.


These are the behaviors:

1) The returned value is related to the actual position, i.e., it does 
not consider the scroll offset. If you pass Point(0,0) the value will be 
the same regardless of the scroll position. (Gtk1)


2) The returned value is related to the virtual position, i.e, it takes 
into account the scroll offset. If you pass Point(0, 0) the value 
changes inversely to scrollbar position. (Gtk2)  
3)  The returned value is related to the virtual position, i.e, it takes 
into account the scroll offset. If you pass Point(0, 0) the value 
changes the same amount of scrollbar position. (Win32)


4) Nothing. Qt has no visible scrollbars so...

Notes:

Delphi does the same as (1)/Gtk1


Not really, internally Delphi does it like 2. All controls are moved.



(3) is clearly buggy.

Between (1) and (2) is a design decision.


We started like delphi, move controls and report corrected values when 
asked. However this aproach is very inefficient on all widgetsets except 
win32. So the new approach is that controls stay at their position and 
only the virtual parent gets an offset.
This means that the top/left of a control on a say scrollbox are allways 
the same, an offset to the virtual parent top/left.


So now ClientToScreen.
The top/left of a scrolled control needs to get a scrolled offset, so 
that is reflects the real position relative to the real parent of 
the control.


Marc




Attached is a patch that makes win32 acts like (2)/gtk2. It changes the 
offset signal when calculating the LCL bounds. With the change it 
becomes consistent with the TCustomGroupBox signal convention (LCL 
bounds at Right/Down  of win32 +, at Left/Up -).

It also fixes the scrolling paint and setcursor of non TWincontrol.

Luiz





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


Re: [lazarus] SelectDirectory double click

2008-02-06 Thread Marc Weustink

Vincent Snijders wrote:

Graeme Geldenhuys schreef:

On 06/02/2008, Vincent Snijders [EMAIL PROTECTED] wrote:

is excellent under windows, because it use the common dialog for it.



Yes, but GTK1 doesn't have a native Select Directory dialog as for as
I could tell, so the LCL hack (which I think it is, but could be
wrong) was to use the Select File dialog which is confusing as hell.
The dirsel.pas mimics the pretty Windows native one. ;-)  Seeing that
90% (and decreasing) of the worlds computer users use Windows, they
should complain to much about the dirsel look.  :)




In this case, if there is no suitable native gtk1 widget for select 
directory, the gtk1 interface should use the LCL one from dirsel.


Or create ist own, based on lookalike widgets (if possible)

Marc

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


Re: [lazarus] Trouble with postgres

2008-02-06 Thread Marc Weustink

dayat wrote:
please search the libpq.dll on the web and download it, or you can copy 
the *.dll in your server such in C:\Program 
Files\PostgreSQL\8.1\bin\libpq.dll and other depend *.dll in same 
directory. Put the *.dll in C:\Windows\System32\ directory in client 
computer. may be can help you.


Or better extend your windows path to include C:\Program 
Files\PostgreSQL\8.1\bin\


copying dlls is usually a bad thing. You will loose track of versions. 
Also upgrading will be a pain when you forget to overwrite an older one.


Marc

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


Re: [lazarus] RecreateWnd

2008-02-04 Thread Marc Weustink

Paul Ishenin wrote:

Giuliano Colla wrote:
 From a quick look to documentation, RecreateWnd is just a dangerous 
hack/workaround to overcome some Windows bugs/inadequacies.


In Windows it's impossible to change some properties of a window, such 
as:

   *  Changing the border style.
   * Changing the CharCase, HideSelection or OEMConvert property of an 
edit control.

   * Changing the Alignment or ScrollBars property of a memo control.
   * Changing the Sorted or Style property of a listbox control.
   * Changing the Sorted or Style property of a listbox control.
   * Changing the Alignment property of a listbox control.
   * Changing the Ctl3D appearance of a checkbox control.

and the only thing that can be done is to destroy it, and then 
recreate it with new properties. It's just one of the 65000-plus known 
bugs of Windows. This is not only unneeded, but not even thought of in 
other OS's. Only in Redmond such a thing can be considered normal.


Dont make quick decisions :) Some qt widgets also lack from inability to 
change few properties after their creation. For example QRubberBand 
cannot change its shape after creating. Some gtk properties also cannot 
be set after realizing of widget. For example you cannot ask gtk widget 
to create/remove gdk window after widget realizing. I expect carbon can 
have own examples. So in 2% of cases RecreateWnd is needed, 


That is exactly why I removed recreatewind form twincontrol. Most (if 
not all) widgetsets needs a recreate for the one or the other property 
(you cannot add columns to a listview in gtk for instance). However this 
recreating is not always for the same property. So recreate will work, 
but in most widgetsets it is unneeded.



but indeed its add headache.


For the LCL itself it doesn't since all logic to create a handle is 
already present.



Marc

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


Re: [lazarus] Determining Crossplatform functions

2008-02-01 Thread Marc Weustink

SteveG wrote:
Could anybody tell me if GetKeyState (and family) is cross platform or 
not ? - if not, is there a cross platform equivalent?


I know that it is ultimately connected to the winapi, but does fpc/laz 
redirect to suit platforms ?


On this note, is it at all possible to know which functions are 
x-platform and those not ? - ie if they pass thru 'this' unit/chain, 
they are ok, else not.


IIRC getkeystate is part of the winapi emulation, so we try to keep our 
implementation crossplatform.
However keep in mind that not all exotic windows keys are supported on 
all platforms.


Marc

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


Re: [lazarus] I have a dream

2008-01-30 Thread Marc Weustink

Giuliano Colla wrote:

Vincent Snijders ha scritto:

Giuliano Colla schreef:

Vincent Snijders ha scritto:

Graeme Geldenhuys schreef:

On 29/01/2008, Vincent Snijders [EMAIL PROTECTED] wrote:

You don't need ifdefs. You need to fix the differences.

Fix the gtk1 interface to scroll the memo.
Fix the gtk1 interface to remove the scrollbars, when the memo is 
cleared
Fix gtk1 and gtk2 interface to disable childforms, if the main 
form is enabled.


That is why there different widgetset backends too, not just to 
create different

widgets, but also to make them behave consistent.


But how do you know if that's not maybe the native behaviour of the
underlying widgetset? I think this is what Giuliano was trying to say
or assumed.



Don't assume, research.

Not convinced,


GTK1 implementation of TMemo InsertText:

if NewTextLength - CutLength  0 then begin
  gtk_editable_insert_text(PGtkEditable(widget), char,
   NewTextLength - CutLength, Position);
end;

g_signal_stop_emission_by_name(PGtkObject(widget), 'insert_text');

GTK2 implementation of Tmemo InsertText:

if NewTextLength - CutLength  0 then begin
  gtk_text_buffer_insert(TextBuffer, StartIter, TheText, 
NewTextLength - CutLength);

end;

g_signal_stop_emission_by_name(PGtkObject(Textbuffer), 
'insert-text');


GTK2 scrolls in order to show the text just inserted, GTK1 doesn't.

Convinced now?


Convinced, that you did some research: yes.

Convinced, that you did enough research: no.

Convinced, that scrolling the text after inserting text is agains the 
native behaviour of the native widgetset: no, not at all.


IMO, the LCL should give the application users a native look and feel 
using the native components as much as possible. At this moment, we 
are failing in this respect with our current implementation of the 
Treeview and the Toolbar, for example, since they are drawn by the LCL 
and not by the widget set. This will probably change in the future, 
keeping the current Treeview as TLCLTreeView or something like that.


The LCL should give the application developer a consistent (VCL 
compatible) interface to accomplish that.


In this case when you append or insert text the application developer 
expects that gtk1 and gtk2 (and all widget set) do the same thing: 
either scroll to end or leave the cursor on the current position. I 
don't think that this scrolling (or not scrolling) can be considered 
intrisically part of a widget set.


Suppose we decide that a widget should scroll when adding  line to a 
LCL TMemo should scroll that line into view, then all widgetset should 
do that. The gtk1 implementation should add extra code to accomplish 
that.


Suppose we decide that a widget should not scroll when adding  line to 
a LCL TMemo should scroll that line into view, then all widgetset 
should not do that. The gtk2 implementation should record the current 
position and add extra code to accomplish to keep the cursor on the 
current position.


I would sugest to fix the gtk1 implementation.

I hope this is clear now, if not, feel free to ask for clarification.



What you say is clear, and I do agree with you. LCL should provide 
consistent behavior across widgetsets. Maybe I can disagree on what's 
the best way (i.e. minimum work-best result) to achieve this result, but 
that's another matter, and it's up to you, after all. I can just provide 
my point of view as a contribute to the discussion.


But when I see other developers say exactly the opposite, i.e. that LCL 
should provide native behavior, and maintain that some properties 
shouldn't be implemented in some widgesets because they're not natively 
available, then I get confused.


Native widgets  native behaviour. The LCL adds functionality to native 
widgets so a LCL user wil benefit from that and will het the same 
behaviour. (also the VCL added some different behaviour to win32 widgets)
On case by case base it is decided if a certain behaviour is compatible 
with delphi, is better than delphi or is behaving like most widgetsets.
For scrolling after a line is added, I don't know. Personally I hate it 
when a memo gets updated and I want to read the contents the same time.


Marc



Giuliano



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


Re: [lazarus] Found serious bug in win32 interface

2008-01-30 Thread Marc Weustink

Andrey Gusev wrote:

* Paul Ishenin [EMAIL PROTECTED] [Wed, 30 Jan 2008 11:27:16 +0700]:

Andrey Gusev wrote:
 That:
 --- interfaces/win32/win32callback.inc(revision 13905)
 +++ interfaces/win32/win32callback.inc(working copy)
 @@ -504,7 +504,7 @@
   if (ControlDC = 0) or not needParentPaint then
   begin
 DCIndex := Windows.SaveDC(PaintMsg.DC);
 -MoveWindowOrgEx(PaintMsg.DC, ORect.Left, ORect.Top);
 +MoveWindowOrgEx(PaintMsg.DC, -ORect.Left, -ORect.Top);
 {$ifdef DEBUG_DOUBLEBUFFER}
 Windows.GetClipBox(PaintMsg.DC, ClipBox);
 DebugLn('LCL Drawing in DC ', IntToHex(PaintMsg.DC, 8), ' 

with

 clipping rect (',


 



Please try to build ide with your changes and you'll see nice effects 

:)




I saw it all yesterday.
That's question:
How it contrived by develoers team: to build correctly worked
tabular-components on top of so fundamental bug ???


This is recently changed. Initially the code had a similar behaviour as 
delphi. It became clear that only scrolling in win32 would work like the 
old way and that all other widgetsets had to add heaps of code.
So scrolling changed, however all widgetsets need to get adapted to the 
new situation.


Marc

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


Re: [lazarus] Default target OS/CPU for projects ?

2008-01-26 Thread Marc Weustink

Michael Van Canneyt wrote:

Hello,

How does the IDE determine the target OS/CPU if none is specified 
for a project ?


Apparently, it takes the same OS/CPU combination as the one the 
IDE itself was compiled with.


In my opinion, this is wrong. It should see what compiler was selected,
and use the OS/CPU combination that this compiler reports.

Specifically:

- I use the i386/Linux IDE.
- No target OS/CPU has been specified.
- I select the ppcx64 compiler in the Environment options.
- The IDE constructs all paths with units/i386-linux.
- Recompile IDE.

Of course, compilation fails. All goes well for the LCL/IDE
because the makefile detects that it needs x86_64-linux, but
compiling the packages fails, because the IDE constructs all 
paths with 386-linux...


The same is true for any other project as well, of course.

I think that this behaviour should be changed to the same 
behaviour as used by the makefile: detecting the default

OS/CPU of the used compiler.

Or that at least there should be an option to allow the choice between:
- Always use IDE CPU/OS combination
- Detect compiler CPU/OS and use that.

Opinions, comments ?


IIRC, this was a todo to base CPU/OS on selected compiler.
(I've the same issues when compiling on win32/64 for wince/arm)

OTOH, (I've only heard this, not tried) if you set fpc as compiler the 
correct flags are passed, st fpc can choose the correct compiler


Marc

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


Re: synedit patch from ales

2008-01-25 Thread Marc Weustink

Ales Katona wrote:

Felipe Monteiro de Carvalho  wrote / napísal(a):

On Jan 25, 2008 6:23 PM, Ales Katona [EMAIL PROTECTED] wrote:
  That's not enougth. It already works for ascii characters today.
Please test with both unicode and non-unicode IDE on strings with
accented characters.
  
ASCII doesn't have accented chars. If you mean non-utf local non-latin1 
encoding then pre-patch doesn't work on those, anything out of 
['A'-'z'] is considered block before my patch.


With my patch, anything NOT listed in TSynWordBlockChars + 
TSynWhiteChars (if there's no highlighter), or 
Highlighter.WordBlockChars + TSynWhiteChars is considered a valid 
word-character (which MIGHT include some nonsense chars, but at least it 
doesn't block known word-chars, + it can be runtime adjusted (in a way 
to also support utf-8), unlike the current situation (where you simply 
cannot support utf-8 because allowed chars is a set of 8bit char).


I agree on Ales here. this afternoon Ales and I spoke while he was 
inmplementing this. The curretn handling of Synedit now is imo plain 
stupid and never will work when the carset is growing bigger than 255 
chars. Defining a set of nonword + whithespace chars is imo better.
If someone enters a nonsence char and it is considered a part of a word 
is imo a lot better than acception only lower ascii.


Marc

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


Re: [lazarus] Introduction

2008-01-23 Thread Marc Weustink

Giuliano Colla wrote:

Felipe Monteiro de Carvalho ha scritto:
On Jan 23, 2008 2:08 AM, Giuliano Colla [EMAIL PROTECTED] 
wrote:

The test isn't by me, but by someone who complained about z-order in
gtk2 not being correct. A lot of time ago.
I know, it's voluntary work, everybody does its best. We take what's
available, and thank. But please don't tell me that gtk2 can be taken in
consideration for anything else than a specific project carried on by a
Lazarus developer, who knows enough the internals to fix the widgets he
needs.


And what do you plan to do about it?



Try and convince Lazarus developers to follow a route which makes it 
possible for a lot of people like me to actively contribute instead of 
just feeling helpless and whine.


What route do you suggest ?


What I mean is very simple: I have to get to work at 7:30 and come
back at 21:00. Why would I use my spare time to hunt for the endless,
arbitrary bugs in the gtk2 interface? And my experience with the
gtk/gtk2 interface is enougth to say it ain't particularly fun to work
endless hours to fix small bugs on that spaguetti code, which often
ends up without any fix.



That's the point. Attempting to fix z-order in GTK2, which is a minimum 
requirement in order to make a real world application work, requires to 
study gtk2 in detail. 


Whatever model you come up with, be it native contols or customdrawn 
controls, as soon as there is a bug on OS/widget level, you need to 
understand that level.


Moreover you may be forced to modify something in 
LCL, which will doubtless break gtk1, Qt, Carbon, windows, WINCE etc. (I 
see it happen every day) So you must study gtk1 in detail (loss of time 
because gtk1 is long dead), Qt, Carbon (I don't have a Mac), windows 
API's etc. It's above me. And apparently above Lazarus team. 


Now you're taking the extreme route, this doesn't happen that often. 
However if there is a bug in the LCL it needs to be fixed. It's to 
noones advantage that every widgetset has to work around tose bugs.


Still we are happy to receive patches aginst gtk2+lcl in this case. It 
may only take longer before things are applied since more ppl are 
involved to fix other widgetsets.


That's why

I claim that the native widget route is a dead end.


That's your claim, not ours.


If the bug is annoying you, then *you* should do something about it =)
If all users use the approach: Oh, I'll test now and wait 3 months and
test again, then they are all risking that in 3 months there won't be
any change to what they wanted changed.



See above. If something is within my reach, I attempt to fix it. If it's 
above my reach I can only whine.


You can also help with small testcases and such exactly pinpointing the 
problem. Whining won't help anyone, only you loose. (I will certainly 
not inspire me to help you)



If you don't plan on doing anything about it, then I say it's not that
annoying for you, because it's not annoying enougth to make you do
something about it =)



What *I* plan to do is to take alternative, more viable routes, but it's 
a pity. I just hopr that my alternatives can somehow fit into Lazarus, 
so that I can contribute them.


Thank you.


Marc

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


Re: [lazarus] OpenMoko and FPC/Lazarus

2008-01-22 Thread Marc Weustink

Florian Klaempfl wrote:

Marc Weustink schrieb:

Marc Weustink wrote:

Florian Klaempfl wrote:

Luca Olivetti schrieb:

En/na Florian Klaempfl ha escrit:


It should be enough to build FPC with OPT=-dFPC_ARMEL

So it's now possible to produce eabi code with fpc?

Well, I did initial support. If you provide bugs reports, I'll try to
fix them.

hmm... current openmoko versions are eabi, but when I run a testapp
build by such fpc I get:

Program received signal SIGILL, Illegal instruction.
0x000129d0 in SYSTEM_FPSYSCALL$LONGINT$$LONGINT ()
(gdb) bt
#0  0x000129d0 in SYSTEM_FPSYSCALL$LONGINT$$LONGINT ()
#1  0x00012e1c in SYSTEM_FPGETRLIMIT$LONGINT$PRLIMIT$$LONGINT ()
#2  0x0001eef8 in SYSTEM_CHECKINITIALSTKLEN$LONGWORD$$LONGWORD ()
#3  0x0001efbc in SYSTEM_init ()
#4  0x0001a7ec in fpc_initializeunits ()
#5  0xe668 in main () at gtk2query.pp:263

I tried something more. I compiled FPC without FPC_ARMEL, but tweaked
init_settings.fputype:=fpu_soft in globals.pas so it would use soft fpu.

Now my testapp crashes on the first librarycall (how surprising), but
passes the fpc_initializeunits (and manages to do some writeln).
From this I assume syscalls in this case are correct and I guess there
is some difference between syscall calling and library calling.


As Luca suspected, this is the wrong way :) You've a kernel with old
syscall support. You should find out why it crashes with -dFPC_ARMEL.


I did this test only to see if there is a difference between calling 
conventions used for libraries and for syscalls.

It was not an attempt to get this path to working.

Assuming that there is a difference on purpose (need to sort that out), 
I tried to build a version with FPC_USE_LIBC to eliminate syscalls.
After 2 patches, I got a RTL build with it, but it somehow fails to 
allocate mem. (fmmap returns -1)

Also that needs to be investigated (it was way beyond my bedtime)

Marc

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


Re: [lazarus] OpenMoko and FPC/Lazarus

2008-01-22 Thread Marc Weustink

Luca Olivetti wrote:

En/na Marc Weustink ha escrit:

 From this I assume syscalls in this case are correct and I guess 
there is some difference between syscall calling and library calling.


Maybe openmoko as an eabi kernel compiled with oabi compatibility? 
(otherwise I think old style syscalls wouldn't work).
And, I don't know if there are differences in library calling, but sure 
there are differences in structure alignment (especially if there are 
enums in the structures).



Yes, I know. But how can I tell the compiler that for syscalls oabi 
alignment should be used and for libraries eabi ?
(assuming that is crashes on wrong alignment and that there is indeed 
such difference)



Marc

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


Re: [lazarus] Lazarus compiled with GTK2 [part 1 of 2]

2008-01-22 Thread Marc Weustink

Graeme Geldenhuys wrote:

On 22/01/2008, Giuliano Colla [EMAIL PROTECTED] wrote:

I gather that someone is already using GTK2, but I believe that he's not
much demanding in terms of graphic appearance. My customers would run
after me with a hammer if I'd dare to show them the current state of the
art. :-)


I've tried to use Lazarus/GTK2 for half a day now.  It's horribly slow
as well, compared to GTK1.  For now I switched back to GTK1 and will
try GTK2 in a few months again.


I fear that won't change much, gtk2 itself is slower than gtk1 due to 
all clientside graphic stuff


Marc

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


Re: [lazarus] What is wrong with the Toolbar?

2008-01-22 Thread Marc Weustink

Lord Satan wrote:

On Tue, 22 Jan 2008 14:15:03 +0100
Giuliano Colla [EMAIL PROTECTED] wrote:

The only problem is that you have another goal which is to be Delphi 
compatible. When two goals are in conflict, as they are, you should make 
a choice. Either drop Delphi compatibility and use native widgetsets, or 
drop native widgesets.


Great Idea. Drop Delphi compatibility now. Drop it I say. Do you here me, 
Delphi, go away.



can we just stop discussions on this.

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


Re: [lazarus] Lazarus compiled with GTK2 [part 1 of 2]

2008-01-22 Thread Marc Weustink

Luiz Americo Pereira Camara wrote:

Marc Weustink wrote:

Graeme Geldenhuys wrote:

On 22/01/2008, Giuliano Colla [EMAIL PROTECTED] wrote:
I gather that someone is already using GTK2, but I believe that he's 
not

much demanding in terms of graphic appearance. My customers would run
after me with a hammer if I'd dare to show them the current state of 
the

art. :-)


I've tried to use Lazarus/GTK2 for half a day now.  It's horribly slow
as well, compared to GTK1.  For now I switched back to GTK1 and will
try GTK2 in a few months again.


I fear that won't change much, gtk2 itself is slower than gtk1 due to 
all clientside graphic stuff


Gtk2 is in fact slower than Gtk1, every one agree, but LCL/Gtk2 
application are much slower than other Gtk2 applications


Compared to what apps ?

Marc

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


Re: [lazarus] OpenMoko and FPC/Lazarus

2008-01-21 Thread Marc Weustink

Florian Klaempfl wrote:

Luca Olivetti schrieb:

En/na Florian Klaempfl ha escrit:


It should be enough to build FPC with OPT=-dFPC_ARMEL

So it's now possible to produce eabi code with fpc?


Well, I did initial support. If you provide bugs reports, I'll try to
fix them.


hmm... current openmoko versions are eabi, but when I run a testapp 
build by such fpc I get:


Program received signal SIGILL, Illegal instruction.
0x000129d0 in SYSTEM_FPSYSCALL$LONGINT$$LONGINT ()
(gdb) bt
#0  0x000129d0 in SYSTEM_FPSYSCALL$LONGINT$$LONGINT ()
#1  0x00012e1c in SYSTEM_FPGETRLIMIT$LONGINT$PRLIMIT$$LONGINT ()
#2  0x0001eef8 in SYSTEM_CHECKINITIALSTKLEN$LONGWORD$$LONGWORD ()
#3  0x0001efbc in SYSTEM_init ()
#4  0x0001a7ec in fpc_initializeunits ()
#5  0xe668 in main () at gtk2query.pp:263


Marc


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


Re: [lazarus] OpenMoko and FPC/Lazarus

2008-01-21 Thread Marc Weustink

Marc Weustink wrote:

Florian Klaempfl wrote:

Luca Olivetti schrieb:

En/na Florian Klaempfl ha escrit:


It should be enough to build FPC with OPT=-dFPC_ARMEL

So it's now possible to produce eabi code with fpc?


Well, I did initial support. If you provide bugs reports, I'll try to
fix them.


hmm... current openmoko versions are eabi, but when I run a testapp 
build by such fpc I get:


Program received signal SIGILL, Illegal instruction.
0x000129d0 in SYSTEM_FPSYSCALL$LONGINT$$LONGINT ()
(gdb) bt
#0  0x000129d0 in SYSTEM_FPSYSCALL$LONGINT$$LONGINT ()
#1  0x00012e1c in SYSTEM_FPGETRLIMIT$LONGINT$PRLIMIT$$LONGINT ()
#2  0x0001eef8 in SYSTEM_CHECKINITIALSTKLEN$LONGWORD$$LONGWORD ()
#3  0x0001efbc in SYSTEM_init ()
#4  0x0001a7ec in fpc_initializeunits ()
#5  0xe668 in main () at gtk2query.pp:263


I tried something more. I compiled FPC without FPC_ARMEL, but tweaked 
init_settings.fputype:=fpu_soft in globals.pas so it would use soft fpu.


Now my testapp crashes on the first librarycall (how surprising), but 
passes the fpc_initializeunits (and manages to do some writeln).
From this I assume syscalls in this case are correct and I guess there 
is some difference between syscall calling and library calling.


Marc

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


Re: [lazarus] OpenMoko and FPC/Lazarus

2008-01-20 Thread Marc Weustink

Marc Weustink wrote:

ik wrote:

Hi,

While google suggest rewards for developing applications for Android,
there is an open source firmware named OpenMoko
(http://openmoko.org/).
I asked Michael Shiloh what are some of the requirement in building
apps in different compilers (FPC to be exact, and I also mentioned
Lazarus :)). Well all that is required is to bind ourself to the C
libraries.

I wonder what does it mean (other then binding) to make FPC and
Lazarus to support such environment.


I've been playing with that thought also (I've been following that 
project for a while now). It supports X and gtk so that part should work 
and AFAIK it runs some arm-linux so imo fpc could genererste some exe.
Since there wasn't an (easy) emulator environment, I stopped thinging 
about it and didn't test.


OK, thinks have inmroved and you now can run a qemu emulator :)

I did some tests.
First, just using the gnu-arm-linux binutils, I compiled a arm-linux 
trunk fpc and compiled a test (RTTIdump) console app. It runs fine on 
the emulated moko.


Second I tried one of my simple test gtk2 apps. It compiles, but failed 
to link since the gnu-arm-linux binutils don't understand the format 
used for the X, gdk, gtk libs.


I should have done some more initial reading, since openmoko brings its 
own binutils. After installing the openmoko toolchain I tried and
linking my testapp failed again. Now ld was complaining that the .o 
files of the rtl had a wrong eabi version.

Sure, true, indeed, I forgot to recompile fpc.
And that ends in:
/net/thunder/mnt/mirror1/src/fpc/trunk/rtl/units/arm-linux/system.s: 
Assembler messages:
/net/thunder/mnt/mirror1/src/fpc/trunk/rtl/units/arm-linux/system.s:15225: 
Error: selected processor does not support `rfs r0'
/net/thunder/mnt/mirror1/src/fpc/trunk/rtl/units/arm-linux/system.s:15228: 
Error: selected processor does not support `wfs r0'
/net/thunder/mnt/mirror1/src/fpc/trunk/rtl/units/arm-linux/system.s:19155: 
Error: selected processor does not support `stfd f0,[r13]'



It seems that the used arm core has no floatingpoint unit.

Does fpc support softfloat ? (if yes, how to use ?)

Marc




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


Re: [lazarus] Introduction

2008-01-20 Thread Marc Weustink

Lord Satan wrote:

On Sun, 20 Jan 2008 22:33:53 +0200
Graeme Geldenhuys [EMAIL PROTECTED] wrote:


I still think having a
custom Object Pascal written toolkit for Lazarus is the way to go. The
LCL would have progressed and stabilized much faster if the Lazarus
developers did that from the start.


That's correct. And if they had used OpenGL for it, it would be hardware 
accelerated, cross plattform and good looking, too. And we would need no stupid 
Aero or Compiz or other composition managers. And we could do things other 
widgetsets could only dream of. And porting to OpenES would be easy, too.
Stupid Lazarus developers. Now we only get this sucking Win API, GTK1, GTK2, 
Carbon and QT. Nothing really works and all is full of bugs.


If we had used OpenGL, then we had to create out component framework first.

Keep in mind, Lazarus is primarely focused in using *native* components
and I repeat it again *native* components.
OpenGL is *not* native. EOD.

Marc

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


Re: [lazarus] SVN

2008-01-18 Thread Marc Weustink

Stephano wrote:

Vincent Snijders wrote:

Can you try with svn2.freepascal.org?

Same problem with http://svn2.freepascal.org/svn/lazarus/trunk!

Moreover, http://svn.freepascal.org:8080/svn/lazarus/trunk and 


Ah, I guess that since the rebuild of the svnserver is doesn't listen to 
8080 anymore



The other svn repositories you mentioned, are they too on the default 
http port 80 (and have you recently accessed them )?


Marc


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


Re: [lazarus] SVN

2008-01-17 Thread Marc Weustink

Stephano wrote:
I can't update nor checkout (SVN) both FPC  Lazarus anymore! I used to 
do it daily, but stopped for about a month. Now I can't. As if 
punishment time has come :(
I use http://svn.freepascal.org/svn/lazarus/trunk for Lazarus svn. 
TortoiseSVN retrieves a few KB and hangs with no message. SVN initiates 
some network activity and hangs as well.


Any ideas?


you can try to move your repository to

http://svn.freepascal.org:8080/svn/lazarus/trunk

Marc

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


Re: RES: [lazarus] Solution to the BIG compiled file issue!

2008-01-16 Thread Marc Weustink

Christian U. wrote:

Marc Weustink schrieb:

Cesar Liws Gmail wrote:

I Agree with you Fabio, and also it can be implemented in Lazarus:

 


1)  Debug Path – LCL with Debug info

2)  Release Path – LCL WITHOUT Debug Info



What if I want other options in my release ?
Assertions on/off or Rangechecking on/off ?

what has this todo with the lcl debugionfo ?



When Im writing my software I do not want to debug Lazarus, so why 
should I include 10MB of LCL debug Info in my .EXE?


Then when you release, run strip
NO its not possible to debug then anymore. i think this is sayed 10 
times in this thread.
This thread is about stripping the debuginfos from LCL not from the user 
units.


See it as part of your release. Lazarus won't zip the exe for you 
neither. It wont make an installer. ect. etc.

So see it as part of a release process.
Its good to habe debuginfos in an release also for stack traces on 
exceptions and so on but no need for lcl debuginfo in an release exe...


_
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: RES: [lazarus] Solution to the BIG compiled file issue!

2008-01-16 Thread Marc Weustink

Christian U. wrote:

Marc Weustink schrieb:

Cesar Liws Gmail wrote:

I Agree with you Fabio, and also it can be implemented in Lazarus:

 


1)  Debug Path – LCL with Debug info

2)  Release Path – LCL WITHOUT Debug Info



What if I want other options in my release ?
Assertions on/off or Rangechecking on/off ?

what has this todo with the lcl debugionfo ?


It has all to do with what kind of info/settings you want in your 
release build. There is more than debug info only



When Im writing my software I do not want to debug Lazarus, so why 
should I include 10MB of LCL debug Info in my .EXE?


Then when you release, run strip
NO its not possible to debug then anymore. i think this is sayed 10 
times in this thread.


Yes, however after a release, your not developing on that release 
anymore. Your users are using it and don't need to debug. The unstripped 
version you keep to yourself, so you can debug yourself.


This thread is about stripping the debuginfos from LCL not from the user 
units.


So the lcl needs to be compiles with some option. What has that to do 
with project settings ? Nothing.
It's how the lcl should be build once. IIRC this discussion started 
about that.

I agree that it would be a nice option to be able to choose between
  LCL  with/without debuginfo
  FCL  with/without debuginfo
  RTL  with/without debuginfo

OTOH, a debugger being able to use external symbols would solve it too.

See it as part of your release. Lazarus won't zip the exe for you 
neither. It wont make an installer. ect. etc.

So see it as part of a release process.
Its good to habe debuginfos in an release also for stack traces on 
exceptions and so on but no need for lcl debuginfo in an release exe...


You need them too if some error happens in the LCL (the LCL is not 
bugfree you know ?)


Marc



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


Re: [lazarus] Rebuilding RTL and FCL inside LazIDE

2008-01-16 Thread Marc Weustink

Al Boldi wrote:

Christian U. wrote:

RTL and FCL are never build while building lazarus its a bit hard to add
an option for this i think.


Assume I have both debug and release versions build myself.


Mattias, what is needed to add rebuilding RTL/FCL from within the IDE?


This is goining into the wron direction.

Marc

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


Re: [lazarus] Cannot reach lazarus.freepascal.org

2008-01-16 Thread Marc Weustink

Giuliano Colla wrote:

Gerard N/A ha scritto:

Is anybody able to reach http://lazarus.freepascal.org?
I get a timeout after the address is resolved.



It appears to be down.
http://www.freepascal.org/ works, http://wiki.lazarus.freepascal.org/ 
works, but http://www.lazarus.freepascal.org doesn't.


They are 3 differnet servers, all in different countries and 
www.lazarus.freepascal.org is even at a different continent



Marc

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


Re: [lazarus] OpenMoko and FPC/Lazarus

2008-01-16 Thread Marc Weustink

ik wrote:

Hi,

While google suggest rewards for developing applications for Android,
there is an open source firmware named OpenMoko
(http://openmoko.org/).
I asked Michael Shiloh what are some of the requirement in building
apps in different compilers (FPC to be exact, and I also mentioned
Lazarus :)). Well all that is required is to bind ourself to the C
libraries.

I wonder what does it mean (other then binding) to make FPC and
Lazarus to support such environment.


I've been playing with that thought also (I've been following that 
project for a while now). It supports X and gtk so that part should work 
and AFAIK it runs some arm-linux so imo fpc could genererste some exe.
Since there wasn't an (easy) emulator environment, I stopped thinging 
about it and didn't test.


Marc

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


Re: RES: [lazarus] Solution to the BIG compiled file issue!

2008-01-15 Thread Marc Weustink

Cesar Liws Gmail wrote:

I Agree with you Fabio, and also it can be implemented in Lazarus:

 


1)  Debug Path – LCL with Debug info

2)  Release Path – LCL WITHOUT Debug Info



What if I want other options in my release ?
Assertions on/off or Rangechecking on/off ?

When Im writing my software I do not want to debug Lazarus, so why 
should I include 10MB of LCL debug Info in my .EXE?


Then when you release, run strip

See it as part of your release. Lazarus won't zip the exe for you 
neither. It wont make an installer. ect. etc.

So see it as part of a release process.

Marc

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


Re: [lazarus] Native debugger

2008-01-15 Thread Marc Weustink

ik wrote:

On Jan 15, 2008 11:00 PM, Vincent Snijders [EMAIL PROTECTED] wrote:

Al Boldi schreef:

Cesar Liws Gmail wrote:
Check out http://sourceforge.net/projects/mseide-msegui

It's got a nicely integrated debugger,

AFAIK, it is also a front end to GDB.


complete with CpuView and integrated
disassembler.  Would be nice if somebody ports this over.


That would be nice.


I thought in making the disassembler (also to practice my assembly
skills that I haven't used in a while, and to better learn x86_64),
but I do not have time... and I have so many projects that I have
started, but I don't have time to finish.. :(


There is already a disassembler in debugger/windebug

I started a native debugger, but since some graphics parts in lazarus 
really needed some attention, it didn't have progress in 2007.
After the new TIcon class is there, I plan to focus again on the 
debugger. Adding and reading dwarf callstack info is the only big thing 
to be done before I put all pieces together for a native (windows first) 
debugger within lazarus.


Marc

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


Re: [lazarus] why sometime TLHTTPClientComponent can not get data?

2008-01-15 Thread Marc Weustink

Micha Nelissen wrote:

Marc Weustink wrote:

the following app is valid:
program a;
{$mode objfpc}{$h+}
var
  p: PChar;
  s: String;
begin
  p := 'abcdef';
  s := p;
end.


An assignment is not necessarily the same as a typecast, as far as I
know. They could be handled by different pieces of compiler code and
have different semantics.


the s := String(p) line was not in the example but was in the assembler.

In this case String(p) is behaving more like a functiuon than a cast.

Marc

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


Re: [lazarus] Internal debugger for Lazarus

2008-01-15 Thread Marc Weustink

Wanderlan Santos dos Anjos wrote:

An initial development this is at Lazarus\debugger\windebug
\fpwd by Marc. Is it stopped?


See my reply somwhere in the big thread with subject native debugger

Marc

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


Re: [lazarus] why sometime TLHTTPClientComponent can not get data?

2008-01-14 Thread Marc Weustink

ik wrote:

On Jan 14, 2008 3:59 AM, wfifi [EMAIL PROTECTED] wrote:

thanks ido
wireshark is a great tool, i attach a log, found data is got, but
Component's status not change.


I've read your code again (and looked at the log), I noticed this:
strstream.WriteString(String(ABuffer))

You are casting a pointer as a string... The way to convert PChar to a
string is to use the function StrPas


Only if you use shortstrings. When using ansistrings you can cast a 
PChar in to a string like: String(SomePchar)

With ansistrings you seldom (or never) need StrPas

Marc

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


Re: [lazarus] why sometime TLHTTPClientComponent can not get data?

2008-01-14 Thread Marc Weustink

Luiz Americo Pereira Camara wrote:

Marc Weustink wrote:

ik wrote:

On Jan 14, 2008 3:59 AM, wfifi [EMAIL PROTECTED] wrote:

thanks ido
wireshark is a great tool, i attach a log, found data is got, but
Component's status not change.


I've read your code again (and looked at the log), I noticed this:
strstream.WriteString(String(ABuffer))

You are casting a pointer as a string... The way to convert PChar to a
string is to use the function StrPas


Only if you use shortstrings. When using ansistrings you can cast a 
PChar in to a string like: String(SomePchar)

With ansistrings you seldom (or never) need StrPas



What about the length that is stored just before the memory location of 
ansistrings? Does PChar created with StrAlloc have this field?


It is not really a cast. The compiler adds conversion code.

Marc

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


Re: [lazarus] why sometime TLHTTPClientComponent can not get data?

2008-01-14 Thread Marc Weustink

Luiz Americo Pereira Camara wrote:

Marc Weustink wrote:


You are casting a pointer as a string... The way to convert PChar to a
string is to use the function StrPas


Only if you use shortstrings. When using ansistrings you can cast a 
PChar in to a string like: String(SomePchar)

With ansistrings you seldom (or never) need StrPas



What about the length that is stored just before the memory location 
of ansistrings? Does PChar created with StrAlloc have this field?


It is not really a cast. The compiler adds conversion code.


I'm interested in this since currently i use StrPas to convert from 
PChar to AnsiString.


that is not needed.

the following app is valid:
program a;
{$mode objfpc}{$h+}
var
  p: PChar;
  s: String;
begin
  p := 'abcdef';
  s := p;
end.

PChars will be autoconverted to strings
The use of StrPas is from the shortstring times.



Is this (String(PChar)) faster than StrPas?


lets compale to assembler and comapre:
# [10] s := p;
leal-48(%ebp),%eax
callFPC_ANSISTR_DECR_REF
movl$0,-48(%ebp)
movlU_P$S_P,%eax
callfpc_pchar_to_ansistr
movl%eax,-48(%ebp)
movl-48(%ebp),%eax
callFPC_ANSISTR_INCR_REF
movl$U_P$S_A,%eax
callFPC_ANSISTR_DECR_REF
movl-48(%ebp),%eax
movl%eax,U_P$S_A

# [11] s := StrPas(p);
leal-48(%ebp),%eax
callFPC_ANSISTR_DECR_REF
movl$0,-48(%ebp)
leal-304(%ebp),%edx
movlU_P$S_P,%eax
callFPC_PCHAR_TO_SHORTSTR
leal-304(%ebp),%eax
callfpc_shortstr_to_ansistr
movl%eax,-48(%ebp)
movl-48(%ebp),%eax
callFPC_ANSISTR_INCR_REF
movl$U_P$S_A,%eax
callFPC_ANSISTR_DECR_REF
movl-48(%ebp),%eax
movl%eax,U_P$S_A

You see... with StrPas, the pchar is first converted to a short string.


Is safe that will not change to a simple pointer cast in future?


This will break compatebility.


Does it copy the string content?


Yes, its the same code as assigning directly

# [12] s := String(p);
leal-48(%ebp),%eax
callFPC_ANSISTR_DECR_REF
movl$0,-48(%ebp)
movlU_P$S_P,%eax
callfpc_pchar_to_ansistr
movl%eax,-48(%ebp)
movl-48(%ebp),%eax
callFPC_ANSISTR_INCR_REF
movl$U_P$S_A,%eax
callFPC_ANSISTR_DECR_REF
movl-48(%ebp),%eax
movl%eax,U_P$S_A

Marc

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


Re: [lazarus] Mac OS X : TBitBtn Transparency

2008-01-10 Thread Marc Weustink

Dominique Louis wrote:


I finally updated to Lazarus v0.9.24 and the glyph transparency issue 
still does not work with TBitBtns, but works fine on TToolButtons.


How do you set the glyph ? In code or in the ide ?

Marc

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


Re: [lazarus] Dialogs have disappeared from last svn's

2008-01-09 Thread Marc Weustink

Giuliano Colla wrote:

Since a few updates a lot of dialogs fails to show on IDE.

Project and compiler options (both old style and new style), Package 
dialogs, Tools-Configure build Lazarus, Environment and Editor options 
Debugger Options, Code Templates, fail to open.

CodeTools Options and Codetools define work properly.

The window list however lists some dialog windows as existing, even if 
they don't show.


Last svn revision known to work was 13626.

Platform is Linux, widgetset gtk1, fpc 2.0.4 and 2.2.0 (no difference).


Whoops... I forgot to checkin a realy important part of my changes in 
r13663.

This is comitted in r13691

Marc

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


Re: [lazarus] accessing internal widgetset handle

2008-01-05 Thread Marc Weustink

Mattias Gaertner wrote:

On Sun, 06 Jan 2008 01:13:52 +0700
Bee [EMAIL PROTECTED] wrote:


Hi all,

I'd like to create a gtk(2) app that has a non-rectangular form
shape, using Lazarus of course. I know gtk(2) provides API for this
purpose. The API requires a pointer to GTKWidget. But, I couldn't
find any ways to get the widget pointer of Lazarus' form since
Lazarus wraps the API very well inside LCL.

Hints? TIA.

BTW... which API should I use for this purpose, gtk or gdk? Both 
wrappers are provided in FPC/Lazarus and both provide similar API for 
the purpose. In term of Lazarus' LCL, what are the differences

between both?


Both gtk and gdk are available in the gtk interface. I don't know,
which one you use for this.
If you need the gtkwindow, then just type cast Form1.Handle:
GtkWindow:=PGtkWindow(Form1.Handle);

Beware, that this is an internal LCL gtk interface structure and can
change in the future without warning.


And it will.

The right way to do it in laz 0.9.26 and up is:

 GtkWindow := PGtkWindget(SomeWincontrol.Reference.Ptr);

This won't change. A Reference: TWSReference is the replacement for all 
handles used in the LCL.


Unfortunately it is not yet implemented for TWincontrol, so for now you 
need to cast the handle.


Marc




If you find out how to do it, it would be nice to write a small example
and describe it on the wiki. Eventually this feature could be added to
the LCL.


Mattias

_
 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] Making GTK Thread Safe

2007-12-30 Thread Marc Weustink

Vincent Snijders wrote:

Giuliano Colla schreef:

Martin Schreiber ha scritto:

On Sunday 30 December 2007 07.39:25 Micha Nelissen wrote:
 

Martin Schreiber wrote:
  

You are right, there seems to be no race condition if one uses
WakeMainThread correct. There can be a deadlock if the main thread 
tries

to destroy a thread which is waiting for Synchronize.
  

Hmm I think this is a very stupid idea to do. The thread will continue
to execute something so I don't think this is supported. Like 
destroying

a component in an event handler.



TThread.Destroy calls Waitfor.
What is the supported method to terminate an application which has 
threads waiting for Synchronize?


  

I don't know it it's officially supported, but for me it works.

I've added a Running property to my thread, which is set true when the 
thread begins execution, and false jut before terminating.


In my main form, the OnClose event includes:

 if assigned(Thr1) then begin
   if Thr1.Running then begin
 Thr1.Terminate;
 Thr1.WaitFor;
 end;
   end;




Isn't that where the dead lock occurs? Suppose Thr1 has just called 
Synchronize and is waiting until the main thread has executed the 
synchronized method, it won't terminate, because you have suppended the 
main thread by waiting for Thr1 to terminate.


IIRC WaitFor also handles the main loop (at leasst on delphi)

Marc

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


Re: software breakpoints [lazarus]

2007-12-21 Thread Marc Weustink

willem wrote:

Under Kubuntu I downloaded  the newest lazarus and fpc.
But i cannot use software breakpoints.
It is disabled. Is this a configuration issue or
are software not implemented yet ?


Did you configure a debugger in envirenmentoptions - debugger ?

Marc

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


Re: [lazarus] New icon for lazarus

2007-12-21 Thread Marc Weustink

wile64 wrote:



2007/12/21, Roberto Padovani [EMAIL PROTECTED] 
mailto:[EMAIL PROTECTED]:


Hi,

this morning I felt like graphing...
the print on the ground is a nice idea, so I tried to solve the
problem of contrast and resolution in windows detail view, i.e.
16x16 icons.
Contrast is solved by using the color of a cheetah instead of grey as
a basic color + high-lining (English??) the prints with black. To make
it more modern I added a point of light effect on the main finger
print.
 From 48x48 to 32x32 everything scales well; in the 16x16 there is a
resolution problem: scaling is too confusing, so I basically re-drew
the same icon but changing the smaller prints.

So, here's my result, anyone likes it ?

cheers,

  Roberto


I can redo any color :)


I think the small one is to black, the small one form roberto I liked more.

Marc


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


Re: [lazarus] How to get transparent images from TImageList?

2007-12-21 Thread Marc Weustink

Gerard N/A wrote:
If I run project1, the images are displayed Ok, even if I add the ones 
that I used in my own project.


hmm if you added them to the imagelist at designtime, then I wonder 
what goes wrong..


Marc

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


Re: software breakpoints [lazarus]

2007-12-21 Thread Marc Weustink

willem wrote:

Marc Weustink wrote:

willem wrote:

Under Kubuntu I downloaded  the newest lazarus and fpc.
But i cannot use software breakpoints.
It is disabled. Is this a configuration issue or
are software not implemented yet ?


Did you configure a debugger in envirenmentoptions - debugger ?

Marc



I use Lazarus 0.9.24 beta Date 5-11-07.
Debugger options:
GNU Debugger (gdb)

/usr/bin/Gdb


i hope this is a typo: gdb ?

How do you set your breakpoints ? By clicking left gutter, by pressing 
F5 or through the menu (which is disabled I think)


Marc



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


Re: [lazarus] Transparent and TransparentColor for TLazIntfImage?

2007-12-21 Thread Marc Weustink

Marco Alvarado wrote:

Which are the equivalents of TBitmap.Transparent and
TBitmap.TransparentColor for TLazIntfImage?


There is none.
The mask for TBitmap.TransparentColor is created during loading in 
TLazReaderBMP, or when set on a loaded image, pixel by pixel.


Marc

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


Re: [lazarus] How to get transparent images from TImageList?

2007-12-20 Thread Marc Weustink

Gerard N/A wrote:

Hi all,

I am writing a little app with Lazarus (SVN 13389) wich has two toolbars 
with several buttons each.
There is an action list with some actions assinged to toolbar buttons, 
some to main menu items, and some to both.
I droped a TImageList, added some 16X16 pixels bitmaps with a fuchsia 
background , and assigned the image list to the toolbar and menus, and 
each image index to the buttons and menu items.
At design-time, when I first open the  Imagelist dialog, the bitmaps 
disappear from buttons and menu items.

Closing Lazarus and starting it again, and the bitmaps show up again.
That's anoying, but I can live with that.
The problem is that the images show up with the fuchsia background.
I think I have tried all the possible combinations of bkColor, 
BlendColor, DrawingStyle, etc.. for the imagelist, but there is no way 
to have transparency.
I loaded one more bitmap with a white background, and with bkColor and 
BlendColor set to clWhite, it works.

Any hints?


First, what OS and what screen resolution (depth)

Marc

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


Re: [lazarus] How to get transparent images from TImageList?

2007-12-20 Thread Marc Weustink

Gerard N/A wrote:

Sorry, I forgot to add:
- Win Xp Pro.
- NVidia GForce 5200
- 1024 X 768,  32 bits


Try running the next example. If it works, then the imagelist is doing 
something wrong, else the lcl.


Marc

http://lazarus.dommelstein.nl/mytest/imagelist

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


Re: [lazarus] New icon for lazarus

2007-12-20 Thread Marc Weustink

Vincent Snijders wrote:

Marc Weustink schreef:

wile64 wrote:
I propose a new icon for lazarus, It can be used for whatever you 
want :)


huh... this is a grey dot.

Any meaning/thoughts ?



I thought it was a pawn print of a cheetah. But it is not very clear, 
you have to 'know' it to see it.


I found out too... default the smallest is shown here, after opening and 
browsing the icon images I saw the larger ones.


Marc


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


Re: [lazarus] splash image: share your ideas

2007-12-18 Thread Marc Weustink

wile64 wrote:



2007/12/16, wile64 [EMAIL PROTECTED] mailto:[EMAIL PROTECTED]:

Hi Marc,

Here splash in the vector (just copiede the original) :-(

*splash_svg.tar.gz*


I think the message is not received? (348 Ko)


No, mailinglist limit is 50k. Please send to me in private (patch@ or 
marc@ dommelstein)


Thanks Marc

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


Re: [lazarus] CPU Window (or substitute)

2007-12-17 Thread Marc Weustink

Henrick Hellström wrote:
AFAIK there is no CPU Window in Lazarus Win64 (is there?). Is there any 
other convenient way to get a look at a disassembly of the code 
generated by the compiler? I am in particular interested in the code 
that is generated immediately before and after asm blocks.


Not yet.I've been thinking about it, but first some generic 
debuggerclasses for this have to be added.


For now the only option is by using gdb directly. (if there is a win64 
gdb at all)


Marc

PS. don't use a reply-to on this ml.

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


Re: [lazarus] Making GTK Thread Safe

2007-12-12 Thread Marc Weustink

Razvan Adrian Bogdan wrote:

I've read something interesting in the GTK FAQ, it should be possible
to make GTK apps thread safe if they are setup properly, assuming
there are many multithreaded apps out there, i think this is really
useful, instead of relying on synchronize or simulating Messages Queue
with StringList, one could use CriticalSections with Controls and it
would be really useful if LCL was as thread safe as possible at least
the low level API part such as GTK, of course a full ThreadSafe LCL
would be even better but that would probably require too much work.


The LCL won't be threadsafe, the overhead isn't worth the gain.

Marc


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


Re: [lazarus] Making GTK Thread Safe

2007-12-12 Thread Marc Weustink

Razvan Adrian Bogdan wrote:

On Dec 12, 2007 12:13 PM, Marc Weustink [EMAIL PROTECTED] wrote:

The LCL won't be threadsafe, the overhead isn't worth the gain.


Do you think it's an overhead to use the internal locking mechanism from GTK ?


Not only overhead in gtk widgetset, also in LCL, and aslo in all other 
widgetsets.



I tend to think it's a very light mechanism that you don't even feel
in singlethreaded applications, having a threadsafe LCL means one can
freely code without any headaches from synchronization making the code
look nicer and dramatically cutting developing time, 


If you start to think your design first it won't cut much.


but i do think
it's a lot of code. I tend to think the LCLs overhead comes from using
classes too much in the lower level API abstraction part.


In all my years of delphi threadded app development I never needed 
threadded updates of my gui.



Marc

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


Re: [lazarus] Proposed About dialog patch

2007-12-12 Thread Marc Weustink

Graeme Geldenhuys wrote:

On 10/12/2007, Mattias Gaertner [EMAIL PROTECTED] wrote:

Yes I agree on that (and I agreed the first time too). It is only
*how* it is done. Thats why I proposed to add a popup.

I removed the easter egg.



Okay Marc, I hope I got it right this time round. ;-)
I created a PopupMenu in the About dialog. No hidden easter eggs.
Simply right click anywhere on the Form.


Patch is in Mantis:
  http://www.freepascal.org/mantis/view.php?id=10405


:)

Marc

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


Re: [lazarus] splash image: share your ideas

2007-12-11 Thread Marc Weustink

wile64 wrote:

2007/12/11, Bee [EMAIL PROTECTED] mailto:[EMAIL PROTECTED]:

  It is nice, but I must admit I like a lot the current one.

This effort is started when I showed lazarus splash image to my graphic
designer. 



It is also my job ;-)

He said it's better to make
it as vector image because it will easier for reproduction. 



Exact, a vector image is better...


I agree.
Some parts are already available as vector. I also have vectorized the 
cheetah and it looks well. The only thing to be done is to create toe 
remaining splash as vector. (if needed I'll put the cheetah in svn)


Marc

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


Re: [lazarus] Proposed About dialog patch

2007-12-10 Thread Marc Weustink

Mattias Gaertner wrote:

On Thu, 6 Dec 2007 16:55:12 +0200
Graeme Geldenhuys [EMAIL PROTECTED] wrote:


Hi,

I've got the following local changes to my Lazarus.  I think these
will be handy for everybody when part of official Lazarus.


Changes:
  * Format the compile date to the ISO 8601 format:  -mm-dd
 Lazarus is used internationally, so use a international format
date. Before it used to default to a 2 digit year which looked crap
and I'm never sure about the format used (mm-dd-yy, dd-mm-yy,
yy-mm-dd etc...).
  * On clicking the Close button, some version information in copied
to the clipboard. This is very handy now that the revision numbers
are bigger. If I ever need to quote my version of Lazarus and toolkit
used (like in mailing
 list or Mantis) I simply open the dialog and close it again. Now
I can copy a accurate version + widgetset string somewhere.


Applied. Thanks.


I am against modifying the clipboard on close of a dialog, please revert 
and add a popupmenuitme to copy the version number.


Asking the second time while the first time there was an objection about 
exact this reason is not polite.


Marc





Mattias

_
 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] Proposed About dialog patch

2007-12-10 Thread Marc Weustink

Graeme Geldenhuys wrote:

On 10/12/2007, Marc Weustink [EMAIL PROTECTED] wrote:

I am against modifying the clipboard on close of a dialog, please revert
and add a popupmenuitme to copy the version number.


Q1: How often do you go into the About dialog?

A:  Certainly never for normal day-to-day programming tasks. The About
dialog in simply just for show in most cases, so lets give it
something useful to do.


That doesn't matter. A dialog should do what is is supposed to do, so no 
additional under the hood actions. That means *not* alter the clipboard 
without user action. period. no discussion.



Q2: Why do you go into the About dialog?

A:  To admire you name in the Contributors list. :-)  99% of the time
it is to see what version (and revision) of the IDE you have. And when
do you normally use that information?  Probably quoting it in the
mailing list of Mantis bug reports. It's really handy having that
information copied to the clipboard.


Yes I agree on that (and I agreed the first time too). It is only *how* 
it is done. Thats why I proposed to add a popup.


marc

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


Re: [lazarus] Drawing a spiral

2007-12-02 Thread Marc Weustink

Graeme Geldenhuys wrote:

Hi,

How do I change this code to draw a spiral using the standard
Canvas.LineTo that only takes Integer X  Y co-ordinates?  I did it
before, but for the live of me I can't get it right now!  :-)


eg:
  Draw(100, 100);


procedure TForm1.Draw(X, Y: Integer);
var
  Theta: Single;
begin
  Theta := 0;
  Image.Bitmap.MoveToF(X, Y);
  while Theta  15 * 3.1415926535 do
  begin
Image.Bitmap.LineToFSP(X + Cos(Theta) * Theta, Y + Sin(Theta) * Theta);


Bitmap.Canvas.LineTo(
  Round(X + Cos(Theta) * Theta),
  Round(Y + Sin(Theta) * Theta)
):

(or do I miss something here ?)

No that you only get a spiral with max radius = 15 here. If yo want to 
draw it in a 100x100 box, with x,y as center:


Bitmap.Canvas.LineTo(
  Round(X + Cos(Theta) * Theta * 50 / 15),
  Round(Y + Sin(Theta) * Theta * 50 / 15)
):


Marc

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


Re: [lazarus] Re: Lazarus-0.9.24: SIGSEGV in TOpenDialog

2007-12-02 Thread Marc Weustink

Marco Alvarado wrote:

So, is there any other option appart from DebugLn(), that works?


AFAIK not.

Marc





Regards!
-Marco


2007/12/1, Marc Weustink [EMAIL PROTECTED]:

Marco Alvarado wrote:

It's a Win32 API function:

http://msdn2.microsoft.com/en-us/library/aa363362.aspx

Outputs a string to the debugger. Lazarus is able to catch those
messages, although the output in Lazarus is pretty dirty, and is
somehow difficult to read.

Correction, lazarus does not catch that output. It's gdb which does.
Lazarus doesn't intrepret these mesages, so you will find them among
other debugger output. I don't call this support, it just happens to be
there.


I supposed DebugLn would work the same way,

Nope, it is a replacement for writeln, for cases where there is no stdout.


but no :( Hope someday DebugLn will be connected to the debbuger.

It won't.

And since I cannot destinct gdb output from console output, there is no
way to show the output on the console (like debugln output).


Marc


_
 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



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


Re: [lazarus] Re: Lazarus-0.9.24: SIGSEGV in TOpenDialog

2007-12-01 Thread Marc Weustink

Marco Alvarado wrote:

It's a Win32 API function:

http://msdn2.microsoft.com/en-us/library/aa363362.aspx

Outputs a string to the debugger. Lazarus is able to catch those
messages, although the output in Lazarus is pretty dirty, and is
somehow difficult to read. 


Correction, lazarus does not catch that output. It's gdb which does. 
Lazarus doesn't intrepret these mesages, so you will find them among 
other debugger output. I don't call this support, it just happens to be 
there.



I supposed DebugLn would work the same way,


Nope, it is a replacement for writeln, for cases where there is no stdout.


but no :( Hope someday DebugLn will be connected to the debbuger.


It won't.

And since I cannot destinct gdb output from console output, there is no 
way to show the output on the console (like debugln output).



Marc


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


Re: [lazarus] Before After Compilation Comandline Execute

2007-12-01 Thread Marc Weustink

Mattias Gaertner wrote:

On Fri, 30 Nov 2007 10:06:11 -0500
Lee Jenkins [EMAIL PROTECTED] wrote:


Marc Weustink wrote:

Vincent Snijders wrote:

Lee Jenkins schreef:

Lazarus 0.9.24

Referring to Project  Compiler Options  Compilation...,

When I place a command in Execute After, it will actually be 
executed before.  The inverse is true for Execute Before.


Should I log this?  I did a couple of cursory searches on mantis
and didn't see anything.


Yes, please create a bug report.

HUH, when did this happen ? I used Execute before a lot when
working to .24 (and it worked)

Marc


Not sure Marc.  I upgraded from 0.9.22 a few days ago and after
reading about UPX and STRIP I thought it might be nice to take my
simple application of 16.5 MB and shrink it a bit so I placed the
following in Execute After:

c:\lazarus\fpc\2.2.0\bin\i386-win32\strip.exe --strip-all
$(TargetFile)

It didn't work so after a few tries I placed the above commandline in
the Execute Before field and it worked and message window reports:

Just looks like the group boxes for each are switched since Execute
Before is placed in the lower portion of the dialog while Execute
After is located in the upper portion of the dialog.


Somehow the captions of the groupboxes were switched. I fixed that in
svn 13108.


Aahh... your right :)
Since I use that option since the day you could optionally use it, I 
don't look at the captions anymore.


Marc

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


Re: [lazarus] Before After Compilation Comandline Execute

2007-11-30 Thread Marc Weustink

Lee Jenkins wrote:

Vincent Snijders wrote:

Lee Jenkins schreef:

Lazarus 0.9.24

Referring to Project  Compiler Options  Compilation...,

When I place a command in Execute After, it will actually be 
executed before.  The inverse is true for Execute Before.


Should I log this?  I did a couple of cursory searches on mantis and 
didn't see anything.




Yes, please create a bug report.

Vincent


Vincent, I applied for a login for Mantis last night while I was 
searching to see if the bug was reported already but have not received a 
confirmation email with password yet (this morning).


Should I apply again for an email or is the process manual/moderated and 
I should wait a bit longer?


Should be sent immediate. However I get the idea that when no realname 
is given, the mail fails to send


I've updated your profile and reset your login. You should have received 
an email by now


Marc







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


Re: [lazarus] Message with image as attachement

2007-11-30 Thread Marc Weustink

Damien Gerard wrote:


On Nov 30, 2007, at 10:58 AM, Paul Ishenin wrote:


Damien Gerard пишет:
Each time I send a email to the lazarus ml with an image the mail 
never reaches.

It is a bug or a feature ?  :)


I think protection from big mail size (if your images are big in size).



That was I thought. But in fact no. For example the last one was :
http://ftn.shikami.org/misc/Lazarus/Snapshot%202007-11-30%2000-04-27.jpg
40Ko :)


40KB gets mime encoded to roughly 1.5x so that would be 60KB  (iirc the 
limit is 50k)


Marc

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


Re: [lazarus] Re: Lazarus-0.9.24: SIGSEGV in TOpenDialog

2007-11-30 Thread Marc Weustink

Marco Alvarado wrote:

So we don't need GDB?


At this moment the lazarus debugger uses GDB.

I'm lost, what do you mean by:
 throwing backtraces from the Lazarus debugger

Marc





2007/11/30, Marc Weustink [EMAIL PROTECTED]:

Marco Alvarado wrote:

GDB is just wonderful!!! It just helped me to solve the last errors in
my application and got the engine finally running in both Windows and
Linux :_D

Thanks a lot!!!

PS. Have you ever thought about throwing backtraces from the Lazarus
debugger? Having such feature integrated would be really helpful. :)

You mean view callstack ?

Marc

_
 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



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


Re: [lazarus] Before After Compilation Comandline Execute

2007-11-30 Thread Marc Weustink

Vincent Snijders wrote:

Lee Jenkins schreef:

Lazarus 0.9.24

Referring to Project  Compiler Options  Compilation...,

When I place a command in Execute After, it will actually be 
executed before.  The inverse is true for Execute Before.


Should I log this?  I did a couple of cursory searches on mantis and 
didn't see anything.




Yes, please create a bug report.


HUH, when did this happen ? I used Execute before a lot when working to 
.24 (and it worked)


Marc

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


Re: [lazarus] Re: Lazarus-0.9.24: SIGSEGV in TOpenDialog

2007-11-30 Thread Marc Weustink

Marco Alvarado wrote:

GDB is just wonderful!!! It just helped me to solve the last errors in
my application and got the engine finally running in both Windows and
Linux :_D

Thanks a lot!!!

PS. Have you ever thought about throwing backtraces from the Lazarus
debugger? Having such feature integrated would be really helpful. :)


You mean view callstack ?

Marc

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


Re: [lazarus] Message with image as attachement

2007-11-30 Thread Marc Weustink

Damien Gerard wrote:



Each time I send a email to the lazarus ml with an image the mail never 
reaches.

It is a bug or a feature ?  :)


This is a feature, you don't want to send several 100k to *all* list 
members. (assume 10k users - 100k * 10k = 1GB of data worst case)

IIRC the limit is 50k, but better use an imagebin as paul suggested

Marc

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


Re: [lazarus] Re: Lazarus-0.9.24: SIGSEGV in TOpenDialog

2007-11-30 Thread Marc Weustink

Marco Alvarado wrote:

When I got the errors in Linux I never saw backtraces in the debugger.


I thought so, thats why I pointed you to the View-Debugger-CallStack 
menu option.



I saw the backtraces for the first time when testing the application
from GDB. And now that makes me remember something I wanted to ask: I
activate the Debug output window, but it doesn't show the lines
generated by DebugLn(). 


Nope, debugger output is the internal logging of the lazarus debugger.


But when I ran the application from GDB, the
output of DebugLn() was shown.


Consoleoutput is not (yet?) shown.
What you can do is start lazarus from a xterm. Then all is logged in 
that terminal.


Marc




Regards!


2007/11/30, Marc Weustink [EMAIL PROTECTED]:

Marco Alvarado wrote:

So we don't need GDB?

At this moment the lazarus debugger uses GDB.

I'm lost, what do you mean by:
  throwing backtraces from the Lazarus debugger

Marc




2007/11/30, Marc Weustink [EMAIL PROTECTED]:

Marco Alvarado wrote:

GDB is just wonderful!!! It just helped me to solve the last errors in
my application and got the engine finally running in both Windows and
Linux :_D

Thanks a lot!!!

PS. Have you ever thought about throwing backtraces from the Lazarus
debugger? Having such feature integrated would be really helpful. :)

You mean view callstack ?

Marc

_
 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


_
 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



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


Re: [lazarus] TProcess.Input problem

2007-11-29 Thread Marc Weustink

Malcolm Poole wrote:

Hello everyone!

I am trying to write a front-end for the command-line archiving program
dar ( http://dar.linux.free.fr/ )

I can read happily from the dar Process.Output but am not managing to
respond using Process.Input

When extracting an archive using the commandline, when dar finds a file
to be overwritten, it asks if it should be overwritten, to which the
response is [RETURN] key  for 'Yes' or [ESC] key for  'NO'. I have tried
writing both #13 and #27 to Process.Input but it has no effect: the
program just hangs as the Process never stops running and gives no more
output.


Try writing #10 or #13#10

Marc

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


Re: [lazarus] TProcess.Input problem

2007-11-29 Thread Marc Weustink

Malcolm Poole wrote:

Marc Weustink wrote:

Malcolm Poole wrote:

Hello everyone!

I am trying to write a front-end for the command-line archiving program
dar ( http://dar.linux.free.fr/ )

I can read happily from the dar Process.Output but am not managing to
respond using Process.Input

When extracting an archive using the commandline, when dar finds a file
to be overwritten, it asks if it should be overwritten, to which the
response is [RETURN] key  for 'Yes' or [ESC] key for  'NO'. I have tried
writing both #13 and #27 to Process.Input but it has no effect: the
program just hangs as the Process never stops running and gives no more
output.


Try writing #10 or #13#10

Marc
No, I've already tried that, and checked the dar source: it is 
definitely looking for one byte of input: #27 or '/n', which is #13.


are you sure that it is #13 and not #10 ? IIRC newlines on unix are #10

Is it possible that it is ignoring stdin because it is not being run 
from a terminal?


Thats possible too. But maybe it isn't reading stdin at all.

Marc

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


Re: [lazarus] Back to 0.9.22

2007-11-29 Thread Marc Weustink

Graeme Geldenhuys wrote:

On 29/11/2007, Michael Van Canneyt [EMAIL PROTECTED] wrote:

That would be helpful for the Lazarus team, I think.
As Marc said: they cannot fix it if they cannot reproduce it.



I've been running Lazarus all day via GDB and finally got a crash when
I opened a new project.

Though looking at the output here, I don't think it's of much help...


TMainIDE.DoCloseEditorFile end
TMainIDE.DoCloseEditorFile A PageIndex=3
TMainIDE.DoCloseEditorFile end
TMainIDE.DoCloseEditorFile A PageIndex=2
TMainIDE.DoCloseEditorFile end
TMainIDE.DoCloseEditorFile A PageIndex=1
TMainIDE.DoCloseEditorFile end
TMainIDE.DoCloseEditorFile A PageIndex=0
TMainIDE.DoCloseEditorFile end
Gdk-ERROR **: BadWindow (invalid Window parameter)
  serial 6267625 error_code 3 request_code 15 minor_code 0


Aahh those :(
They are very hard to track, especially on gtk1


Program exited with code 01.
(gdb) bt
No stack.


there is nothing to bt, since the app got terminated.

You might get more info when you run laz in --sync mode but I can 
imagine you don't want to run allday in this mode



Marc

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


Re: [lazarus] TProcess.Input problem

2007-11-29 Thread Marc Weustink

Vincent Snijders wrote:

Michael Van Canneyt schreef:


On Thu, 29 Nov 2007, Malcolm Poole wrote:


Marc Weustink wrote:

Malcolm Poole wrote:

Hello everyone!

I am trying to write a front-end for the command-line archiving
program
dar ( http://dar.linux.free.fr/ )

Is it possible that it is ignoring stdin because it is not being 
run from

a terminal?

Thats possible too. But maybe it isn't reading stdin at all.
I was beginning to suspect that this was possible (*sighs*). Looking 
again at

the dar source I found the following:
   // we do not use anymore standart input but open a new descriptor
   // from the controlling terminal. This allow in some case to 
keep use
   // standart input for piping data while still having user 
interaction

   // possible.
Apart from the fact that it doesn't use stdin for interaction I'm 
afraid this

is all a bit above me.

I suspect that this means that I am not going to be able to interact 
with dar

using TProcess. Is this correct?


This is correct. If it uses accesses the terminal directly, there is 
little
you can do, except opening the terminal and trying to control it 
yourself,

but that's outside the scope of TProcess.




Maybe you can use dar_slave instead?
http://dar.linux.free.fr/doc/man/dar_slave.html


from the manpage I guess dar_slave communicates through named pipe. This 
should be possible through tprocess too.


Marc

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


Re: cannot find -lGL (OpenGLContext application)

2007-11-28 Thread Marc Weustink

Valdas Jankūnas wrote:

[EMAIL PROTECTED] rašė:

Quoting Marco Alvarado [EMAIL PROTECTED]:


Oh look, I got the same error when compiling the TOpenGLContext example:

Compiling package LazOpenGLContext 0.0 completed
/usr/bin/ld: cannot find -lGL
testopenglcontext1.lpr(14,1) Error: Error while linking
testopenglcontext1.lpr(14,1) Fatal: There were 1 errors compiling
module, stopping

What needs to be configured in order to get these applications running?



I am just guessing; but it is not linking in the GL library.

is it -LGL instead of -lGL?, also just try -L GL?

I think that you are very close..

the next error should be; cannot find library GL

The linux linker is very pedantic - keep trying


 First check if library libGL is installed: open console, execute cd 
/usr/lib to goto in that dir then execute ls libGL*. If in output you 
see words like libGL.so.1.0.9639 - library is installed, otherwise you 
need install this library.
 If library is installed but you not see libGL.so in ls output then 
you need make symlink from libGL.so.some_numbers (in my example 
libGL.so.1.0.9639) to libGL.so: execute in that dir command sudo ln 
-s libGL.so.some_numbers libGL.so.


usuallt you will get this symlink if you install the devel package if gl.

Marc

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


Re: [lazarus] Back to 0.9.22

2007-11-28 Thread Marc Weustink

Arí Ricardo Ody wrote:
We have lots of Lazarus projects here. It would be almost impossible to 
debug each one and report error(s).


Keep in mind that we might not find them ourselves. So when no cause if 
found they wont get fixed.


Marc


PS. technically the difference between .24 and .23 is only one commit: 
the increase of version number.


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


Re: [lazarus] Makeopts

2007-11-27 Thread Marc Weustink

Damien Gerard wrote:


When I use the command line : export LCL_PLATFORM=gtk; make clean all it 
compiles well.


But when I use export LCL_PLATFORM=gtk; make -j 2 clean all it does not 
compile at all


Unlike C where files can compiled simultanious since there is no 
relation between them, for pascal that is not possible. So don't use -j 
option.



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


Re: [lazarus] Lazarus on OS X

2007-11-26 Thread Marc Weustink

Damien Gerard wrote:


I have just download fpc 2.2.1 and the lastest snapshot for OS X.
I launch Lazarus and it works fine (however gtk1 is ugly ^^) but I can 
not launch an empty application.


I've got the following message :
Unable to find wslclasses.pp, check in path Projects-Compiler 
Options-Search Paths - Other Unit files


You got this when compiling ? How did you create your new project ?


In fact, in order to compile an empty project, I have to add by hand all 
needed paths into the fpc.cfg. I did not find such a thing in the wiki.

Where I am wrong ?


For compilation of your apps, you don't need to add paths to lazarus or 
LCl sources in your fpc.cfg. It only needs a path to the LCL unit dirs. 
(and that only if you compile form the commandline)



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


Re: [lazarus] is laz 9.24 fixes on svn ready to be used?

2007-11-26 Thread Marc Weustink

Bee wrote:
Correct. The fixes branch, in this moment contains 0.9.24 (r. 12749 in 
trunk branch, 12771 in the fixes branch, but the only change is making 
it 0.9.24.1) + patches 12756, 12757 12760 12762 12797 12816 12831 
12825 12946 from trunk. (I hope I didn't mistype too many, but an svn 
log -r 12749:HEAD will tell you the truth).


Can we have more fixes from 9.25 applied to 9.24.1? :-D


Please suggest

Marc

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


Re: [lazarus] TMaskEdit new release

2007-11-23 Thread Marc Weustink

Guadagnini David wrote:


Yes, those actions are *not* handled by the LCL, it is the widgetset 
itself which handles the paste. Therefore, you won't see a call to 
SetText.
This is a problem for components similar to MaskEdit because no one can 
handle text input through alternative control + v.
Whether you know there is some procedure call after or before a paste 
command?


You don't. However, the widgetsetinterface should notice a control when 
something is pasted. I don't kbnow if all interfaces implement this atm.


Marc

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


Re: [lazarus] TMaskEdit new release

2007-11-23 Thread Marc Weustink

Guadagnini David wrote:




Again, that did you do ? Paste by doing calling paste, or paste by 
pressing ctrl-v (or choose paste form edit popup)


I tried past with ctrl+v, ctrl+ins and paste from edit popup but It's 
the same


Yes, those actions are *not* handled by the LCL, it is the widgetset 
itself which handles the paste. Therefore, you won't see a call to SetText.


Marc

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


Re: [lazarus] TMaskEdit new release

2007-11-23 Thread Marc Weustink

Guadagnini David wrote:
In attach You can found my TMaskEdit component with the changes proposed 
by Marc.


Note:
TComponent have a big bug (for me). The windows message WM_PASTE is not 
processed correctly.
In fact, if the override procedure RealSetText or WndProc by entering a 
simple Begin/End without other the text is still overridden if I execute 
a PAST command (note the text will be override only with past command, 
not with key press or with a normal TEXT := 'Mystring')



Again, that did you do ? Paste by doing calling paste, or paste by 
pressing ctrl-v (or choose paste form edit popup)


Marc


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


Re: [lazarus] is laz 9.24 fixes on svn ready to be used?

2007-11-23 Thread Marc Weustink

Bee wrote:

The release was built with rev 12749. The new patches are not
included.


Is 9.24 release is taken from tags folder? I saw it with rev 12750. And 
I saw the fixes branch is on rev 12958. I look them in laz's svn. Am I 
correct? Or any other repository that I don't know?


in svn are 3 folders: trunk, tags, branches

trunk: current development
tags: all releases
branches: fixes on releases

These aren't real folders, but more a shortcut to a certain revision.
When a tag (or branch) is made, this action itself also gets a revision 
nr. Therefore a tag/branch starts with a different revision, but can be 
based on the same trunk revision.


Marc


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


Re: [lazarus] TMaskEdit

2007-11-22 Thread Marc Weustink

Guadagnini David wrote:
In attach You can found my TMaskEdit component that work well in Windows 


At first glance this looks like a clean implementation without copied 
code (can sombody this verify agains cppbuilder implementations)



Some remarks about the code:

Try to avoid Arguments and Methods prefixed with _
For Aguments there is no problem in prefixing them with A, for 
property getters there is nothing wrong with prefixing them with Get. In 
your case, GetIsMask makes perfectly clear that it reads the IsMasked 
property.


Variable names like X1, X2, XX1, XX2
Please name them after there use: GetSel(X1, X2) could also be coded 
like: GetSel(SelStart, SelLength) (or was it SelStop)

You see... with naming them it will be clear.

Why using the C approach for naming all kinds is Char_xxx (as char). 
Pascal has a perfect suitable type for this : enum.

No cludging winth #nn and mak sure they are unique etc.

in CanInsertChar, why do you use short stings and why assigning S := 
FMask instead of accessing Fmask.


Anyway, I think that after some cleanup, this will be usable code.

and in Linux but have a little bug: the message WM_PAST seems that is 
never invoked. I tried to override the procedure PasteFromClipboard of 
the component TCustomEdit but is the same. Some idea?



Pasting is handled by the widget itself. unlike in windows, I think a 
paste isn't redirected yout



marc

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


Re: [lazarus] TMaskEdit

2007-11-22 Thread Marc Weustink

Guadagnini David wrote:



Try to avoid Arguments and Methods prefixed with _
For Aguments there is no problem in prefixing them with A, for 
property getters there is nothing wrong with prefixing them with Get. 
In your case, GetIsMask makes perfectly clear that it reads the 
IsMasked property.



Ok!

Variable names like X1, X2, XX1, XX2
Please name them after there use: GetSel(X1, X2) could also be coded 
like: GetSel(SelStart, SelLength) (or was it SelStop)

You see... with naming them it will be clear.


Ok!
Question... SelStart and SelStop are present in TCustomEdit controls?


I mean them as variable names. If they are present as properties use 
StartSel/StopSel for instance.


Why using the C approach for naming all kinds is Char_xxx (as char). 
Pascal has a perfect suitable type for this : enum.

No cludging winth #nn and mak sure they are unique etc.


For me it is easier to administer. But if you want I change it


They are clearer, and can be checked better if they are in range for 
instance. (who will check if #42 is valid in your case)


What do you mean by administer ? declaring like:
  TmyEnum = (Enumone, enumTwo...);
is imo easier than:
  TmyEnum_EnumOne = 1;
  TmyEnum_EnumOne = 2;
  ...

if you man the FMask array ? Delcalre it like FMask: array of TmyEnum;

in CanInsertChar, why do you use short stings and why assigning S := 
FMask instead of accessing Fmask.


Because in Delphi if I use String can not access to a single char with 
S[] and I must trasform String in ShortString or in PChar or in Array Of 
Char


???
Don't know about your version of delphi, but all the versions I know 
(D1..D7), you can access SomeString[i] as character


Pasting is handled by the widget itself. unlike in windows, I think a 
paste isn't redirected yout




The strange thing is that the procedure PasteFromClipboard not be invoked


Paste from clipboard is an action. The developer tells the control to 
get the contents of the clipboard (like it was pasted by the user)


Marc

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


Re: [lazarus] LCL in Dll

2007-11-22 Thread Marc Weustink

Leonardo M. Ramé wrote:
I'd try to compile Zeos Library in a Dll using Lazarus, it comiples, but 
can't be loaded at least using LoadLibrary in Windows, resulting in an 
Unknown Run-Time error 202.


Reading in old forums, I found that isn't possible to create forms in 
dlls because of LCL problems, a bug report was created regarding this 
issue (check this: http://www.freepascal.org/mantis/view.php?id=7181 ), 
but it seems to be frozen.


Not frozen, but the target is set to post 1.0. That means that at least 
the developers won't adress it now.


My think my problem is related to that bug, because I can create the dll 
using straight FPC from command line and it works correctly.


Creating dlls is not the problem, but anything TAppliation related 
cannot be used in a dll. (delphi uses some hhoks to connect the 
TAppliation instance in the dll to the one in the mainapp)



Does anyone addressed the issue? any positive feedback?



Marc

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


Re: [lazarus] Mac OS X : Bitmap ScanLine....

2007-11-21 Thread Marc Weustink

Dominique Louis wrote:
I know I've labeled this as Mac OS X, it's probably not specific to that 
 OS.


I've looked at the scanline demo and it works fine on Mac OS X.

My question is when I try to use the code in my project using Delphi 
compatability mode,  I get the error listed below...


var
  lRow : Pointer;
  ScanLineImage : TLazIntfImage;
begin
  for j := 0 to Height - 1 do
  begin
lRow := ScanLineImage.GetDataLineStart( j );
i := 0;
while ( i  Width - 1 ) do
begin
  PByte(lRow)[i] := 0;  // Error : Array type required
end;
  end;
end;

Why and is there a fix for this? 


in objfpc mode you can access any typed pointer as an array like:

var
  p: PWord;
begin
  ...
  p[someindex] := 12345;


Should I define lRow as a PByteArray?

In delphi mode, Yes.

Unless you want to compile this in Delphi, there is no reason to use 
delphi mode. You can, if needed, use a different mode per unit.


Marc

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


Re: [lazarus] Latest reviosn fails on Windows

2007-11-21 Thread Marc Weustink

Jeff Steinkamp wrote:




C:\lazarusmake
makefile:3434: warning: overriding commands for target `examples'
makefile:3394: warning: ignoring old commands for target `examples'
make -C lcl all
make[1]: Entering directory `C:/lazarus/lcl'
C:/lazarus/fpc/bin/i386-win32/rm.exe -f units/i386-win32/alllclunits.ppu
C:/lazarus/fpc/bin/i386-win32/ppc386.exe -gl -Fu. -Fuforms -Fuwidgetset  
-Fiinclu

de -FE. -FUunits/i386-win32 -di386 alllclunits.pp
Free Pascal Compiler version 2.2.0 [2007/09/09] for i386
Copyright (c) 1993-2007 by Florian Klaempfl
Target OS: Win32 for i386
Compiling alllclunits.pp
alllclunits.pp(31,1) Fatal: Can't find unit System used by AllLCLUnits
Fatal: Compilation aborted
make[1]: *** [alllclunits.ppu] Error 1
make[1]: Leaving directory `C:/lazarus/lcl'
make: *** [lcl] Error 2


Make sure that your fpc.cfg is pointing to the right version of the fpc 
units. (If the system unit cannot be found, you're using the the wrong 
version of units)


Marc

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


Re: [lazarus] 0.9.24 released

2007-11-21 Thread Marc Weustink

Bee wrote:

The Lazarus team is glad to announce the 0.9.24 release. This release
is based on fpc 2.2.0.


Great job! Congratulations! :)

Then I assume this will be shortly followed by fixes branch of this 
latest stable release (v.0.9.24.1?) using the latest fpc's fixes branch 
of the latest stable release (v.2.2.1). 


Nope, that are moving targets, it will be 0.9.24.2 and 2.2.2 (or 2.2.0)

I personally prefer fixes branch 
(of stable release) than the stable release itself.


Why ?
(Personally I prefer stability and not a moving target where you have to 
find out what surprised tomorrow will bring)




-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



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


Re: [lazarus] last svn problems under fpc 2.0.4

2007-11-18 Thread Marc Weustink

Giulio Bernardi wrote:

A little bit off topic... but does lazarus still need to support fpc 2.0.4?
AFAIK fpc 2.2.0 runs on all platforms supported by lazarus... or am I missing 
something?


nope. 2.2.0 fails on OSX when sources are located on a casesensitive 
filesystem. So initially I plead for 2.0.4 compatebility.
However 2.2.1 has solved this, so for me there is no reason that there 
*must* be a 2.0.4 compatebility.
I've to admit that after my last changes I forgot to check if 2.0.4 
still compiles., maybe causeing your problems.


Marc

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


Re: [lazarus] Laz / Fpc function listing

2007-11-17 Thread Marc Weustink

James Chandler Jr wrote:
I've been using Delphi Pro from version 1 thru 2006 (skipped over a few 
versions).


I really like Lazarus, especially the crossplatform aspects.

Strangely, have been using Delphi Help (very well put-together) for most 
Lazarus lookup. I first check on the function (easy to find) in Delphi 
help, then do a file-search in the Lazarus folder to see if the name 
exists, and double-check to lookup any differences which might exist 
from the Delphi incarnation.


But a lot of times, you have to know a little bit before you start 
looking in Lazarus. Some fpc/lazarus stuff is well documented and easy 
to find 'on the surface'. Other stuff is well hidden.


A trivial example-- Try doing a google search or search the fpc/lazarus 
websites for documentation on PtInRect. Maybe ya'll have different 
search tools that recover lots of references, but if I don't know what 
pas/inc file holds PtInRect, I can't find any easy-to-retrieve info with 
a web search. I knew I needed PtInRect, but didn't know if Lazarus had 
one, and didn't know how Lazarus spells it.


Ah.. this is a common issue. While a lot of ppl think all routines you 
use in delphi are from delphi, it in fact isn't.
You have the ones made by Borland which you will find in the rtl or vcl 
and you have the translation of windows api.

PtInRect is such function. It is defined in the Windows Unit.

Since Lazarus is crossplatform, it doesn't have a windows unit. Most 
common used winapi functions you normally would find in the windows unit 
are implemented in the LCIIntf unit.


Marc


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


Re: [lazarus] Mac OS X : Picture.Assign causing Access Violation...

2007-11-16 Thread Marc Weustink

Dominique Louis wrote:

Hi,
  Has anyone else encountered a problem on Mac OS X where by when you 
try to perform a TImage.Picture.Assign( my_image ); it causes an access 
violation?


In this case the my_image is a TBitmap, if that makes any difference.
Are there any Bitmap types that Lazarus cannot load?


This doesn't matter since the bitmap is loaded by TBitmap and not 
TImage.Picture.


Do you have a code example on how you are using it ?

Marc


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


Re: [lazarus] Mac OS X : Picture.Assign causing Access Violation...

2007-11-16 Thread Marc Weustink

Mark Morgan Lloyd wrote:

Dominique Louis wrote:

Hi,
  Has anyone else encountered a problem on Mac OS X where by when you 
try to perform a TImage.Picture.Assign( my_image ); it causes an 
access violation?


In this case the my_image is a TBitmap, if that makes any difference.
Are there any Bitmap types that Lazarus cannot load?


Pardon my ignorance, but is that a bigendian or littlendian architecture?

I'm trying to track down what might be the same type of problem on SPARC 
under Linux, but I'm afraid that I've got my hands rather full of 
(off-project) stuff at present.


Is sparc BE ?

Marc



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


Re: [lazarus] Mac OS X : Picture.Assign causing Access Violation...

2007-11-16 Thread Marc Weustink

Mark Morgan Lloyd wrote:

Marc Weustink wrote:

Mark Morgan Lloyd wrote:

Dominique Louis wrote:

Hi,
  Has anyone else encountered a problem on Mac OS X where by when 
you try to perform a TImage.Picture.Assign( my_image ); it causes an 
access violation?


In this case the my_image is a TBitmap, if that makes any difference.
Are there any Bitmap types that Lazarus cannot load?


Pardon my ignorance, but is that a bigendian or littlendian 
architecture?


I'm trying to track down what might be the same type of problem on 
SPARC under Linux, but I'm afraid that I've got my hands rather full 
of (off-project) stuff at present.


Is sparc BE ?


Yes.


OK, I couldn't remember. I only remembered the alignment issues florian 
and I had when getting lazarus-sparc to work


Working from memory rather than notes a form icon works OK on Win-32 and 
x86-Linux except that it might get turned upside-down (that might be 
specific to BMP rather than XPM). 


I only know that this is the case for lazarus running on wine (and I 
know the location what causes this, I only need to do some checks).


However it causes various exceptions 
in the IDE on SPARC to the extent that a form won't load into the 
designer, although compilation works and the result is runnable. I got 
as far as suspecting that there were related problems.


Lazarus should run on a BE machine (tested on my ppc mini mac)

I must stress that the above might be unreliable since I'm not working 
from a methodical set of experiments and notes, it's something I hope to 
get back onto as soon as I have time.


:)

Maybe I should find some time to fix my disk issue and fireup my sparc

Marc

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


Re: [lazarus] copyright infringement in LCL code

2007-11-13 Thread Marc Weustink

Graeme Geldenhuys wrote:

Hi,

Due to the previous discussion of copyright infringement in FPC code,
I downloaded a Similarity Tester (SIM 2.21) and ran it against a few
random selected files, comparing LCL to Kylix 3 source.

Oh my!!!   I found quite a bit of code that are marked as copied.  No,
I'm not talking about the class interfaces which are duplicated or
purpose.


Did you also skip the trivial implementations ?

I know for some parts I wrote myself that they are pretty similar to the 
way delphi had implemented them. Most smaller implementations of a given 
method can only be done in one efficient way. So it make's sense that 
they look equal.



Note:
This tool is automated and fast.  I'm sure _not_ everything it detects
are actual copied code, but it might be worth our while going through
it and verifying the code marked.
Rather be safe than sorry. Plus we can then say we tried to remove
infringed code from our side.


True. The most used pieces of delphi code I recognize, but not the from 
the bit more exotic areas.
We have also had one or two cases where code appeared to be similar, but 
only had a (important) difference in details.


Marc

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


Re: copyright infringement in LCL code

2007-11-13 Thread Marc Weustink

Graeme Geldenhuys wrote:

On 13/11/2007, Graeme Geldenhuys [EMAIL PROTECTED] wrote:

Oh my!!!   I found quite a bit of code that are marked as copied.  No,
I'm not talking about the class interfaces which are duplicated or
purpose.




To prove this point, I attached the output of 'sim_pasc' comparing the
LCL's controls.pas to the Kylix 3 QControls.pas
Even some of the comments are identical!

See attached file for output:
  Line 5-30  (code looks the same)
  Line 60-69  (even comments are the same)
  Line 351-355 (code identical)
  ...etc...


How should I read it ? Does the tool change variable/procedure names ?
(I can't imagine we're using a QWidget)

better not to use CLX sources, they are a bit different than VCL 
(besides the LCL predates CLX)



Marc

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


Re: [lazarus] Bad news

2007-11-12 Thread Marc Weustink

Florian Klaempfl wrote:

Bee schrieb:

I must have missed something basic in this thread. What is/was
CodeGear's reaction to Lazarus?

I saw some issues on the net. Someone from Borland said that FPC/Lazarus
steal codes from Delphi. Someone other from CodeGear said that
FPC/Lazarus is competitor to Delphi, someone other even said that
FPC/Lazarus is the enemy of Delphi. :( But, I forgot the URLs. I don't
know about other issues (if exist).


If one finds such links, I'am really interested in them.


I couldn't find any, except for one blog comment of bee himself.

Marc (really wants to know too)



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


Re: [lazarus] Bad news

2007-11-12 Thread Marc Weustink

Leonardo M. Ramé wrote:
http://www.stevetrefethen.com/blog/IWishTheDelphiCommandLineCompilerWereFree.aspx 


Where have I heard such accusations before


Marc

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


Re: [lazarus] Mac OS X : Correct way to debug in lazarus...

2007-11-12 Thread Marc Weustink

Dominique Louis wrote:

Hi Matt,
  the version returned is 6.3.50-20050815 ( Apple version gdb696)


funny, I've: GNU gdb 6.3.50-20050815 (Apple version gdb-573)

I think yours should work too

Can you send the output of the debug-debug output window ?

Marc

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


Re: [lazarus] Mac OS X : Correct way to debug in lazarus...

2007-11-11 Thread Marc Weustink

Dominique Louis wrote:

Hi all,
  What is the correct way to debug under Lazarus. I have the current 
settings in Environment-Debugger Options-General ( tab )..

Debugger type and path = GNU debugger (gdb)
path = /usr/bin/gdb

If I set a break point and run the application from within the IDE I get..
Initialization output:
\nwarning: 
--arch option not supported in this gdb.\n

If I click ok on that I then get
Debugger error
Oooops, the debugger entered the error state
Save your work now!

Hit Stop, and hope the best, we're pulling the plug.


Where is this --arch option being set and is there something else I need 
to do to be able to debug on Mac OS X.


What gdb version are you using ?

Marc

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


Re: [lazarus] ParentWindow

2007-11-10 Thread Marc Weustink

Christian Budde wrote:
Ok, just for the records: I tried to do it with 
TWinForm.CreateParented(ParentWindow: hwnd), but I get an access 
violation. So that does not work.

I think ParentWindow is very widgetset specific (see below). Probably
it will work cross platform very limited.
  
Ok, thanks for the information. I'm willing to find a cross platform 
solution, so I don't necessary need to go that ParentWindow road.

Solution:
It is probably easier to create a wrapper TWinControl / TCustomForm
with the ability to use the foreign Handle.
  

I just had a look at the wincontrol.inc and I already found this:

{-- 


 TWinControl CreateParentedControl
--} 

class function TWinControl.CreateParentedControl(ParentWindow: hwnd): 
TWinControl;

begin
 // ToDo
 Result:=nil;
end;

Is this what you thought of? I mean it's still pretty ToDo, but I 
guess the structure is already there. Now all I need to do is fill it 
with live. Any ideas?


The main reason it exists is delphi compatebility. Using this function 
instead of using windows.SetParent has the advantage that the VCL/LCL 
knows that the parent is not a VCL/LCL control so it can do special things.


I think on win32 for sure and on X or OSX it is doable. However I think 
it will take loads of time to debug the LCL prevent it to assume that a 
parent always is a LCL control. And the result will always have less 
functionality that when it has a real LCL parent. Even in delphi this is 
the case.
So it is a lot of effort for something with limited functionality and 
limited use. I rather spend my time on other things.


Marc





   Christian

_
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] help for Scanline exemple

2007-11-07 Thread Marc Weustink

wile64 wrote:

I found,

with Init_BPP32_B8G8R8A8_BIO_TTB and load ScanLineImage, work Ok

with Init_BPP32_B8G8R8A8_BIO_TTB and CopyPixels in example don't work,

  IntfImage.CopyPixels(ScanLineImage);
  MyBitmap.LoadFromIntfImage(IntfImage);


Thats why I asked what the description of IntfImage was and not 
ScanLineImage.


When Copying pixels the description is not copied, but the pixels are 
matched to the description of IntfImage


Marc

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


Re: [lazarus] help for Scanline exemple

2007-11-07 Thread Marc Weustink

wile64 wrote:



2007/11/7, Marc Weustink [EMAIL PROTECTED] 
mailto:[EMAIL PROTECTED]:


wile64 wrote:
  I found,
 
  with Init_BPP32_B8G8R8A8_BIO_TTB and load ScanLineImage, work Ok
 
  with Init_BPP32_B8G8R8A8_BIO_TTB and CopyPixels in example don't
work,
 
IntfImage.CopyPixels(ScanLineImage);
MyBitmap.LoadFromIntfImage(IntfImage);

Thats why I asked what the description of IntfImage was and not
ScanLineImage.

When Copying pixels the description is not copied, but the pixels are
matched to the description of IntfImage

Marc


It should change can be an Scanline example for not use CopyPixels!


That is what I suggested in my first reply.

(or change the description of IntfImage)

Marc

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


Re: [lazarus] help for Scanline exemple

2007-11-06 Thread Marc Weustink

wile64 wrote:

Hi,

I use the example Scanline to change an image with the alpha channel as 
well.


  alphaTransparent  = 0;
  alphaOpaque   = 255;


  IntfImage.CopyPixels(ScanLineImage);


what is the Description of IntfImage ?
Does it have an Aplha channel ?


  MyBitmap.LoadFromIntfImage(IntfImage);


Why not loading from ScanLineImage ?


  Canvas.Draw(10,10,MyBitmap);


I think ths should work.


The problem is that I have no transparency with this method.

How to give transparency to MyBitmap?


Marc

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


Re: [lazarus] Bug in recompiling IDE

2007-11-05 Thread Marc Weustink

Michael Van Canneyt wrote:


On Mon, 5 Nov 2007, Vincent Snijders wrote:


Michael Van Canneyt schreef:

When you recompile the 32-bit lazarus IDE for 64-bit, you get the following
error:

TLazPackageGraph.CheckIfPackageNeedsCompilation  Compiler filename changed
for SDFLaz 0.1.1
  Old=/usr/local/bin/ppc386
  Now=/usr/local/bin/ppcx64
[TExternalToolList.Run] CmdLine=/usr/local/bin/ppcx64  -S2cgi -OG1 -Tlinux
-gl -vewnhi -l -Fu../../lcl/units/i386-linux/
-Fu../../lcl/units/i386-linux/gtk/ -Fu../../packager/units/i386-linux/ -Fu.
-FUlib/i386-linux/ -dLCL -dLCLgtk sdflaz.pas
WorkDir=/home/michael/projects/lazarus/components/sdf/

As you can see, the IDE passes the 32-bit paths to the packages.

Steps to reproduce:

- Load 32-bit Lazarus.
- Set compiler to 64-bit compiler
- Build Lazarus
Voila...

Solution:
use make to build initial 64-bit IDE, then use this ide to do build
lazarus.

Did you change the target CPU in the build lazarus dialog?


Nope, nothing is set explicitly. 
When not set, doesn't it determine it from the compiler binary ?


Or does it take the same CPU as the IDE was compiled for ? 


The latter :(


That would explain the behaviour, of course...


I ran into this several times.
IMO some defaults should be set by the choosen compiler.

OTOH, when you use fpc as compiler, the target options determine pass 
the right option to is.



Marc

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


  1   2   3   4   5   6   >