Re: [lazarus] DropFiles Implementation

2008-01-30 Thread Tom Gregorovic
On Jan 29, 2008 8:25 PM, Felipe Monteiro de Carvalho
[EMAIL PROTECTED] wrote:
 Did OnDropFiles make it to 0.9.24? If so, any radical change can
 potentially cause a lot of headache for people already using it.

 On Jan 29, 2008 3:46 PM, Tom Gregorovic [EMAIL PROTECTED] wrote:
  - there must be some property to enable accepting files, like does
  AllowDropFiles now

 Maybe it could be simply defined as OnDropFiles  nil so no new
 property is needed. We can hook when OnDropFiles is set and call an
 widgetset function to warn the widgetset it is being (de)activeated.
 Do you think this would work on windows?


Then there will be problem, how to track this feature inside some
custom controls. Assigning to a published event is not a clear
solution. Maybe instead of property there can be some protected
function like SetAllowDropFiles for these cases.

But I think the others want to handle it via OnDragDrop and then you
need some enable flag.

Tom

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


Re: [lazarus] DropFiles Implementation

2008-01-29 Thread Tom Gregorovic
On Jan 28, 2008 10:35 PM, Felipe Monteiro de Carvalho
[EMAIL PROTECTED] wrote:
 bump.

 I think this is a relevant discussion which needs an answer from Tom
 to progress.


Well, we can extend the recent drop files functionality to every
TWinControl and change its handling to OnDragDrop, as someone has
suggested. We can use some TDragObject descendant, which will hold the
list of filenames.
There are some things which must be taken into account on various platforms:
Windows
- there must be some property to enable accepting files, like does
AllowDropFiles now
- for functional OnDragOver you have to use OLE (IDropTarget)
Carbon
- there some function to track dropped files on Application level,
which is suitable also for other platforms

We must also take into account that there can be implemented general
drag and drop between App and OS in future.
Personally, I have no taste to improve it - especially the gtk part.

Tom

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


Re: [lazarus] Okay, well I am willing to contribute something to Lazarus. Who should I talk to?

2008-01-29 Thread Tom Gregorovic
On Jan 29, 2008 3:16 PM, Warren Postma [EMAIL PROTECTED] wrote:
 There is something I'd like to see that I'm willing to work with other
 people, and contribute my time to.

 What I'm interested in is a 100% native carbon, 0% gtk/x-windows
 Lazarus for Mac OS X.

 Is there a Mac-OS-Lazarus mailing list? I'll join it.  I've gotten the
 GTK version of Lazarus built from latest repository sources, and it
 runs, so I'm willing to build and/or debug/fix the missing or broken
 bits of Carbon-LCL framework that are needed to get a native-Carbon-LCL
 finished to the point that you can build Lazarus using it.


Hi,
I am the person which has developed the biggest part of Carbon-LCL
framework. Every contribution is welcomed.
There is no special mailing list concerning Carbon - you can use this
one or you can write directly to me.

You can find some notes in wiki:
http://wiki.lazarus.freepascal.org/Carbon_interface_internals.
You can build IDE for Carbon
(http://wiki.lazarus.freepascal.org/Carbon_interface_FAQ#How_can_I_rebuild_LCL_or_Lazarus_IDE_for_Carbon_interface_via_terminal.3F)
and search for bugs and fix them if you can.
You can also look at reported bugs
(http://www.freepascal.org/mantis/view_all_set.php?type=3source_query_id=1018)
and try to fix them and send patches.


Regards,
   Tom

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


Re: [lazarus] 0.9.24 beta on Win32 : create an app and put a TButton on it, and compile and run it, and get runtime exceptions.

2008-01-29 Thread Tom Gregorovic
On Jan 29, 2008 4:08 PM, Warren Postma [EMAIL PROTECTED] wrote:
 Using the prebuilt binary installer (latest download on sourceforge) on
 Win32, just added a TButton, and double clicked it, wrote
 a simple for t := 0 to 10 loop and then tried to build and run this
 minimal lazarus app.

 Any idea why, creating a minimal app, and trying to run it causes me
 these error message boxes:

 Project raised exception class 'EClassNotFound'.
 [OK]

 The file reader.inc was not found.
 Do you want to locate it yourself
[Yes] [No]


 Warren


Maybe the form code was wrongly auto generated, it should look like this:

TForm1 = class(TForm)
  Button1: TButton;
  private
{ private declarations }
  public
{ public declarations }
  end;

If the Button1 field is missing or in different section (private,
public) it raises this exception.

Tom

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


Re: [lazarus] make, MacOSX

2008-01-23 Thread Tom Gregorovic
On Jan 23, 2008 9:26 PM, Albert Zeyer [EMAIL PROTECTED] wrote:
 Hi,

 Is there any documentation about the parameters I can pass to the
 Makefile?

 I am mainly trying to compile Lazarus directly on my system without
 using Lazarus for the compilation.

 I have added an entry in the wiki:
 http://wiki.lazarus.freepascal.org/Carbon_Interface#Compiling_the_Carbon_interface_via_Makefile

 I am currently using this command:
 make LCL_PLATFORM=carbon FPC=fpc -k-framework -kcarbon

 It takes some time until I found out that LCL_PLATFORM is the option
 to set the interface. And I also didn't find any method to pass
 parameters to fpc or the linker, but it seems that FPC=fpc PARAMS
 did the trick.

 Though I get a lot of these:
 ...
 ld: atom sorting error for DEBUGEND_SYNEDITTYPES and
 DEBUGSTART_SYNEDITTYPES in /Users/az/Programmierung/lazarus/components/
 synedit/units/powerpc-darwin/synedittypes.o
 ld: atom sorting error for DEBUGEND_SYNEDITTYPES and
 DEBUGSTART_SYNEDITTYPES in /Users/az/Programmierung/lazarus/components/
 synedit/units/powerpc-darwin/synedittypes.o
 unknown stabs type 0xC0 in /Users/az/Programmierung/lazarus/components/
 synedit/units/powerpc-darwin/synedittextbuffer.o
 unknown stabs type 0xE0 in /Users/az/Programmierung/lazarus/components/
 synedit/units/powerpc-darwin/synedittextbuffer.o
 unknown stabs type 0xC0 in /Users/az/Programmierung/lazarus/components/
 synedit/units/powerpc-darwin/syntextdrawer.o
 unknown stabs type 0xE0 in /Users/az/Programmierung/lazarus/components/
 synedit/units/powerpc-darwin/syntextdrawer.o
 unknown stabs type 0xC0 in /Users/az/Programmierung/lazarus/components/
 synedit/units/powerpc-darwin/synregexpr.o
 unknown stabs type 0xE0 in /Users/az/Programmierung/lazarus/components/
 synedit/units/powerpc-darwin/synregexpr.o
 unknown stabs type 0xC0 in /Users/az/Programmierung/lazarus/components/
 synedit/units/powerpc-darwin/synexporthtml.o
 unknown stabs type 0xE0 in /Users/az/Programmierung/lazarus/components/
 synedit/units/powerpc-darwin/synexporthtml.o
 unknown stabs type 0xC0 in /Users/az/Programmierung/lazarus/components/
 synedit/units/powerpc-darwin/synhighlightermulti.o
 unknown stabs type 0xE0 in /Users/az/Programmierung/lazarus/components/
 synedit/units/powerpc-darwin/synhighlightermulti.o
 987 lines compiled, 5.10 sec
 albert-zeyers-macbook:lazarus az$

 I am using FPC 2.2.0 (installed via the provided DMG from SF) and
 Lazarus from SVN, revision 13844.

 Though, Lazarus is starting after this:

 albert-zeyers-macbook:lazarus az$ ./startlazarus
 dyld: shared cached file is corrupt: /var/db/dyld/dyld_shared_cache_ppc
 TCarbonWidget.Create TCarbonWindow SplashForm: TSplashForm
 TCarbonWindow.RegisterEvents TCarbonWindow SplashForm: TSplashForm
 CarbonCommon_BoundsChanged SplashForm:TSplashForm
 TCarbonWindow.SetScrollInfo TODO
 TCarbonWindow.SetScrollInfo TODO
 TLazarusManager.Run starting /Users/az/Programmierung/lazarus/
 lazarus ...
 dyld: shared cached file is corrupt: /var/db/dyld/dyld_shared_cache_ppc
 TApplication.IconChanged - TODO: convert this message...no
 implementation in gtk or win32
 Note: environment config file not found - using defaults
 TCarbonWidget.Destroy TCarbonWindow SplashForm: TSplashForm

 Then, a window pops up (a native Carbon window) which says that it
 doesn't find the FPC sources. There is an Ignore-Button on this window
 but I cannot click on it. I even cannot focus the window neither move
 it or do anything with it. The only thing I can do is pressing Ctrl+C
 in the console to break it.

 Any ideas? Any hints?


Hi,
you have to run Lazarus via Application Bundle (lazarus.app in lazarus
directory). This is also mentioned in
http://wiki.lazarus.freepascal.org/Carbon_interface_FAQ#When_I_execute_application_compiled_for_Carbon_interface.2C_it_can.27t_be_focused.


Tom

_
 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-22 Thread Tom Gregorovic
On Jan 11, 2008 10:09 AM, Dominique Louis
[EMAIL PROTECTED] wrote:
 Hi Paul,
Does this mean that TBitBtn under Mac OS X does not support
 transparency for Bitmaps only via PNGs?

 I just searched through the code and the Mac OS X Function
 TButtonGlyph.Draw() in buttonglyph.inc is a bit sparse and there is no
 code there makes use of the passed in Transparency. I also noticed in
 TCustomBitBtn.ActionChange/CopyImage it has a // TODO : Transparency
 comment.

 So I'm guessing it's not done yet.


It used to work, but after bitmap rewrite (which moved transparency in
TBitmap to mask) it was broken. I hope, I have fixed it in latest SVN.

Tom

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


Re: [lazarus] text boxes in svn 13258

2007-12-11 Thread Tom Gregorovic
On Dec 10, 2007 7:16 PM, Matthew Rollings
[EMAIL PROTECTED] wrote:
 I just changed from 13063 to 13258, and all of the textboxes in my projects
 now have borders round them and are no longer transparent. Is there a new
 property that i need to change?


Hi,
can you please specify OS and widget set of your Lazarus. It would be
helpful to post also some screen shot.

Tom

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


Re: [lazarus] latest svn doesn't compile

2007-12-08 Thread Tom Gregorovic
On Dec 8, 2007 7:49 PM, Giuliano Colla [EMAIL PROTECTED] wrote:
 Latest svn doesn't compile under fpc 2.2.0. Identifier not found
 AllFilesMask, in lcl/include/fileutil.inc
 Replacing AllFilesMask with GetAllFilesMask compiles properly.
 Giuliano

Sorry, my fault.

Thanks.

Tom

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


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

2007-12-05 Thread Tom Gregorovic
On Dec 5, 2007 8:38 PM, Tobias Giesen [EMAIL PROTECTED] wrote:
 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)

Hi,
sorry, but I was able to check and commit your patch as late as today.
Thanks, these deep hidden bugs are allways a hard nut.

Tom

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


Re: [lazarus] Carbon TMemo with invisible font

2007-12-02 Thread Tom Gregorovic
On Nov 18, 2007 8:00 PM, James Chandler Jr [EMAIL PROTECTED] wrote:
 Hi Tom

 You do great work!

 Here is a symptom which might be related (or not). Am only mentioning it 
 because
 this also had an invisible font issue. Am busy in Win32 right now, and will
 trace the issue further (if it still exists) when I can get back to carbon in 
 a
 few weeks.

 I had four TPaintBoxes in a TPanel, which are graphic views for an audio wave
 display, a location timestrip, a chord strip, and a piano-roll note strip.

 Not all paintboxes are erased to the same background color at the start of 
 their
 OnPaint procs. The drawing in all paintboxes is a mixture of lines, 
 rectangles,
 and text, of various colors. Some Text drawing used transparent mode, and some
 did not.

 This multiple TPaintBox in a TPanel would draw correctly in Win32.

 On Carbon, it appeared that PaintBox canvas properties were somehow 'leaking'
 into the parent TPanel canvas, and affecting other TPaintBox OnPaints. The
 symptom was that some text would draw with the canvas background color (of 
 some
 other paintbox) rather than the current paintbox Font color. This happened 
 even
 if I would explicitly set TFont properties before each and every TextOut, in
 each OnPaint proc.

 If the background of all the TPaintBoxes had been the same, it would have been
 completely invisible text. But since the background of the most problematic
 paintbox was clButtonFace, and some other TPaintBoxes had a clWhite 
 background,
 I was getting white-on-gray text, rather than the desired black-on-gray text.

 It may have had something to do with the transparent property leaking between
 canvases. Dunno.

 I 'fixed' it on the carbon target, by calling Application.processmessages
 between each of the TCanvas OnPaint procedures. I think this was flushing the
 screen after each OnPaint and avoiding transparency or some other property 
 from
 'leaking' between canvases. But the gratuitous calling of ProcessMessages 
 slows
 donw the screen update, so it is just a temporary hack.

 When I can get back to carbon, will send a bug report with example, if the 
 issue
 remains.

 Tobias' reported issue seemed similar, I just thought this example might be
 related.

 

 Here is another 'invisible text' issue--

 The default size of Win32 TLabel seems vertically smaller by a pixel or two,
 than the text rectangle which Carbon likes to draw into. If the TLabel has a
 default background color and font color, it draws the TLabel correctly in 
 spite
 of the size discrepancy. In that mode, apparently a TLabel is able to 
 'overdraw'
 the control bounds and successfully put un-clipped text onscreen.

 But for instance if the TLabel Color is black, and the TLabel Font color is
 green (any non-default color combination would probably show the same bug), 
 then
 all you get is a black square with no text, if the TLabel is not tall enough 
 to
 fully contain the text.

 The fix for that issue was to make the TLabel a few pixels taller than the
 default size for Win32, and then it draws green on black just fine.

 That is a minor issue. It may be that carbon refuses to draw any text at all 
 in
 certain modes, if the destination rectangle isn't tall enough.

 So there may not be a realistic fix. Perhaps if a fix was attempted, it would
 involve automatically growing the TLabel (or shrinking the TFont) if the Label
 is too small to contain the text.

 It is just that such minor issues take time to diagnose/fix, and makes the 
 thing
 a little less 'cross platform'. But since carbon likes to draw controls more
 'spread out' than Win32, it might be that manual form re-spacing is 
 unavoidable
 labor when moving code from Win32 to carbon. The minor labor of re-spacing a
 form is so much less than 'writing from scratch' when moving between 
 platforms.

 jcjr


Hi,
sorry that I have found some time for this issue so late.
I have tested it with latest SVN and I was unable to reproduce those
problems you have reported.
Please retest them and if they persist report them into bug tracker,
optimally upload sample application and screenshots. Don't forget to
add OS version.

Thanks,
Tom

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


Re: [lazarus] OSX : Copy and Paste bug..

2007-12-01 Thread Tom Gregorovic
On Nov 30, 2007 10:20 AM, Dominique Louis
[EMAIL PROTECTED] wrote:
 If you copy and paste some text with an @ sign in it, for example
 passing the address of something, when you paste that code somewhere
 else the @ sign is changed into a .

 Not a big bug, but an annoying one nevertheless.


When you want to ask or report something concerning Lazarus on Mac OS
X, please specify which widget set (gtk, gtk2, Qt, Carbon) do you use.

Tom

_
 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 Tom Gregorovic
On Nov 26, 2007 6:19 PM, Damien Gerard [EMAIL PROTECTED] wrote:

 On Nov 26, 2007, at 1:16 PM, Damien Gerard wrote:

 
  On Nov 26, 2007, at 12:47 PM, Vincent Snijders wrote:
 
  Damien Gerard schreef:
  On Nov 26, 2007, at 10:29 AM, Marc Weustink wrote:
  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 ?
 
  It is the new new project when you first launch Lazarus. The same
  with Project/ New
 
  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)
  Consequently, if you just install fpc-src, fpc then lazarus you
  can not compile a default new project (in my case).
 
  I think there is some fpc - lazarus version conflict.
 
  Did you install both a new fpc and a new lazarus snapshot?
  Is the compiler in the environment options the new fpc compiler?
  Does the used fpc.cfg file point to the newly installed fpc unit
  directory?
 
 
  It comes from a clean install since I recently reinstall my OS X
  with Leopard.
  But there is may be a conflict somewhere.
 
  With my friend locate I will try remove all files and try another
  shoot :)
 
  Vincent
 


 I compltely remove all files associated to fpc/fpcsrc/lazarus and the
 error is a bit different.

 The launching application Bundle /tmp/project1.app does not exists
 or it is not executable.
 The target is GTK :)
 But it works


You have to uncheck  Use Application Bundle for running and debugging
in Project Options.

Tom

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


Re: [lazarus] IDE Crashes on Mac OS (gtk)

2007-11-20 Thread Tom Gregorovic
On Nov 19, 2007 3:22 PM, Damien Gerard [EMAIL PROTECTED] wrote:

 
 
  I use the last snapshot for OS X i386 and followed 
  http://wiki.lazarus.freepascal.org/Carbon_Interface
 
  I've got this :
 
  [...]
  unknown stabs type 0xC0 in /usr/local/share/lazarus/lcl/units/i386-
  darwin/carbon/carbonthemes.o
  unknown stabs type 0xE0 in /usr/local/share/lazarus/lcl/units/i386-
  darwin/carbon/carbonthemes.o
  unknown stabs type 0xC0 in /usr/local/share/lazarus/lcl/units/i386-
  darwin/carbon/carbonclipboard.o
  unknown stabs type 0xE0 in /usr/local/share/lazarus/lcl/units/i386-
  darwin/carbon/carbonclipboard.o
  unknown stabs type 0xC0 in /usr/local/share/lazarus/lcl/units/i386-
  darwin/carbon/carbonclipboard.o
  unknown stabs type 0xE0 in /usr/local/share/lazarus/lcl/units/i386-
  darwin/carbon/carbonclipboard.o
  unknown stabs type 0xC0 in /usr/local/share/lazarus/components/
  codetools/units/i386-darwin/basiccodetools.o
  unknown stabs type 0xE0 in /usr/local/share/lazarus/components/
  codetools/units/i386-darwin/basiccodetools.o
  unknown stabs type 0xC0 in /usr/local/share/lazarus/components/
  codetools/units/i386-darwin/basiccodetools.o
  unknown stabs type 0xE0 in /usr/local/share/lazarus/components/
  codetools/units/i386-darwin/basiccodetools.o
  unknown stabs type 0xC0 in /usr/local/share/lazarus/components/
  codetools/units/i386-darwin/laz_xmlwrite.o
  unknown stabs type 0xE0 in /usr/local/share/lazarus/components/
  codetools/units/i386-darwin/laz_xmlwrite.o
  ld: can't write output file: ../startlazarus
  Error: Error while linking
  TExternalToolList.Run Exception: Error: Error while linking
  TMainIDE.DoBuildLazarus: Build Lazarus without linking failed.
 

 Under Mac OS X 10.5.1


Does building from command line work?
Use: make all LCL_PLATFORM=carbon OPT=-k-framework -kcarbon

Tom

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


[lazarus] Search engine for Lazarus and Free Pascal concerned stuff

2007-11-20 Thread Tom Gregorovic
Hi,
it crossed my mind that it would be convenient to have one search
service for all the information about Lazarus and Free Pascal, which
are in forums, mail list archives, documentation reference, wiki,
Mantis, SVN repository, SVN log, blog ...
One possibility is Google Custom Search Engine
(http://www.google.com/coop/cse/):
* it is free for noncommercial usage, but I think it parses not all resources
The alternative is to use some web search engine running on own server
(e.g. http://www.mnogosearch.org/ ).

Tom

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


Re: [lazarus] About and Help on Carbon Menu Bar

2007-11-19 Thread Tom Gregorovic
On Nov 18, 2007 11:15 PM, Tobias Giesen [EMAIL PROTECTED] wrote:
 Hello,

Hi,

 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?

You have to use Carbon Menu Manager.

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


It is hardcoded in LCL application.inc:

procedure TApplication.NotifyKeyDownHandler(Sender: TObject;
  var Key: Word; Shift: TShiftState);
var
  i: Integer;
begin
  i:=FApplicationHandlers[ahtKeyDownAfter].Count;
  while FApplicationHandlers[ahtKeyDownAfter].NextDownIndex(i) do
TKeyEvent(FApplicationHandlers[ahtKeyDownAfter][i])(Sender,Key,Shift);
  if (Shift=[]) and (Key=VK_F1) then
ShowHelpForObjecct(Sender);
end;

We can adapt this to use platform specific key.

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

Tom

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


Re: [lazarus] IDE Crashes on Mac OS (gtk)

2007-11-19 Thread Tom Gregorovic
On Nov 19, 2007 12:26 AM, Damien Gerard [EMAIL PROTECTED] wrote:

 On Nov 18, 2007, at 11:18 PM, Felipe Monteiro de Carvalho wrote:

  On Nov 18, 2007 10:36 PM, Damien Gerard [EMAIL PROTECTED] wrote:
  In the same time How do you re-build Lazarus with GTK2 ?
 
  http://wiki.lazarus.freepascal.org/GTK2_Interface#Using_the_Gtk2_interface_under_Mac_OS_X
 

 I don't want Gimp... But it is for a good cause !

  However I'm not sure it's worth it, as gtk2 also requires X11, so it's
  not a big improvement.
  One can build the IDE with Qt, but the code editor still has some
  problems.

 But I can work with GTK2 for the IDE and temporarily use QT for my
 app, waiting for the carbon widgetset.
 I am boring of Linux I prefer to use my laptop :)

  Under Carbon we still lack a Caret, but aside from this very
  important detail it works very well.
 

The caret should now work in IDE TSynedit under Carbon.

Tom

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


Re: [lazarus] Carbon TMemo with invisible font

2007-11-18 Thread Tom Gregorovic
On Nov 18, 2007 12:15 AM, Tobias Giesen [EMAIL PROTECTED] wrote:
 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?

Sorry, that was probably caused by my changes and I have not noticed
such a bug. Look at CarbonCanvas.pp:

procedure TCarbonControlContext.Reset;
begin
  inherited Reset;

  if CGContext  nil then
if CurrentBrush  nil then // apply control background color
begin
  if FOwner.LCLObject.Color  clBtnFace then
CurrentBrush.SetColor(FOwner.LCLObject.Color, True)
  else
CurrentBrush.SetColor(FOwner.LCLObject.Color, False);

  CurrentBrush.Apply(Self, False);
end;

  if FOwner.LCLObject.Font.Handle  0 then
CurrentFont := TCarbonFont(FOwner.LCLObject.Font.Handle);
end;

And try commenting last lines. I have not access to Mac at the moment
but I will repair it as soon as I can.

Tom

_
 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 Tom Gregorovic
Hi,
I vote for solving this issue in Carbon interface.

Summary:
TSynEdit and components that draw text per partes (to indicate
selection, ...) need text functions without fractions and kerning,
tracking...

But all these typographic features should be otherwise enabled by default.

Solution:
Create property for TCarbonCustomControl, TCarbonDeviceContext and
interface function to change these typographic features in
BeginTextRender.
I propose TextFractioningEnabled and SetTextFractioning names.

Tom

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


Re: [lazarus] Thanks Tom Gregorovic re bug 0009952

2007-10-25 Thread Tom Gregorovic

James Chandler Jr napsal(a):


Hi Tom


Hi,



Thanks for adding the Carbon SetCursorPos patch.

Wome feedback on your comment: Thanks. It's only pitty that it does 
not produce mouse events.


I could be mistaken, and appreciate correction, but think that 
SetCursorPos SHOULD NOT send mouse events (on any platform).


That is from my use of SetCursorPos but perhaps there are other uses 
which would want to generate mouse events.


For instance, a favorite control is what I call a TextSlider-- It 
displays a Text value, and when you click-drag the control, it tracks 
like a vertical slider, but rather than the text control moving 
on-screen, the number in the text control just changes in response to 
vertical mouse movement. This kind of control has been common in music 
programs since the 1980's. Many round knob controls work similarly.


I hilite the textbox and hide the cursor (and pin the hidden cursor on 
the textbox), or alternately leave the cursor visible and move it to 
the right of the textbox and 'pin' its location, so that vertical 
drags cannot move long distances on the screen. If the TextSlider 
control is near the top of the screen and the user wants to drag the 
value from 10 to 1000, the value drag would stop when the cursor hits 
the top of the screen, limiting the amount that the user could drag in 
a single movement.


In that kind usage, it would be undesirable if SetCursorPos would send 
mouse events. If my OnMouseMove notices that the user dragged up 5 
pixels, and then adds 5 to the control's value and updates the screen, 
and does SetCursorPos to move the cursor back to its original location 
for further user dragging--


If the control's OnMouseMove SetCursorPos generates a mouse move down 
event, then that new event would trigger OnMouseMove again, and 'undo' 
the user's drag, subtracting 5 from the control value and returning 
the control back to the original value.


Haven't traced the code, but am pretty sure that the PC Delphi and PC 
Lazarus SetCursorPos does not generate mouse move events, otherwise my 
mouse-tracking controls which use that trick, would never work.


Apple strongly disapproves programmatically moving the cursor, and I 
read somewhere that they supplied the WarpCursorPos function to coddle 
video game programs, which also need to keep the cursor on-screen for 
similar reasons that my controls need. It is doubtful that game 
programmers would want mouse-move events, for the same reasons I don't 
want em. It could 'undo' the purpose of the SetCursorPos.


Sorry for such a boring message. Just wanted to point out that adding 
a mouse move event to SetCursorPos might be undesirable.


Thanks for such great work!

That's allright, I comprehend that generating mouse events is sometimes 
undesirable. I have been following behaviour of SetCursorPos in Lazarus 
on Windows platform and Delphi (5), where SetCursorPos generates 
OnMouseMove events. I will add a note on Wiki about this.


Tom

_
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

2007-10-24 Thread Tom Gregorovic

Dominique Louis napsal(a):

I've noticed that transparency for TBitBtn under Carbon on Mac OS X 
does not appear to work.


Let me clarify that. It looks fine inside the X11 ide on the Lazarus 
form, but is not transparent at run-time under Carbon.


Is there anything specific to Mac OS I need to do to do get transparency?


Do you mean TBitBtn face transparency or glyph transparency? AFAIK 
TBitBtn face is not transparent on Mac OS X.


Tom

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


Re: [lazarus] Carbon IDE

2007-10-22 Thread Tom Gregorovic

Hess, Philip J napsal(a):


PaulIsh added a list of issues with the Carbon-based Lazarus IDE and I've added 
to it. Please add any other issues you discover so we can have a complete list 
of everything that needs to be addressed for a working and Mac-ready IDE:

http://wiki.lazarus.freepascal.org/Carbon_interface_internals#Carbon_IDE_Bugs

Great, I see there are Mac specific IDE design and shortcuts issues and 
I think that IDE now does not allow these per platform specifics.


Tom

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


Re: [lazarus] ListView Crashes on Mac OS X...

2007-10-14 Thread Tom Gregorovic

Dominique Louis napsal(a):


Hi Marc,
  Does this mean that it is being worked on? Or is that just a place 
hold exception until someone gets round to working on it?


Hi,
I will be working on that, but it is quite wide. I expect it would be 
usable in two weeks.


Tom

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


Re: [lazarus] ListView Crashes on Mac OS X...

2007-10-14 Thread Tom Gregorovic

Dominique Louis napsal(a):


Hi Tom,
  This is excellent news! I would love to help out any way I can and 
would also like to learn how you go about wrapping these Carbon 
controls. If there is anything I can do to help, let me know.


Also is there a list somewhere of which Carbon controls have not been 
ported/wrapped yet?


Yes, you can look at 
http://wiki.lazarus.freepascal.org/Carbon_interface_internals and 
http://wiki.lazarus.freepascal.org/Roadmap#Status_of_components_on_each_widgetset. 
Almost all controls are implemented except some printer dialogs. There 
is more to do in testing and fixing bugs.


Tom

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


Re: [lazarus] Strange Parameter being passed to .app on startup...

2007-10-08 Thread Tom Gregorovic

Dominique Louis napsal(a):


Hi all,
  The basic conversion is now over, so the debugging begins.

When the application is started via the Application Bundle a strange 
parameter is passed to the executable as the first parameter.
The parameter looks like this -psn_0_, where the ns 
represent some number value that changes every time the application is 
run.
What is this parameter? This application uses the first parameter to 
load up a data file, so this is throwing things out abit.


Any guidance welcome.


Hi,
I think you can't rely on parameters when you execute app via 
Application bundle. You can use OnDropFiles event of TApplication or 
main form, where you can detect files dropped on the app dock icon or to 
be opened by your app (for example via open -a your.app file). Note 
that it must be a file.


Tom

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


Re: [lazarus] Mac FPC/Lazarus project, SpeedButtons with Transparency

2007-10-06 Thread Tom Gregorovic

Dominique Louis napsal(a):

You beat me to it, I'm also porting a rather large commerical Delphi 
app to Mac OS X and found the same problem.


Also while I'm here, is there a RichTextEdit component for Mac OS X?


Certiainly for example MLTE, but I don't know any implemented for Lazarus.



Dominique.

Peter Gannon wrote:

As described in a previous email, we have converted a Delphi/Windows 
music program to Mac/FPC/Lazarus (Carbon widgets), with great success.


I have a question about SpeedButtons. Do they have a transparency 
property? On Delphi and FPC/Lazarus/Windows , if Flat property is set 
to true, it behaves transparenttly, but not on Mac/Lazaurus.


Is their a way to get SpeedButtons with transparency on Mac/Lazarus/FPC ?



This should be fixed in svn revision 12349.

Tom

_
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-05 Thread Tom Gregorovic

Dominique Louis napsal(a):

As mentioned I'm porting a Delphi app to Mac OS X and noticed that 
every time it tries to make use of the TRegistry functions an AV 
occurs. Does anyone know why this may be happening, and also where 
does it save these Registry settings?


I have just tested it and it works well for me. The TRegistry should be 
saved to reg.xml file in the same dir as the executable.

Please create a bug report with further description.

Tom

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


Re: [lazarus] Added FPDoc Updater to Lazarus - a GUI tool for updating FPDoc files

2007-10-04 Thread Tom Gregorovic

Graeme Geldenhuys napsal(a):


On 03/10/2007, Tom Gregorovic [EMAIL PROTECTED] wrote:
 


Hi,
I have added FPDoc Updater to Lazarus. It is a GUI tool for updating
FPDoc files. You can find it in lazarus/doceditor/fpdocupdater/ directory.

   



Ah, you beat me to it!!  :)
I just starting working on the exact same thing.  I already posted a
partial feature request for makeskel
[http://www.freepascal.org/mantis/view.php?id=9809].

I found it a nightmare to maintain the external (fpdoc) documentation
after a code refactor (which I seem to do quite often), or as code
evolves.  I'll get a svn update shortly and try out you app!  Thanks
Tom.

Note that there are still some issues to be solved - topic FPDoc nodes 
are not preserved and content of elements with the same name are overwriten.


Tom

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


Re: [lazarus] Added FPDoc Updater to Lazarus - a GUI tool for updating FPDoc files

2007-10-04 Thread Tom Gregorovic

Vincent Snijders napsal(a):


Tom Gregorovic schreef:


Hi,
I have added FPDoc Updater to Lazarus. It is a GUI tool for updating 
FPDoc files. You can find it in lazarus/doceditor/fpdocupdater/ 
directory.



   Features

   * uses FPC Makeskel tool for generating FPDoc skeletons
   * mass update of FPDoc files for selected Pascal units
   * preserves written description in FPDoc elements
   * content of removed elements can be moved to different element or
 FPDoc file
   * can backup processed FPDoc files


For further info see: http://wiki.lazarus.freepascal.org/FPDoc_Updater.



When will this be added to LazDE, so that we don't have to use two 
applications at the same time?


I hope soon. I have an idea to change FPDoc Updater to something like 
Lazarus Doc Center, which would manage documentation projects. The LazDE 
would be part of it, indeed much improved. It could be launched 
separetaly via LazDE executable which would run LazDocCenter with some 
parameter switch to show documentation editor only.


Tom

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


[lazarus] Added FPDoc Updater to Lazarus - a GUI tool for updating FPDoc files

2007-10-03 Thread Tom Gregorovic

Hi,
I have added FPDoc Updater to Lazarus. It is a GUI tool for updating 
FPDoc files. You can find it in lazarus/doceditor/fpdocupdater/ directory.



   Features

   * uses FPC Makeskel tool for generating FPDoc skeletons
   * mass update of FPDoc files for selected Pascal units
   * preserves written description in FPDoc elements
   * content of removed elements can be moved to different element or
 FPDoc file
   * can backup processed FPDoc files


For further info see: http://wiki.lazarus.freepascal.org/FPDoc_Updater.

Regards,
   Tom Gregorovic

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


[lazarus] Lazarus Codetools XML vs FPC XML

2007-09-21 Thread Tom Gregorovic

Hi,
what is the difference between XML units from Lazarus Codetools 
(Laz_xmlread, Laz_dom, etc.) and FPC counterparts (XMLRead, DOM, etc.)

and which one would prefer to use?

Tom

_
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 Tom Gregorovic

Giuliano Colla napsal(a):


Giuliano Colla ha scritto:


Giuliano Colla ha scritto:

Somewhere between rev. 11937 and last svn rev. (11953) something 
happened to the IDE open file dialog. If the filter is set to any 
file  then the file list is blank. Setting the filter to something 
else, such as lazarus sources etc., then the filenames appear as usual.




Sorry, I forgot to mention: this happens under Linux/gtk1. I don't 
know about other patforms/widgetsets because in this moment I have no 
means to check.


I saw no reaction, so I looked into the code changed since the version 
which worked.
The problem is in masks.pas. Not using the new class TParseStringList, 
and reverting to a normal TStringList, everything works fine again.

My conclusion: there's a bug in TParseStringList.


Sorry, that was my fault. Should be fixed in SVN revision 11959. Please, 
retest it.


Tom

_
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 Tom Gregorovic

Tobias Giesen napsal(a):


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?
 


Hi,
I have encountered exactly the same problem, but I thought that it was 
caused by different error somewhere else in the code.



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.x1e10) 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;


Can you please test this code:

function CGRectToRect(const ARect: CGRect): TRect;
begin
 if CGRectIsNull(ARect) 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;

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


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

2007-09-07 Thread Tom Gregorovic

Tobias Giesen napsal(a):


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?
 


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

Tom

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


Re: [lazarus] Patch for Close Preview Icon Editor

2007-06-27 Thread Tom Gregorovic

wile64 napsal(a):


When you close Preview window, unChecked menu option.

Laurent.


Thanks, applied.

Tom

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


Re: [lazarus] GTK: Handle signal for every object

2007-06-27 Thread Tom Gregorovic

Paul Ishenin napsal(a):


Tom Gregorovic wrote:


Hi,
to implement dropping files for GTK, I need to process 
'drag_data_received' signal for every GTK object. How can I achieve 
this?




if for every that created by gtk widgetset then look at 
TGtkWidgetSet.HookSignals. if no then I dont know.



Thanks,
and where can I put my code for setting drag destination properties for 
every created GTK widget?


Tom

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


Re: [lazarus] T(Float)SpinEdit.ReadOnly porperty beaviour

2007-06-26 Thread Tom Gregorovic

Graeme Geldenhuys napsal(a):


On 26/06/07, Paul Ishenin [EMAIL PROTECTED] wrote:

 what behaviour should have T(Float)SpinEdit.ReadOnly property when 
set:

 (1) disable editing in text box
 (2) disable editing in text box and also changing value via arrows


If you give no explanation why (1), then I will vote for (2). ReadOnly
means that user can only read value. If user can change value by arrows



I agree with Paul. (2) is the most logical option.  It's a GUI
component, so the GUI must be read-only (completely).


I had reasoned about it this way:
* When you want to disable any changes to spin edit you can set Enabled 
to false, which also gives you an visual indication.
* Combo box read only functions likewise - you can't edit the text, but 
you can change selected item.


Tom

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


[lazarus] GTK: Handle signal for every object

2007-06-26 Thread Tom Gregorovic

Hi,
to implement dropping files for GTK, I need to process 
'drag_data_received' signal for every GTK object. How can I achieve this?


Tom

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


Re: [lazarus] Open-doc event handler for OS X Carbon

2007-06-25 Thread Tom Gregorovic

Vincent Snijders napsal(a):


On Sun, 24 Jun 2007 14:21:26 +0200
Tom Gregorovic [EMAIL PROTECTED] wrote:

 


Vincent Snijders napsal(a):

   


On Fri, 22 Jun 2007 17:03:49 +0200
Tom Gregorovic [EMAIL PROTECTED] wrote:



 


Hi,
I have started Wiki page for this issue, called Drop files event (see: 
http://wiki.lazarus.freepascal.org/Files_drop_event).

Feel free to add there your notes and ideas.
When the details will are clear, I could start implementation for LCL, 
Win and Carbon.


  

   


Maybe it is better to call the event OnDropFile or OnDropFiles instead of the 
proposed OnFilesDrop.

 

I stand for OnFilesDrop. There are similar event names, like OnDockDrop. 
It is in plural to show it is handling array of files (array event 
parameter is quite unusual).
   



I agree with the plural. 


From http://wiki.lazarus.freepascal.org/Nomenclature:

Event properties should be named On starting with an adjective, then verb, 
then a noun (some are optional): like OnFilterRecord, OnPostError, OnDblClick 
(adjective to verb first)

I don't know the OnDockDrop event, but to me it seems to signal a state while 
docking: first you dock over (OnDockOver) and then you Dock what has been 
dropped. Dock is the verb. But this is speculation...

I surrender, you have convinced me by this precise explanation. I'll 
rename it to OnDropFiles.


Tom

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


[lazarus] T(Float)SpinEdit.ReadOnly porperty beaviour

2007-06-25 Thread Tom Gregorovic

Hi,
what behaviour should have T(Float)SpinEdit.ReadOnly property when set:
(1) disable editing in text box
(2) disable editing in text box and also changing value via arrows

I vote for (1), what do you mean?

Tom

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


Re: [lazarus] Open-doc event handler for OS X Carbon

2007-06-24 Thread Tom Gregorovic

Vincent Snijders napsal(a):


On Fri, 22 Jun 2007 17:03:49 +0200
Tom Gregorovic [EMAIL PROTECTED] wrote:

 


Hi,
I have started Wiki page for this issue, called Drop files event (see: 
http://wiki.lazarus.freepascal.org/Files_drop_event).

Feel free to add there your notes and ideas.
When the details will are clear, I could start implementation for LCL, 
Win and Carbon.


   



Maybe it is better to call the event OnDropFile or OnDropFiles instead of the 
proposed OnFilesDrop.

I stand for OnFilesDrop. There are similar event names, like OnDockDrop. 
It is in plural to show it is handling array of files (array event 
parameter is quite unusual).


Tom

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


Re: [lazarus] Patch for Icon Editor

2007-06-23 Thread Tom Gregorovic

wile64 napsal(a):

I downloaded the version SVN of LazIconeEditor, how to make to make 
advanced

project ( if I can ).

For the moment I made a patch which corrects a problem with the 
loading the

Icons.


Thanks, applied.

Tom

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


Re: [lazarus] Screenshots on mac

2007-06-02 Thread Tom Gregorovic

Felipe Monteiro de Carvalho napsal(a):


On 6/2/07, Mattias Gaertner [EMAIL PROTECTED] wrote:


Not click. Drag to define the rectangle.



ah .. that explainst it =))

On KDE there is a screenshot option where you click the target window
to capture, so I just thougth it would be like that =)


You can view or change this type of shortcuts in System 
Preferences/Keyboard  mouse.


Tom

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


Re: [lazarus] Debugger on Mac OS X

2007-05-31 Thread Tom Gregorovic

Vincent Snijders napsal(a):


Tom Gregorovic schreef:


Hi,
I am working on running/debugging Application bundles under Carbon 
option for Lazarus IDE.

I will test it tomorrow and if it succeeds, I commit it.



Tom, I was wondering how far are you from running the IDE based on the 
carbon widgetset? Or do you already run a carbon based IDE?  


I estimate it optimisticaly to six months, in case I would continue only 
on my own.
Now I'm quite battling with scrolling control and there are other 
complex things to do like syn edit.


Tom

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


Re: [lazarus] Debugger on Mac OS X

2007-05-30 Thread Tom Gregorovic

Felipe Monteiro de Carvalho napsal(a):


On 5/26/07, Marc Weustink [EMAIL PROTECTED] wrote:


A way to work around this is:
Create an app bundle in your project dir and symlink the exe inside the
bundle to the compiled exe in the project dir. Then for debugging set
Run parameters - host application to yourbundle.app



The work around doesn't seam to work. When pressing F9 (actually
control+F9 on mac), Lazarus will complain that myboundle.app isn't an
executable


Hi,
I am working on running/debugging Application bundles under Carbon 
option for Lazarus IDE.

I will test it tomorrow and if it succeeds, I commit it.

Tom

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


Re: [lazarus] Debugger on Mac OS X

2007-05-26 Thread Tom Gregorovic

Felipe Monteiro de Carvalho napsal(a):


Hi,

Does the debugger work on gtk ide running on mac os x?

I set gdb as my debugger, made a very simple carbon app (pure carbon,
not lcl), set some breakpoints on the software beginning, but when I
run it nothing happens. I mean, the app doesn' t start, and the
breakpoints aren' t activated, but lazarus shows as if it was being
run. At this point I must exit the IDE.


Hi,
I have encoutered the same problem. Debugging from IDE does not 
function, because it's trying to debug the executable instead of app. 
bundle. Manually via terminal (command: gdb project.app) there is no 
problem.
The solution would be to generate app. bundle automatically and link the 
executbale into it. Then the IDE would know path to bundle for executing 
or debugging.


Tom

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


Re: [lazarus] SpinEdit question

2007-05-01 Thread Tom Gregorovic

Hi,
only one hint to your TSpinEdit question have crossed my mind - the 
TComboBox has also many of common functionality with TCustomEdit (like 
SelStart, SelText, ). Roughly it is an edit with disclosure button as 
TSpinEdit is an edit with up down button.


   Tombo

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


Re: [lazarus] Test apps for interface developing?

2007-02-27 Thread Tom Gregorovic

Vincent Snijders napsal(a):


Tom Gregorovic schreef:


Hi,
I'm improving Carbon interface and to this I use some testing 
projects. It would be benifical if they can be part of Lazarus svn - 
to provide tool for patch checking or to share them among other 
interface (not necessarily Carbon) developers.


What do you think?



Such test applications can be found in the lazarus\lcl\test directory.


That is what I have meant. But these tests are specialized on events.
Can I add my own tests (specialized on properties)?

Tom Gregorovic

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


[lazarus] Carbon interface: Wiki for cooperation on implementation

2007-02-25 Thread Tom Gregorovic

Hi,
I have added roadmap, bugs and compatibility issues concerning Carbon 
interface implementation to Wiki page 
http://wiki.lazarus.freepascal.org/Carbon_interface_internals.
Feel free to add your notes and write down on what are you working on 
Carbon interface.


Tom Gregorovic

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


Re: [lazarus] Running and debugging Carbon apps from Lazarus

2007-02-23 Thread Tom Gregorovic

Marc Weustink napsal(a):


Tom Gregorovic wrote:


Vincent Snijders napsal(a):


Tom Gregorovic schreef:


Hi,
is there any possibility how to run, and even better debug, Carbon 
apps from the Lazarus environment, which is running under X11 on 
Mac OS X?

It would help me much in improving Carbon interface for LCL.




Maybe I miss a point, but can't you set the widget set to carbon and 
run the application.



Unfortunately this does not function. When I press run the project is 
successfully compiled, but never launched, even if I disable debugger.
I must use apple resource files for Carbon projects to let the system 
recognize it 



Not really necessary, only one certain byte as resource in the exe is 
enough. However, we don't add it yet so you need a project.app


and therefore I must launch it from Finder or by open project1.app 
command. Because the linked executable is project1, but I need to 
execute project1.app.



What I did for testing is making an empty project.app and symlink the 
exe. like:


MyApp.app/Contents/MacOS/MyApp - ../../../MyApp

so that the compiled exe and the app are in the same dir

Now we have only find a way to tell gdb to launch the app


I have made some tests and maybe be it is possible - through changing 
Host application in Run/Run parameters... to whole path of 
project1.app. But I haven't tested it on Mac yet.


Tom Gregorovic

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


[lazarus] Running and debugging Carbon apps from Lazarus

2007-02-22 Thread Tom Gregorovic

Hi,
is there any possibility how to run, and even better debug, Carbon apps 
from the Lazarus environment, which is running under X11 on Mac OS X?

It would help me much in improving Carbon interface for LCL.

   Tom Gregorovic

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


Re: [lazarus] Running and debugging Carbon apps from Lazarus

2007-02-22 Thread Tom Gregorovic

Vincent Snijders napsal(a):


Tom Gregorovic schreef:


Hi,
is there any possibility how to run, and even better debug, Carbon 
apps from the Lazarus environment, which is running under X11 on Mac 
OS X?

It would help me much in improving Carbon interface for LCL.



Maybe I miss a point, but can't you set the widget set to carbon and 
run the application.


Unfortunately this does not function. When I press run the project is 
successfully compiled, but never launched, even if I disable debugger.
I must use apple resource files for Carbon projects to let the system 
recognize it and therefore I must launch it from Finder or by open 
project1.app command. Because the linked executable is project1, but 
I need to execute project1.app.


Tom Gregorovic

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


[lazarus] Carbon Canvas implementation dilemma

2007-02-03 Thread Tom Gregorovic

Hi,
I think over how to implement canvas for Carbon interface.
There are two possibilities to use: QuickDraw or Quartz 2D. I want to 
consult it with you.

Here is the list of disadvantages, I have found:

QuickDraw
- DC of Carbon controls must use Window Port
- deprecated in Mac OS X v10.4

Quartz 2D
- unable to implement GetPixel, FloodFill, SetPixel must be simulated 
via line drawing

- different coordination system (change Current Transformation Matrix)
- bledning instead of ROP
- bitmap canvas implementation (needs Mac OS X v10.4 because of 
CGBitmapContextCreateImage, but we can get round it)


Feel free to point out anything I have omitted.
From my point of view the Quartz 2D appears to be more suitable, 
although it doesn't provide per-pixel operations.


Regards,
   Tom Gregorovic

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


Re: [lazarus] Carbon interface patch

2007-01-26 Thread Tom Gregorovic

Mattias Gaertner napsal(a):


On Thu, 25 Jan 2007 17:34:32 +0100
Tom Gregorovic [EMAIL PROTECTED] wrote:

 


Mattias Gaertner napsal(a):

   


On Thu, 25 Jan 2007 16:42:04 +0100
Tom Gregorovic [EMAIL PROTECTED] wrote:



 


Hi,
I have improved a lot of things in the carbon interface. Sorry for
such large chunk, but I wasn't able to divide it in smaller parts. I
hope it doesn't matter.
The summary of implemented features and svn diff is attached.
  

   


Something is wrong with the zip:

[]$ unzip carbon.zip 
Archive:  carbon.zip

 skipping: carbon.diff `(null)' method not supported

 


Sorry, I have zipped it with 7zip and haven't changed archiving
method to standard. Now it should be all right.
   



Almost.
Can you send carbonprivatecommon.inc?
 


Of course.

Tom Gregorovic
{%MainUnit carbonprivate.pp}
{ $Id: $}
{
 *
 *   *
 *  This file is part of the Lazarus Component Library (LCL) *
 *   *
 *  See the file COPYING.modifiedLGPL, included in this distribution,*
 *  for details about the copyright. *
 *   *
 *  This program is distributed in the hope that it will be useful,  *
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of   *
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
 *   *
 *
}

// ==
// H A N D L E R S 
// ==

function CarbonPrivateCommon_Dispose(ANextHandler: EventHandlerCallRef;
  AEvent: EventRef;
  AInfo: PWidgetInfo): OSStatus; {$IFDEF darwin}mwpascal;{$ENDIF}
var
  Msg: TLMessage;
  PrivateClass: TCarbonPrivateHiViewClass;
begin
  Result := CallNextEventHandler(ANextHandler, AEvent);
  PrivateClass := TCarbonPrivateHiViewClass(AInfo^.WSClass.WSPrivate);

  FillChar(Msg, SizeOf(Msg),0);
  Msg.msg := LM_DESTROY;
  DeliverMessage(AInfo^.LCLObject, Msg);

  PrivateClass.UnregisterEvents;
  FreeWidgetInfo(AInfo);
end;

function CarbonPrivateCommon_Draw(ANextHandler: EventHandlerCallRef;
  AEvent: EventRef;
  AInfo: PWidgetInfo): OSStatus; {$IFDEF darwin}mwpascal;{$ENDIF}
var
  PaintMsg: TLMPaint;
  AStruct: PPaintStruct;
begin
  debugln('CarbonPrivateCommon_Draw ',DbgSName(AInfo^.LCLObject));
  // first let carbon draw/update
  Result := CallNextEventHandler(ANextHandler, AEvent);

  FillChar(PaintMsg,SizeOf(PaintMsg),0);
  PaintMsg.Msg := LM_PAINT;
  PaintMsg.DC := HDC(TCarbonDeviceContext.Create(AInfo));
  New(PaintMsg.PaintStruct);
  AStruct := PaintMsg.PaintStruct;
  FillChar(AStruct^, SizeOf(TPaintStruct), 0);
  AStruct^.hdc := PaintMsg.DC;
  try
debugln('CarbonPrivateCommon_Draw LM_PAINT to ', 
DbgSName(AInfo^.LCLObject));
DeliverMessage(AInfo^.LCLObject, PaintMsg);
  finally
Dispose(PaintMsg.PaintStruct);
TCarbonDeviceContext(PaintMsg.DC).Free;
  end;
end;

function CarbonPrivateCommon_BoundsChanged(ANextHandler: EventHandlerCallRef;
  AEvent: EventRef;
  AInfo: PWidgetInfo): OSStatus; {$IFDEF darwin}mwpascal;{$ENDIF}
var
  AWinControl: TWinControl;
  PosMsg : TLMWindowPosChanged;
  SizeMsg: TLMSize;
  MoveMsg: TLMMove;
  WidgetBounds: TRect;
begin
  debugln('CarbonPrivateCommon_BoundsChanged ', DbgSName(AInfo^.LCLObject));
  // first let carbon draw/update
  Result := CallNextEventHandler(ANextHandler, AEvent);
  
  if AInfo^.LCLObject is TWinControl then
  begin
AWinControl := TWinControl(AInfo^.LCLObject);
GetCarbonLocalWindowRect(AWinControl.Handle, WidgetBounds, AInfo);

// first send a LM_WINDOWPOSCHANGED message
if (AWinControl.Left  WidgetBounds.Left) or
   (AWinControl.Top  WidgetBounds.Top) or
   (AWinControl.Left + AWinControl.Width  WidgetBounds.Right) or
   (AWinControl.Top + AWinControl.Height  WidgetBounds.Bottom) then
begin
  FillChar(PosMsg,SizeOf(PosMsg),0);
  PosMsg.Msg := LM_WINDOWPOSCHANGED;
  New(PosMsg.WindowPos);
  try
with PosMsg.WindowPos^ do begin
  hWndInsertAfter := 0;
  x := WidgetBounds.Left;
  y := WidgetBounds.Top;
  cx := WidgetBounds.Right - WidgetBounds.Left;
  cy := WidgetBounds.Bottom - WidgetBounds.Top;
  flags := 0;
end;
DeliverMessage(AInfo^.LCLObject, PosMsg);
  finally
Dispose(PosMsg.WindowPos);
  end;
end;

// then send a LM_SIZE message
if (AWinControl.Width  WidgetBounds.Right - WidgetBounds.Left) or
   (AWinControl.Height  WidgetBounds.Bottom

Re: [lazarus] Perplexing TBitmap behavior.

2006-12-07 Thread Tom Gregorovic

Dave Coventry napsal(a):


Hi,

I have code as follows:

// snip ===
procedure TForm1.FormShow(Sender: TObject);
var
 BufferMap: TBitmap;
begin
 BufferMap:=TBitMap.Create;
end;
// snip ===

This should work (indeed it works in another project).

However, code completion does not give me the option to insert 
'Create'; the only options given are bmBits through to bmWidthBytes.


When I try to compile it says 'Unit1.pas(81,22) Error: Unknown record 
field identifier CREATE '


I'm at a bit of a loss, especially as the other project uses it 
without problems. Also the 'uses' sections ARE identical.


Does anyone have any ideas?


Hi,
I think you have Windows unit in the uses section, don't you?
If so, then you must place it before Graphics in the uses list.

Tombo

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


[lazarus] New Lazarus component: TColorPalette

2006-10-30 Thread Tom Gregorovic

Hi,
I have developed new visual component for Lazarus: TColorPalette. 
Shortly, it is a color palette grid with ability to use custom palettes.
See wiki page for further info: 
http://wiki.lazarus.freepascal.org/ColorPalette.


Best regards,
   Tom Gregorovic.

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


Re: [lazarus] New Lazarus package: LazRGBGraphics

2006-10-01 Thread Tom Gregorovic

Michael Van Canneyt napsal(a):


On Sun, 1 Oct 2006, Tom Gregorovic wrote:

 


Hi,
I have created new package for Lazarus: LazRGBGraphics.
LazRGBGraphics is run-time package for fast in memory image processing
and pixel manipulations (like scan line). This package was designed for
cross-platform usage. The main class is TRGB32Bitmap which is anolog to
TBitmap.

TRGB32Bitmap features:

   * load from file, save to file
   * creating from TBitmap
   * drawing and stretchdrawing to TCanvas
   * rotating, stretching
   * inverting colors
   * drawing primitives via canvas (TRGB32Canvas) with emphasis on
 accuracy
   * per pixel manipulation via GetPixelPtr
   



What is the advantage of this compared to the TFPImage on which
lazarus is based ?
 

The main advantage is direct memory access to bitmap pixels with keeping 
ability to draw bitmap onto canvas without any widgetset time consuming 
memory format converting (via StretchDIBits under Win32 and 
gdk_draw_rgb_32_image under gtk).
That's the main reason, why I have developed it. Unfortunately I forgot 
to mention it on the wiki.


Next, the canvas pirmitive drawing is aimed to give the same result 
across various platforms.


Thanks for your feedback,
   Tom Gregorovic

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


Re: [lazarus] New Lazarus package: LazRGBGraphics

2006-10-01 Thread Tom Gregorovic

Michael Van Canneyt napsal(a):


On Sun, 1 Oct 2006, Tom Gregorovic wrote:

 


Michael Van Canneyt napsal(a):

   


On Sun, 1 Oct 2006, Tom Gregorovic wrote:



 


Hi,
I have created new package for Lazarus: LazRGBGraphics.
LazRGBGraphics is run-time package for fast in memory image processing
and pixel manipulations (like scan line). This package was designed for
cross-platform usage. The main class is TRGB32Bitmap which is anolog to
TBitmap.

TRGB32Bitmap features:

  * load from file, save to file
  * creating from TBitmap
  * drawing and stretchdrawing to TCanvas
  * rotating, stretching
  * inverting colors
  * drawing primitives via canvas (TRGB32Canvas) with emphasis on
accuracy
  * per pixel manipulation via GetPixelPtr


   


What is the advantage of this compared to the TFPImage on which
lazarus is based ?


 


The main advantage is direct memory access to bitmap pixels with keeping
ability to draw bitmap onto canvas without any widgetset time consuming
memory format converting (via StretchDIBits under Win32 and
gdk_draw_rgb_32_image under gtk).
That's the main reason, why I have developed it. Unfortunately I forgot
to mention it on the wiki.

Next, the canvas pirmitive drawing is aimed to give the same result
across various platforms.
   



But this is exactly what the TMemoryImage and TImageCanvas do ?
 

Partially yes. But, to draw bitmap form TLazIntfImage (LCL 
TFPCustomImage wrapper) to widgetset canvas, it must be converted to the 
TBitmap and that is so slow, especially under gtk.


Tom Gregorovic

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


[lazarus] Patch for Graphics

2006-09-14 Thread Tom Gregorovic

Hi,
this patch moves InvertColor function from SourceEditorProcs to Graphics 
and adds RGBToColor function, which composes TColor from red, green and 
blue component like Windows.RGB.


  Tombo
Index: ide/sourceeditprocs.pas
===
--- ide/sourceeditprocs.pas (revision 9891)
+++ ide/sourceeditprocs.pas (working copy)
@@ -98,24 +98,6 @@
   BGBlue: Integer;
   TokenStart: Integer;
 
-  function InvertColor(AColor: TColor): TColor;
-  var Red, Green, Blue: integer;
-  begin
-Red:=(AColor shr 16) and $ff;
-Green:=(AColor shr 8) and $ff;
-Blue:=AColor and $ff;
-if Abs($80-Red)+Abs($80-Green)+Abs($80-Blue)$140 then begin
-  Red:=Red+$a0;
-  Green:=Green+$a0;
-  Blue:=Blue+$a0;
-end else begin
-  Red:=$ff-Red;
-  Green:=$ff-Green;
-  Blue:=$ff-Blue;
-end;
-Result:=((Red and $ff) shl 16)+((Green and $ff) shl 8)+(Blue and $ff);
-  end;
-
   procedure SetFontColor(NewColor: TColor);
   var
 FGRed: Integer;
Index: lcl/graphics.pp
===
--- lcl/graphics.pp (revision 9891)
+++ lcl/graphics.pp (working copy)
@@ -1302,10 +1302,12 @@
 function ColorToString(Color: TColor): AnsiString;
 function StringToColor(const S: shortstring): TColor;
 procedure GetColorValues(Proc: TGetColorStringProc);
+function InvertColor(AColor: TColor): TColor;
 
 Function Blue(rgb: TColor): BYTE;
 Function Green(rgb: TColor): BYTE;
 Function Red(rgb: TColor): BYTE;
+function RGBToColor(R, G, B: Byte): TColor;
 procedure RedGreenBlue(rgb: TColor; out Red, Green, Blue: Byte);
 function FPColorToTColor(const FPColor: TFPColor): TColor;
 function TColorToFPColor(const c: TColor): TFPColor;
@@ -1639,6 +1641,30 @@
   for I := Low(Colors) to High(Colors) do Proc(Colors[I].Name);
 end;
 
+function InvertColor(AColor: TColor): TColor;
+var
+  R, G, B: Integer;
+begin
+  R := AColor and $ff;
+  G := (AColor shr 8) and $ff;
+  B := (AColor shr 16) and $ff;
+
+  if Abs($80 - R) + Abs($80 - G) + Abs($80 - B)  $140 then
+  begin
+Inc(R, $a0);
+Inc(G, $a0);
+Inc(B, $a0);
+  end
+  else
+  begin
+R := $ff - R;
+G := $ff - G;
+B := $ff - B;
+  end;
+  
+  Result := ((B and $ff) shl 16) or ((G and $ff) shl 8) or (R and $ff);
+end;
+
 Function Blue(rgb: TColor): BYTE;
 begin
   Result := (rgb shr 16) and $00ff;
@@ -1654,6 +1680,11 @@
   Result := rgb and $00ff;
 end;
 
+function RGBToColor(R, G, B: Byte): TColor;
+begin
+  Result := (B shl 16) or (G shl 8) or R;
+end;
+
 procedure RedGreenBlue(rgb: TColor; out Red, Green, Blue: Byte);
 begin
   Red := rgb and $00ff;