[lazarus] Reminder: PATCH to fix Crashes on Carbon in FindEnclosingBlock

2007-12-05 Thread Tobias Giesen
Hello,

I am attaching a simple patch to fix crashes on Carbon.

It is important that the Unicode text buffer remains intact all the
time between BeginTextRender and EndTextRender. Otherwise, there may
or may not be access violations deep inside the Carbon framework.

(like http://www.superflexible.com/Crash.tiff)

Cheers,
Tobias

http://www.superflexible.com




carboncanvas-tg-2007-12-04-fixes-crash!.patch
Description: Binary data


[lazarus] PATCH to fix Crashes on Carbon in FindEnclosingBlock

2007-12-04 Thread Tobias Giesen
Hello,

I am attaching a simple patch to fix crashes on Carbon.

It is important that the Unicode text buffer remains intact all the
time between BeginTextRender and EndTextRender. Otherwise, there may
or may not be access violations deep inside the Carbon framework.

(like http://www.superflexible.com/Crash.tiff)

Cheers,
Tobias

http://www.superflexible.com




carboncanvas-tg-2007-12-04-fixes-crash!.patch
Description: Binary data


[lazarus] Crashes on Carbon in FindEnclosingBlock (MORE INFO)

2007-12-04 Thread Tobias Giesen
Hello,

the latest LCL causes these crashes too.

I have seen this problem even a few months ago, so it is not anything
new.

Has nobody else seen it?

http://www.superflexible.com/Crash.tiff

Cheers,
Tobias



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


[lazarus] Crashes on Carbon in FindEnclosingBlock

2007-12-04 Thread Tobias Giesen
Hello,

I am fighting occasional crashes of my program. It uses the Carbon
widgetset on Tiger / Intel. Approximately 1 in 10.000 ExtTextOut
operations causes a crash. I have no idea what to do.

Here's a call stack for the crash:
http://www.superflexible.com/Crash.tiff

My LCL is a few weeks old. Has this been fixed or how can I debug it?

Thanks.

Cheers,
Tobias



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


[lazarus] About and Help on Carbon Menu Bar

2007-11-18 Thread Tobias Giesen
Hello,

is there a known best way to get the "About My App" menu item into the
so-called "Application Menu" on the Mac OS Menu bar?

Also is there a way to get the keyboard shortcut for Help to be Cmd-?
rather than F1?

If not I'll probably construct my menu directly using Carbon Menu
Manager ...

Cheers,
Tobias

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


[lazarus] IDE Crashes on Mac OS (gtk)

2007-11-18 Thread Tobias Giesen
Hello,

the latest SVN version crashes a little more often than usual. The
Find in Files dialog does not appear at all, instead there is an
access violation.

This is on Mac OS X 10.4 (i386) under X11 (gtk).

Cheers,
Tobias


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


[lazarus] Carbon TMemo with invisible font

2007-11-17 Thread Tobias Giesen
Hello,

some change made since last week caused my TMemo to use the same color
for the font that is used for the background. Only selected text can be
seen. It does not matter which colors I choose for foreground or
background.

My quick fix is to comment out the body of TCarbonMemo.SetFont in
CarbonEdits.pp. But the actual cause is not in this function, since
CarbonEdits.pp has not changed lately.

Any ideas?

Cheers,
Tobias


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


[lazarus] compiled file size on OS X

2007-11-06 Thread Tobias Giesen
Hello,

I noticed that my compiled Lazarus programs are huge. I assume they
contain debug info or something else that can be stripped.
Interestingly, GNU DB debug info is not checked on the Linker tab sheet,
but I can debug anyway, within Lazarus.

How can I get the binaries smaller?

Thanks.

Kind Regards,
Tobias Giesen

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


Re: [lazarus] Adding AllowFractionalPositioning to TCarbonDeviceContext

2007-11-05 Thread Tobias Giesen
Hi Philip,

thanks for your research! I can confirm that in my program, only TLabel
is affected strongly, but TStringGrid also shows slightly incorrect text
rendering. TStringGrid does not have any problems with editing text even
with my patch, because it seems to use a standard Mac OS Edit field for
editing.

I think we need to tell TCarbonDeviceContext which kind of text
rendering is needed. I still think we should add something like Mattias
proposed and add
> function SetFontFractionalPositioning(DC: HDC;
>   UseFractionalPositioning: boolean): boolean;
> to carboncanvas.pp

By the way if you can send a demo app (binary or source) with your
custom control I could make some screenshots on my i386 iMac (1680x1050).
I will also be getting Leopard tomorrow.

Cheers,
Tobias


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


Re: [lazarus] Adding AllowFractionalPositioning to TCarbonDeviceContext

2007-11-04 Thread Tobias Giesen
Hi Phil and others,

I think if we only make careful amendments to carboncanvas.pp and
nowhere else, then nobody needs to be horrified any more.

I did not see your screenshots! I can confirm that the text won't look
identical to the buttons even with my changes, but that is not so
important. It might be intended by Apple.

So if you could live with the change that Mattias proposed, I would go
ahead and prepare a patch to add this function:

> function SetFontFractionalPositioning(DC: HDC;
>   UseFractionalPositioning: boolean): boolean;
> to carboncanvas.pp

Which you would need to call just once for any Canvas involved.

Since this is Carbon-internal, we could include it in 0.9.23.

What do you think?

Kind Regards,
Tobias Giesen

Super Flexible Software Ltd. & Co. KG
Lessingstr. 42
48485 Neuenkirchen, Germany
www.superflexible.com
www.tgtools.com

---
Registered at register court Steinfurt as HRA 5061
Liability / general partner: TGTools Ltd.
Company No. 05513299
Registered in England and Wales
Directors: Tobias Giesen and Claudia Hübl

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


Re: [lazarus] Adding AllowFractionalPositioning to TCarbonDeviceContext

2007-11-04 Thread Tobias Giesen
> There's a Font property, Pitch ... fpfixed

That sounds promising. I would like to try and submit a patch which
disables the fractional spacing only when the Pitch is fpfixed. Then
Philip can try if his component still works.

I read somewhere that if TCarbonDeviceContext.BeginTextRender was broken
after 0.9.22, then it must be fixed before the next official release.
Right now I am not sure when it was broken. But it is definitely broken
right now.

Cheers,
Tobias


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


Re: [lazarus] Adding AllowFractionalPositioning to TCarbonDeviceContext

2007-11-04 Thread Tobias Giesen
> You can add for example
> 
> function SetFontFractionalPositioning(DC: HDC;
>   UseFractionalPositioning: boolean): boolean;
> to carboncanvas.pp

Thanks, Mattias! 

I will propose a new patch based on this sugestion.

Then SynEdit and Philip would have to use it, because I think the
default should be true for all the labels and such.

Cheers,
Tobias


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


Re: [lazarus] Carbon Widgetset: character spacing problems

2007-11-04 Thread Tobias Giesen
Phil wrote:
> There's probably quite a lot going on here. Tomas is actually passing 
> a total of 8 options, including options to turn off kerning, to use
> rounded text metrics instead of fractional, and others, as well as
> disabling fractional spacing in the rendering of the line.

Hi Phil,

could you find out which of these options are actually needed? I think
the combination of so many disable-options may cause the problem.

Currently, the text is simply displayed in a very bad and a very wrong
way. It is almost unreadable.

Please look at it again:
http://www.superflexible.com/characterspacing.png

Cheers,
Tobias

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


[lazarus] Adding AllowFractionalPositioning to TCarbonDeviceContext

2007-11-04 Thread Tobias Giesen
Hello,

if we add the property to TCarbonDeviceContext, is that accessible from
a custom component in a reasonable way? Would Phil be willing to change
a property in TCarbonDeviceContext using the appropriate typecasts?

Fractional positioning should never be turned off globally for the 
application, since I am sure Phil's applications will use TLabels
too. So the property must be in each canvas or DC.

Cheers,
Tobias


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


Re: [lazarus] Proposing a new TCanvas property such as AllowFractionalPositioning

2007-11-04 Thread Tobias Giesen
> a new property could make everybody happy _today_.
>> And everybody unhappy in the future because it is very ad-hoc

Not necessarily. If we make it general and generally useful, it can be
quite a good thing. So I agree, the word Carbon should not appear in
the property name. UseFractionalPositioning, for example. That sounds
like a pretty generic and useful property. The custom controls that
have problems with it would set it to false only on Carbon. So they
would need some conditional compilation on Carbon, for the time being.
Until the fractional positioning has been sorted out.

Cheers,
Tobias


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


Re: [lazarus] Proposing a new TCanvas property such as AllowFractionalPositioning

2007-11-04 Thread Tobias Giesen
> AFAIK other widgetsets have fractionals too and you don't need a
> parameter.

OK then we'll call the new property
AllowCarbonFractionalPositioning

> - either implement scale factors for TCanvas
> - or add TextOut/TextExtent/... functions with floats to TCanvas.

Sounds like long-term solutions ... a new property could make everybody
happy _today_.

Kind Regards,
Tobias Giesen

Super Flexible Software Ltd. & Co. KG
Lessingstr. 42
48485 Neuenkirchen, Germany
www.superflexible.com
www.tgtools.com

---
Registered at register court Steinfurt as HRA 5061
Liability / general partner: TGTools Ltd.
Company No. 05513299
Registered in England and Wales
Directors: Tobias Giesen and Claudia Hübl

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


[lazarus] Proposing a new TCanvas property such as AllowFractionalPositioning

2007-11-04 Thread Tobias Giesen
Hello,

after considering everything I believe that we need a new property in
TCanvas. Custom controls that can't work with fractional positioning
would have to set the property to false after the canvas is created.
By default it would be true. Does that sound good? Should I do it?

I don't think we can fulfill everybody's requirements without this.
The alternative would be a new parameter for all functions that use
BeginTextRender.

Cheers,
Tobias


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


Re: [lazarus] Carbon Widgetset: character spacing problems

2007-11-03 Thread Tobias Giesen
Phil wrote:
> As I feared, your fix busted my custom control. Please revert the 
> change until a better solution is arrived at.

Please make a suggestion on how your custom control can let the 
ExtTextOut function know that it cannot handle fractional positions.
I think you need to help with this.

Cheers,
Tobias

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


Re: [lazarus] Carbon Widgetset: character spacing problems

2007-11-03 Thread Tobias Giesen
> I'm porting a large custom control that had character positioning 
> problems on Carbon (other widgetsets were fine) until Tomas fixed
> BeginTextRender.

You mean, until he broke BeginTextRender. The general functionality
of BeginTextRender was broken in favor of one or two custom controls.
This needs to be re-done properly.

Kind Regards,
Tobias Giesen

Super Flexible Software Ltd. & Co. KG
Lessingstr. 42
48485 Neuenkirchen, Germany
www.superflexible.com
www.tgtools.com

---
Registered at register court Steinfurt as HRA 5061
Liability / general partner: TGTools Ltd.
Company No. 05513299
Registered in England and Wales
Directors: Tobias Giesen and Claudia Hübl

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


Re: [lazarus] Carbon Widgetset: character spacing problems

2007-11-03 Thread Tobias Giesen
Hi Phil,

my test program is just a label and a button. I have not made ANY
font specifications. The button shows the text correctly, while the
label does not. You just need to type text long enough so that you
see it.

There must be some way for a control to specify if it needs to have
the Fractional Positioning disabled or not. Maybe the font properties
could specify if it is a fixed width font or a proportional font?

I have recompiled the LCL with my patch, and at least TEdit continues
to work normally. In a normal app with normal controls, fractional
positioning seems to be badly needed.

Kind Regards,
Tobias Giesen

Super Flexible Software Ltd. & Co. KG
Lessingstr. 42
48485 Neuenkirchen, Germany
www.superflexible.com
www.tgtools.com

---
Registered at register court Steinfurt as HRA 5061
Liability / general partner: TGTools Ltd.
Company No. 05513299
Registered in England and Wales
Directors: Tobias Giesen and Claudia Hübl

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


Re: [lazarus] Carbon Widgetset: character spacing problems

2007-11-03 Thread Tobias Giesen
> > > SynEdit needs disabled fractional positions. It sets DX<>nil.
> Have you tried
> if DX<>nil then

Hello,

thanks, that works for me! I am attaching a proposed patch.

Kind Regards,
Tobias Giesen
www.superflexible.com
www.tgtools.com



carboncanvas-tg-2007-11-03.patch
Description: Binary data


Re: [lazarus] Carbon Widgetset: character spacing problems

2007-11-03 Thread Tobias Giesen
> SynEdit needs disabled fractional positions. It sets DX<>nil.

So, can you add some kind of condition so that they are only disabled
when necessary? The collateral damage seems to be considerable.

Kind Regards,
Tobias Giesen
www.superflexible.com


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


Re: [lazarus] Carbon Widgetset: character spacing problems

2007-11-03 Thread Tobias Giesen
> Fix TCarbonDeviceContext.ExtTextOut. The image looks as if it draws a
> proportional font monospaced.

OK the problem is caused by TCarbonDeviceContext.BeginTextRender. In 
my opinion, the lines following the comment

// disable fractional positions

up to the next comment should be removed. I don't know what the 
original intention was. My app uses various different controls and
they all look nicer without these lines.

Opinions?

Cheers,
Tobias


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


[lazarus] Carbon Widgetset: character spacing problems

2007-11-03 Thread Tobias Giesen
Hello,

I am trying to figure out how to get the best font for dialog items. The
best I can get is shown on the following screenshot:
http://www.superflexible.com/characterspacing.png

The text in the button is fine, this seems to be the default Mac OS
look. I want to use the same font for the TLabel too. But it looks
different and there are spacing problems: between many characters, 
there is a strange extra space (for example, between i and s in the
first word).

I am using the latest Lazarus SVN. What needs to be done to make this
look nicer?

Cheers,
Tobias


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


Re: [lazarus] Missing symbols in Mac OS 10.3

2007-10-29 Thread Tobias Giesen
Hi,

oh dear, after fixing the first unresolved symbols, OS 10.3 reveals
a lot more. I suppose we can forget 10.3 for the Carbon widgetset?

Cheers,
Tobias



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


[lazarus] Missing symbols in Mac OS 10.3

2007-10-29 Thread Tobias Giesen
Hello,

I just succeeded in my first cross-compiling and I am now trying my app
on a G3 Mac. The Carbon widgetset is used. The following symbols are
not available on 10.3:

kUTType*  (used by CarbonClipboard)

kCGColorSpaceGenericRGB  (used by CarbonProc)
kCGColorSpaceGenericGray

I'm now trying to make some quick hacks to avoid these symbols, but I
wonder how we will be able to solve this problem officially?

I think 10.3 should be supported. It seems not to be a lot that's
missing.

Cheers,
Tobias


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


Re: [lazarus] Access violations when using Watches while debugging on OS X i386

2007-10-28 Thread Tobias Giesen
> > TDBGWATCH_DOCHANGED, line 2636 of debugger.pp
> 
> Only one line?
> No context?

In the XTerm window, there was only this one line. Would I be able to
see a longer stack trace somewhere else?

Cheers,
Tobias


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


Re: [lazarus] Access violations when using Watches while debugging on OS X i386

2007-10-27 Thread Tobias Giesen
> Can you provide an example and/or backtrace?

It's hard to create on purpose. Here's a stack trace:

TDBGWATCH_DOCHANGED, line 2636 of debugger.pp

I'll try what happens when I disable the FSlave mechanism in this
function ;=)

Cheers,
Tobias

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


[lazarus] Access violations when using Watches while debugging on OS X i386

2007-10-25 Thread Tobias Giesen
Hello,

the Watches window produces an AV in Lazarus after a few times stepping
through the program. Is there a way to fix this on OS X i386?

Thanks.

Cheers,
Tobias

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


Re: [lazarus] Close component?

2007-10-21 Thread Tobias Giesen
Hello,

here's a description of when this happens. This is probably not so
important and it only happens with some pairs of inherited forms,
so I don't know if I can supply a sample project for this issue.

The question "Close component?" is never shown when I am closing a form.

The question pops up when I open a form that is the ancestor class of a
form that is already open.

For example, Form B is a descendant of Form A.

Form B is already open. Now I open Form A, and I am asked if I want
to close Form B. I just close the question dialog and both forms
are then open the way I want it.

If the project desktop is saved with both files open, then the next 
time you start Lazarus, it also asks if you want to close Form A.

Cheers,
Tobias


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


[lazarus] Close component?

2007-10-19 Thread Tobias Giesen
Hello,

I think this is a bug report, but also a question.

When I start Lazarus and it loads my project, the first thing it does
often is ask me the following:

Close component?
Close component FMainForm:TFMainForm?

The bug report is that Lazarus should never ask this question when
loading a project.

The question is: under what circumstances does this dialog box make 
any sense?

Cheers,
Tobias



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


Re: [lazarus] Transparency Problems

2007-10-16 Thread Tobias Giesen
> Image1.Picture.Bitmap.Transparent := True

Fantastic! I am very happy now!

I think I tried this about a month ago but back then it did not help.
Today it works great.

Cheers,
Tobias

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


Re: [lazarus] Transparency Problems

2007-10-16 Thread Tobias Giesen
Hello,

I have put a sample project here:
http://www.tgtools.com/privatemac.zip (4.5MB with compiled app)

But all you really need to do is load the small unit SmallTestMain
into the IDE, so I have put it here separately:
http://www.tgtools.com/TranspTestUnit.zip

It contains a very small image but the missing transparency can be
seen very clearly. If you say that I should use .png files with
alpha channels rather than .bmp files I can probably do that too.

Thanks for looking into it!

Cheers,
Tobias

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


[lazarus] Transparency Problems

2007-10-16 Thread Tobias Giesen
Hello,

I have a question. A few months ago, I could place a TImage on my form
and load a BMP picture with a lot of white pixels as background. These
white pixels would then be handled as transparent if the property
"Transparent" is true.

Since a few months ago, this does not work any more. Is transparency
now restricted to .png files with alpha layers?

I am using lazarus on an i386 Mac. I am compiling for Carbon but the
problem is already visible in the IDE.

I originally submitted this as bug #0009634 but apparently it is not
a Carbon-specific problem.

Cheers,
Tobias



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


Re: [lazarus] New Patch: codetools/directorycacher.pas (fixes finding files)

2007-10-08 Thread Tobias Giesen
> We must use a function that is compatible to the case
> insensitive check of ComparePCharFirstCaseInsThenCase.

Yes, the new function should be identical with one exception, it
should return 0 when the file matches in a case insensitive comparison.

I will send a list of files privately.

Cheers,
Tobias


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


[lazarus] New Patch: codetools/directorycacher.pas (fixes finding files)

2007-10-08 Thread Tobias Giesen
Hello,

I would like to submit the attached patch. This reinstates my original
fix, with some additional comments and applying the fix in another
location in the same source file.

I have still been having heavy problems with files not being found by
CodeTools. THIS FIXES THE PROBLEMS. This is not a shot in the dark.
This is a well thought through and tested patch.

The reason for the failures of the old version is that the binary
searches in this unit were using a different comparison function from
the one that the list of files was originally sorted with.

Sorting a list with one comparison function, then doing a binary
search with a different one, can cause the binary search to fail.

On some systems, there may be fewer problems than on mine because the
two different comparison functions may happen to use the same order of
characters.

On Mac OS X, the binary search failed when filenames with underscores
were used. Some comparison functions sort the underscore _ before the
letters, while other comparison functions sort the underscore after the
letters.

Cheers,
Tobias



DirCache-TG-2007-10-08.patch
Description: Binary data


Re: [lazarus] Patch: codetools/directorycacher.pas (fixes finding files)

2007-10-07 Thread Tobias Giesen
Hello Matthias,

I'm afraid it is not fixed. I had spent hours to verify the validity
of my submission. It really really is the wrong search function. With
this search function, you just don't find some files. The list has
been sorted with a different search function.

Also, the binary search algorithm does not search in any "direction".
It uses two indices, one starting at 0 and the other starting at
FListing.NameCount-1. So the whole list is searched, and if you use
the correct search function, then you will find it without looking
in another direction.

Cheers,
Tobias


Matthias wrote:
> The problem was probably something that the algorithm only searched in
> one direction, not the wrong search function. Can you test, if it is
> fixed?

as a reply to my original submission:

> > I would like to submit the attached patch. I noticed that some of my
> > source files could not be found by the IDE. The reason is that in 
> > TCTDirectoryCache.FindUnitSource, the binary search uses a different
> > comparison function from the one that FListing was originally sorted
> > with.
> > 
> > Sorting a list with one comparison function, then doing a binary
> > search with a different one, can cause the binary search to fail.
> > 
> > On Mac OS X, the binary search failed when filenames with underscores
> > were used. Some comparison functions sort the underscore _ before the
> > letters, while other comparison functions sort the underscore after
> > the letters.

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


Re: [lazarus] TRegistry crash on Mac OS X

2007-10-07 Thread Tobias Giesen
Hello,

there are one or two bugs in xmlreg.pp that can cause crashes.

I am talking about the xmlreg.pp in fpcsrc\packages\fcl-registry\src.

Around line 355, it is not verified whether Node.FirstChild is nil.

Around line 720, the function does not return any value.

I have copied the file into my project directory and made some fixes.
Luckily, the fpc compiler now uses my version rather than the default
version.

I don't know how to submit the fixes so I've put the updated file here:
http://www.superflexible.com/xmlreg.pp

Cheers,
Tobias Giesen


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


[lazarus] Patch: codetools/directorycacher.pas (fixes finding files)

2007-09-27 Thread Tobias Giesen
Hello,

I would like to submit the attached patch. I noticed that some of my
source files could not be found by the IDE. The reason is that in 
TCTDirectoryCache.FindUnitSource, the binary search uses a different
comparison function from the one that FListing was originally sorted
with.

Sorting a list with one comparison function, then doing a binary
search with a different one, can cause the binary search to fail.

On Mac OS X, the binary search failed when filenames with underscores
were used. Some comparison functions sort the underscore _ before the
letters, while other comparison functions sort the underscore after the
letters.

Cheers,
Tobias



DirCache-TG-2007-09-28.patch
Description: Binary data


Re: [lazarus] When does the main form show?

2007-09-21 Thread Tobias Giesen
> I am processing a number of routines in the FormActivate event

I think it would be much better if you put a TTimer component on your
form and put only Timer1.Enabled:=true into your FormActivate or
FormShow event. Don't do lengthy processing in those events.

Inside the timer execute event (such as Timer1Timer), you would do
Timer1.Enabled:=false and then you would process your routines which
may take minutes while the form is already shown. You should also
disable any dialog elements in the form while your routines are 
running and call Application.ProcessMessages as often as you can so
that the form can be moved across the screen, minimized and so forth.

Kind Regards,
Tobias Giesen

---
www.superflexible.com




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


Re: [lazarus] Crash when running compiled Carbon app as different user on i386 Mac

2007-09-15 Thread Tobias Giesen
Hello,

I am using the latest snapshot installers with FPC 2.2.1. I think the
cause for the crash is in the LCL and most likely the Carbon widgetset,
since unit forms.pp is mentioned in the call stack.

I will put some checkpoints in the program and see where that takes me!

Cheers,
Tobias


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


[lazarus] Crash when running compiled Carbon app as different user on i386 Mac

2007-09-15 Thread Tobias Giesen
Hello,

my app has been running fine lately, so I thought I'd try to log on to
Mac OS X as a different user and run the compiled application. As it
turns out, it crashes before reaching the main program. The crash only
occurs when I launch it by double-clicking the application bundle.

When I start just the binary, a terminal window opens and it shows its
Main Form just fine, but I can't focus it.

Here's a the fist part of the crash log. At the point where I cut it,
the last two lines are repeated a few hundred times more.

Any ideas? 

Thanks.
Tobias

--

Host Name:  iMac
Date/Time:  2007-09-15 14:42:54.504 +0200
OS Version: 10.4.10 (Build 8R2218)
Report Version: 4

Command: MyMacApp
Path:/borland/exec/MyMacApp.app/Contents/MacOS/MyMacApp
Parent:  WindowServer [921]

Version: ??? (1.0)

PID:953
Thread: 0

Exception:  EXC_BAD_ACCESS (0x0001)
Codes:  KERN_INVALID_ADDRESS (0x0001) at 0xbf78

Thread 0 Crashed:
0   MyMacApp0x00012983 SYSTEM_SYSGETMEM_FIXED$LONGINT$$POINTER + 3
1   MyMacApp0xccb2 SYSTEM_TOBJECT_$__NEWINSTANCE$$TOBJECT + 18
2   MyMacApp0x000da15e SYSUTILS_RUNERRORTOEXCEPT$LONGINT$POINTER$POINTER + 
862
3   MyMacApp0x00010e07 FPC_BREAK_ERROR + 39
4   MyMacApp0x000f7c20 LCLPROC_DEBUGLN$ANSISTRING + 112 (LCLProc.pas:1370)
5   MyMacApp0x00034cf9 
FORMS_EXCEPTIONOCCURRED$TOBJECT$POINTER$LONGINT$PPOINTER + 73 (Forms.pp:1379)
6   MyMacApp0xdbba SYSTEM_DOUNHANDLEDEXCEPTION + 74
7   MyMacApp0xded9 FPC_RERAISE + 41
8   MyMacApp0xdbba SYSTEM_DOUNHANDLEDEXCEPTION + 74
9   MyMacApp0xded9 FPC_RERAISE + 41
10  MyMacApp0xdbba SYSTEM_DOUNHANDLEDEXCEPTION + 74
11  MyMacApp0xded9 FPC_RERAISE + 41
12  MyMacApp0xdbba SYSTEM_DOUNHANDLEDEXCEPTION + 74
13  MyMacApp0xded9 FPC_RERAISE + 41
14  MyMacApp0xdbba SYSTEM_DOUNHANDLEDEXCEPTION + 74
15  MyMacApp0xded9 FPC_RERAISE + 41
16  MyMacApp0xdbba SYSTEM_DOUNHANDLEDEXCEPTION + 74
17  MyMacApp0xded9 FPC_RERAISE + 41
18  MyMacApp0xdbba SYSTEM_DOUNHANDLEDEXCEPTION + 74

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


Re: [lazarus] Possible Carbon Widgetset Change in carbonproc.pp

2007-09-08 Thread Tobias Giesen
Hello,

yes it works, slightly corrected like this:

  if CGRectIsNull(ARect)<>0 then
  begin
 WriteLn(StdErr,'CGRectToRect is null, returning a zero TRect.');
 Result.Left := 0;
 Result.Top := 0;
 Result.Right := 0;
 Result.Bottom := 0;
 Exit;
  end;

Cheers,
Tobias

> Can you please test this code:
> [...]
>   if CGRectIsNull(ARect) then
> [...]
> I searched the apple docs through, but can't find anything others concerning 
> this issue. If this won't work, we can use your solution.
> 
> Tom

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


[lazarus] Possible Carbon Widgetset Change in carbonproc.pp

2007-09-08 Thread Tobias Giesen
Hello,

I had problems with arithmetic exceptions in the following routine.
I was not able to find the root of the problem, so I added this
quick safety check. This makes my application work stable. Should I
submit this as a patch?

The problem is that ARect.origin.x sometimes is +Inf or other invalid
numbers.

function CGRectToRect(const ARect: CGRect): TRect;
begin
  if (ARect.origin.x<-1e10) or
 (ARect.origin.x>1e10) then begin
 WriteLn(StdErr,'CGRectToRect: ARect.origin.x is suspicious, returning a 
zero TRect.');
 Result.Left := 0;
 Result.Top := 0;
 Result.Right := 0;
 Result.Bottom := 0;
 Exit;
 end;
  Result.Left := Floor(ARect.origin.x);
  Result.Top := Floor(ARect.origin.y);
  Result.Right := Ceil(ARect.origin.x + ARect.size.width);
  Result.Bottom := Ceil(ARect.origin.y + ARect.size.height);
end;

Cheers,
Tobias

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


Re: [lazarus] Open file dialog blank after last update

2007-09-08 Thread Tobias Giesen
> if Length(AText) >= S then .

Which line in masks.pas would this be? I would like to make the change
here manually, as it's not in the daily snapshot yet. It probably will
be tomorrow, right?

Thanks!

Kind Regards,
Tobias Giesen

Super Flexible Software Ltd. & Co. KG
Lessingstr. 42
48485 Neuenkirchen, Germany
www.superflexible.com
www.tgtools.com

---
Registered at register court Steinfurt as HRA 5061
Liability / general partner: TGTools Ltd.
Company No. 05513299
Registered in England and Wales
Directors: Tobias Giesen and Claudia Hübl

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


Re: [lazarus] TImage Transparency broken on Macintosh OS X

2007-09-07 Thread Tobias Giesen
Hi Tom,

sorry - the Carbon widget is affected. 

Cheers,
Tobias


> Can you please post which widget (carbon or gtk1) is affected?
> 
> Tom

> >I have updated my lazarus using the latest snapshot installer. Now the
> >Transparent property in a TImage does not seem to work any more. I have
> >images with a lot of white pixels, including all four corners. These
> >should be transparent. The previous build where this worked was from
> >August 17. Now I have the snapshot from September 7.
> >
> >Is it possible to fix this?

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


[lazarus] TImage Transparency broken on Macintosh OS X

2007-09-07 Thread Tobias Giesen
Hello,

I have updated my lazarus using the latest snapshot installer. Now the
Transparent property in a TImage does not seem to work any more. I have
images with a lot of white pixels, including all four corners. These
should be transparent. The previous build where this worked was from
August 17. Now I have the snapshot from September 7.

Is it possible to fix this?

Cheers,
Tobias


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


Re: [lazarus] Source files not found although they are there

2007-08-22 Thread Tobias Giesen
Hello,

apparently adding the unit to the main program did not fix the issue.
I will analyze this more and try to make a demo project to produce the
problem.

Kind Regards,
Tobias Giesen

Super Flexible Software Ltd. & Co. KG
Lessingstr. 42
48485 Neuenkirchen, Germany
www.superflexible.com
www.tgtools.com

---
Registered at register court Steinfurt as HRA 5061
Liability / general partner: TGTools Ltd.
Company No. 05513299
Registered in England and Wales
Directors: Tobias Giesen and Claudia Hübl

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


Re: [lazarus] Source files not found although they are there

2007-08-22 Thread Tobias Giesen
Hello,

many thanks for your replies! I have found some interesting things
that you pointed me too.

However I think the cause is the relative search paths being sent to
the compiler. The file that is not found is in the path ../units, and
it was used by another file in ../units. The first file is found, but
then another file in the same folder is not found.

The error does not occur if the compiler encounters the file before
it is used by a unit that's not in the main folder. For example, I 
have now added the unit to the top of the main program's uses clause
and that has fixed the problem.

If we could choose absolute paths to be passed to the compiler, that
would be great!

Cheers,
Tobias


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


[lazarus] Source files not found although they are there

2007-08-21 Thread Tobias Giesen
Hello,

I am using a recent Lazarus build on my Intel iMac. I have the problem
that some of my source units aren't found when the program is recompiled
using F9 or Ctrl-F9. I always have to do a "Build All". That works.
These units are of course in the search path for the application.

Does anybody have an idea?

Cheers,
Tobias



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


[lazarus] GDB version on Mac OS X

2007-08-04 Thread Tobias Giesen
Hello,

the post about the GDB version made me think; Apple includes version
6.3.50 with XCode 2.4. I am just downloading the XCode 2.4.1 update
but I doubt that it contains a much newer version of GDB.

Is it possible to install a newer GDB version on an Intel Mac? If so,
where would I get a precompiled version?

Cheers,
Tobias


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


[lazarus] Debugging on CPU level (Intel MacOS X)

2007-08-03 Thread Tobias Giesen
Hello,

I have a crash, caused by either CPU registers with invalid values or
the stack having been overwritten. I think I need to debug this on CPU
level on an Intel MacOS X computer. Is there a way to do it, possibly
with an external debugger rather than using the Lazarus GUI?

Thanks for any tips!

Kind Regards,
Tobias Giesen

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


Re: [lazarus] Component or library for HTTP and/or WebDAV protocol on Mac OS X

2007-07-23 Thread Tobias Giesen
Michael wrote:
> There is code for HTTP (synapse, Indy, ICS, lnet).
> I have code for Webdav, which I plucked from internet somewhere, and which
> I corrected and enhanced.

Hi Michael,

thanks for the quick reply! Are you using WebDAV on Windows?

Do you think any of (synapse, Indy, ICS, lnet) might be suited best 
for a Mac OS X port? I also need https ...

Cheers,
Tobias


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


[lazarus] Component or library for HTTP and/or WebDAV protocol on Mac OS X

2007-07-23 Thread Tobias Giesen
Hello,

I am looking for a component or library which will eventually enable me
to access a WebDAV server from my client application, which I am making
with Lazarus. Is there a recommended component or library for HTTP, or
even WebDAV?

I am ready to invest a lot of time into this, so if I have to create
something new or port a library that currently works on Windows or Linux,
how should I proceed? Is there a library that I should port over to 
Macintosh? Probably not Indy 10? Should I try to use the Carbon API or 
Unix sockets?

Any advice or opinions are very welcome.

Cheers,
Tobias


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


Re: [lazarus] Unicode support and fonts

2007-07-20 Thread Tobias Giesen
> The standard MS Sans Serif supports only western latin glyphs.

MS Sans Serif is not the standard font on Windows. Many years ago, 
Tahoma was introduced as the new standard font to use for dialogs.
It is a TrueType with support for very many languages. Since it
includes languages like Arabic, Hebrew and a few Indian languages, 
I am pretty sure that Russian and Polish is included too.

Kind Regards,
Tobias Giesen

Super Flexible Software Ltd. & Co. KG
Lessingstr. 42
48485 Neuenkirchen, Germany
www.superflexible.com
www.tgtools.com

---
Registered at register court Steinfurt as HRA 5061
Liability / general partner: TGTools Ltd.
Company No. 05513299
Registered in England and Wales
Directors: Tobias Giesen and Claudia Hübl

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


Re: [lazarus] PATCH: definition of HKEY in regdef.inc

2007-07-18 Thread Tobias Giesen
> > in regdef.inc
> What is the location of this file?

/usr/local/share/fpcsrc/fcl/inc

> > Cardinal on i386 Mac
> Are you using Windows througth Boot Camp or something similar?

No, I am using the native MacOS X i386 lazarus version. I need to use
some Windows structs inside of my app, even if most of the API does 
not exist. Some parts of the Windows API are emulated.

In any case DWORD is the type to use in any Windows API context.
Not Cardinal.

Kind Regards,
Tobias Giesen

Super Flexible Software Ltd. & Co. KG
Lessingstr. 42
48485 Neuenkirchen, Germany
www.superflexible.com
www.tgtools.com

---
Registered at register court Steinfurt as HRA 5061
Liability / general partner: TGTools Ltd.
Company No. 05513299
Registered in England and Wales
Directors: Tobias Giesen and Claudia Hübl

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


Re: [lazarus] PATCH: definition of HKEY in regdef.inc

2007-07-18 Thread Tobias Giesen
> > Cardinal on i386 Mac apparently cannot handle values like
> > HKEY_CURRENT_USER which is $8001.
> > 
> 
> I don't understand. Cardinal and DWORD are both 32 bits 
> unsigned integers.

I don't understand either, but the facts are that DWORD is always 
the standard type to use in a Windows API context, and that 
assigning a DWORD value such as the above mentioned to a Cardinal
variable produces a range check error. There is probably some
compiler bug there, but in this case we should use consistent
types anyway, which means always DWORD, never Cardinal, when you
are working with or simulating a Windows API.

DWORD is defined as LongWord, so it is a different compiler type.

Kind Regards,
Tobias Giesen

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


[lazarus] PATCH: definition of HKEY in regdef.inc

2007-07-18 Thread Tobias Giesen
Hello,

in regdef.inc, HKEY is defined as Cardinal. However, this causes 
range check errors on Mac i386. I had to change it to DWORD. Maybe
you would like to adopt this change (regdef.inc line 62).

Cardinal on i386 Mac apparently cannot handle values like
HKEY_CURRENT_USER which is $8001.

Thanks!

Tobias Giesen
www.superflexible.com



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


[lazarus] Debugging a Range Check Error on Mac OS X

2007-05-11 Thread Tobias Giesen
Hello,

I am using one very simple form which I converted from a .dfm file 
using lazres. It shows fine, but when I click on a button whose 
ModalResult should close the form, I get a Range Check Error.

How can I debug this? The Range Check Error dialog only asks me if
I want to risk continuing the program, but it does not indicate
where to look for the error.

The debugger does not catch the exception either. The checkbox
"Stop on Lazarus Exceptions" does not stick, it is deselected
each time I go into the Debugger Options window.

I am currently using the 20070509 snapshots for Mac OS X, because
the latest ones crash a lot. Still I think the debugger does not
work, I cannot make breakpoints work or anything.

Any help would be greatly appreciated!

Kind Regards,
Tobias Giesen

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