Re: [lazarus] TAChart and Parabola graph

2006-01-25 Thread Graeme Geldenhuys
The company is called Master Maths, based in South Africa.  We develop
software for math education. Used in schools, centres, universities
and government institutes.  Master Maths have 100+ franchises in South
Africa, UK and some other countries in Africa.  The product consists
of a Admin program that does the normal data collection, reporting and
accounting aspects.  The other part is what we call the Browser.  It
views the encrypted Macromedia Flash content inside the application,
and handles tests, etc.  The content is huge -  15 CD' s for the
complete system.  They also have a separate product called Distance
Learning, where you can buy a single Grade at a time.

The current system is developed for Windows only, using Delphi and VB.
 We are now busy with Ver.3 which is a total rewrite using Lazarus, so
we can make the product cross platform (Windows and Linux).

Regards,
  - Graeme -


On 1/25/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
 Just out of curiosity, what company and what products?

 Darius

  We develop mathematical products, and our math experts told me it is a
  parabola that they need. I added the graph bit.  :-)
 

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


Re: [lazarus] setColor patch

2006-01-25 Thread darekm

I forget patch


Marc Santhoff wrote:


Am Dienstag, den 24.01.2006, 18:41 +0100 schrieb darekm:
 


Darek

PS. how simple test patch syntactic
   



 


patch -C  yourmodifictions.diff


From the man page of patch(1):


-C, --check
   see what would happen, but don't do it.
 



I know, this is impossible, but my patch don;t have this options (I use 
Gentoo)


Darek
Index: interfaces/gtk/gtkproc.inc
===
--- interfaces/gtk/gtkproc.inc  (wersja 8613)
+++ interfaces/gtk/gtkproc.inc  (kopia robocza)
@@ -6519,37 +6519,15 @@
   end;
 end;
 
-procedure SetWidgetColor(aWidget : PGTKwidget; data : gpointer); cdecl;
-begin
-  gtk_widget_set_style(aWidget,data);
-  if  gtk_is_button(aWidget) or gtk_is_check_button(aWidget) then begin
-gtk_container_foreach(pGtkContainer(aWidget),@SetWidgetColor,data);
-  end;
-end;
- 
-procedure setWidgetBG(aColor: longint;var aWidget : pGTKWidget);
-var
-  WindowStyle: PGtkStyle;
-begin
-  windowStyle:=gtk_widget_get_style(aWidget);
-  windowstyle^.bg[0]:=AllocGDKColor(aColor);
-  SetWidgetColor(aWidget,windowStyle);
-end;
- 
-procedure setWidgetFG(aColor: longint;var aWidget : pGTKWidget);
-var
-  WindowStyle: PGtkStyle;
-begin
-  windowStyle:=gtk_widget_get_style(aWidget);
-  windowstyle^.fg[0]:=AllocGDKColor(aColor);
-  SetWidgetColor(aWidget,windowStyle);
-end;
 
 {--
   function GdkAtomToStr(const Atom: TGdkAtom): string;
 
   Returns the associated string
  
--}
+ 
+
+ 
 function GdkAtomToStr(const Atom: TGdkAtom): string;
 var
   p: Pgchar;
@@ -7610,23 +7588,7 @@
   else begin
 Widget := MainWidget;
   end;
-  //  writeln('update ',longint(Widget),'  color 
',longint(aWinControl.Color),DbgSName(AWinControl));
 
-  if (AWinControl.ColorclNone)  then begin
-if (csOpaque in AWinControl.ControlStyle)
-and GtkWidgetIsA(MainWidget,GTKAPIWidget_GetType) then exit;
-
-if AWinControl.ColorIsStored
-and ((AWinControl.Color and SYS_COLOR_BASE)=0) then begin
-  DebugLn('UpdateWidgetStyleOfControl ',DbgSName(AWinControl),' 
Color=',dbgs(AWinControl.Color));
-  setWidgetBG(AWinControl.Color,Widget);
-end;
-  end;
-  if (AWinControl.Font.Color and SYS_COLOR_BASE)=0 then begin
-DebugLn('UpdateWidgetStyleOfControl ',DbgSName(AWinControl),' 
Font.Color=',dbgs(AWinControl.Font.Color));
-setWidgetFG(AWinControl.Font.Color,Widget);
-  end;
-
   RCStyle:=nil;
   FreeFontName:=false;
   FreeFontSetName:=false;
@@ -7680,8 +7642,9 @@
 // set font color
 
 // set font (currently only TCustomLabel)
-if GtkWidgetIsA(Widget,gtk_label_get_type)
+if (GtkWidgetIsA(Widget,gtk_label_get_type)
 or GtkWidgetIsA(Widget,gtk_editable_get_type)
+or GtkWidgetIsA(Widget,gtk_check_button_get_type))
 and ((AWinControl.Font.NameDefFontData.Name)
   or (AWinControl.Font.Size0)
   or (AWinControl.Font.Style[]))
Index: interfaces/gtk/gtkdef.pp
===
--- interfaces/gtk/gtkdef.pp(wersja 8613)
+++ interfaces/gtk/gtkdef.pp(kopia robocza)
@@ -223,6 +223,7 @@
 wwiNotOnParentsClientArea
 );
   TWidgetInfoFlags = set of TWidgetInfoFlag;
+  tGtkStateEnum = set of byte;
 
   // Info needed by the API of a HWND (=Widget) 
   PWidgetInfo = ^TWidgetInfo;
Index: interfaces/gtk/gtkwinapi.inc
===
--- interfaces/gtk/gtkwinapi.inc(wersja 8613)
+++ interfaces/gtk/gtkwinapi.inc(kopia robocza)
@@ -3975,13 +3975,6 @@
   Result:= False;
   exit;
 end;
-Widget:=PGtkWidget(TDeviceContext(DC).Wnd);
-ClientWidget:=Widget;
-if Widgetnil then begin
-  ClientWidget:=GetFixedWidget(Widget);
-  if ClientWidget=nil then
-ClientWidget:=Widget;
-end;
 AWindow:=Drawable;
 DCOrigin:=GetDCOffset(TDeviceContext(DC));
 Area.X:=ARect.Left+DCOrigin.X;
@@ -3998,12 +3991,12 @@
 //'');
 
 for i:= 1 to FrameWidth do begin
-  gtk_paint_shadow(TheStyle,
+  gtk_paint_shadow(theStyle,
AWindow, GTK_STATE_NORMAL,
ShadowType,
@Area,
-   ClientWidget,
-   'button',
+   {ClientWidget}nil,
+   {'button'}nil,
ARect.Left+DCOrigin.X, ARect.Top+DCOrigin.Y,
ARect.Right-ARect.Left, ARect.Bottom-ARect.Top);
   // inflate the rectangle (! ARect will be returned to the user with this)
Index: interfaces/gtk/gtkcallback.inc
===
--- interfaces/gtk/gtkcallback.inc  (wersja 8613)
+++ interfaces/gtk/gtkcallback.inc  (kopia robocza)
@@ -232,7 +232,6 @@
 

Re: [lazarus] TrayIcon preview

2006-01-25 Thread Mattias Gaertner
On Wed, 25 Jan 2006 20:35:30 +0100
Danny Milosavljevic [EMAIL PROTECTED] wrote:

 Hi,
 
 Am Dienstag, den 24.01.2006, 07:19 -0200 schrieb Felipe Monteiro de
 Carvalho:
  On 1/21/06, Danny Milosavljevic [EMAIL PROTECTED] wrote:
   I would guess you only need to realize the window (so that it has a
   GDK - i.e. X - drawable, for example)
  
   You could also connect to the realize signal to only be notified
   when the window is realized and save the drawable there.
  
 
  Well . fell free to try those things and submit a patch if they work
  =)
 
 Right after I did the ~4000 other things in my TODO queue ;)
 
 (f.e. I do not have a system tray anymore so it would be quite some
 work)
 
 I do answer questions quickly though :)
 
  
  I don´t know much about Gtk and X11. I just copyed the GtkTrayIcon
  component form Andrew Heines and adapted it to my interface, changing
  the code until it worked =P
 
 I see :)
 
  
   If anything is unclear with gtk2 stuff, just ask me :)
  
  The following lines on gtk1 interface:
  
  procedure TWidgetTrayIcon.CreateForm(id: Integer);
  begin
  .
fDisplay :=
GDK_WINDOW_XDISPLAY(Pointer(PGtkWidget(GtkForm.Handle)^.window));
  //  SHowMessage(IntToStr(Integer(fDisplay)));
fWindow := GDK_WINDOW_XWINDOW
(Pointer(PGtkWidget(GtkForm.Handle)^.window)); fScreen :=
XDefaultScreenOfDisplay(fDisplay); // get the screen fScreenID :=
XScreenNumberOfScreen(fScreen); // and it's number
  end;
  
  GDK_WINDOW_XDISPLAY doesn´t exist on the Gtk2 interface. It´s a X11
  specific MACRO. I tryed to substitute this with:
 
 It does exist in gtk2 itself... though it's a little bit TOO low-level
 for my taste :)
 
 Better just use gtk_widget_get_screen and then
 gdk_x11_screen_get_xscreen, the latter being missing from the
 bindings there is no gdkx.pas in the bindings yet (not many people
 use the pascal gtk2 bindings for X interfacing it seems), 

They are not yet in the FPC sources, because I had not the time to test
them:

lazarus/components/opengl/gtk2x11/gdk2x11.lpk
unit gdk2x.pas

Mattias

[...]

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


Re: [lazarus] Turbopower IPro problem - selecting text in HtmlPanel

2006-01-25 Thread Panagiotis Sidiropoulos

I managed to display selected text as inverted by replacing

 // in ipHtml file, procedure PaintSelection;.
 {$IFDEF IP_LAZARUS}
 writeln('TIpHtml.PaintSelection  PatBlt not implemented');
 {$ELSE}


with code that follows:

  {$IFDEF IP_LAZARUS}
  BitMapToInvert := TBitMap.Create;
  BitMapToInvert.Width := R.Right - R.Left;
  BitMapToInvert.Height := R.Bottom - R.Top;
  BitMapToInvert.Canvas.CopyMode := cmMergePaint;
  BitMapToInvert.Canvas.CopyRect( Rect( 0, 0, BitMapToInvert.Width, 
BitMapToInvert.Height ),

  PaintBuffer,
  R );
  PaintBuffer.CopyRect( R,
BitMapToInvert.Canvas,
Rect( 0, 0, BitMapToInvert.Width, 
BitMapToInvert.Height ) );

  BitMapToInvert.Free;
  {$ELSE}

You have first to declare a TBitMap named BitMapToInvert at .PaintSelection 
var declarations:

  BitMapToInvert: TBitMap;
It is flickering but works fine inverting colors correctly.

What I'm still investigating is to make SelectAll method to work.
Any ideas are welcomed.

Panagiotis


From: Timothy Ha timh at jesuschrist.ru
Subject: Turbopower IPro problem - selecting text in HtmlPanel
Newsgroups: gmane.comp.ide.lazarus.general
Date: 2005-11-10 22:46:25 GMT (10 weeks, 5 days, 23 hours and 17 minutes 
ago)


I was reading Christian U. message at
http://www.mail-archive.com/lazarus at miraclec.com/msg01959.html and 
would

like to know the progress of using Turbopower Ipro to read HTML files.

I could load a HTML into the HTML Panel, but got errors when tried to
select a bit of text

IpHtml.pas about line 7827 I've got

 {$IFDEF IP_LAZARUS}
 writeln('TIpHtml.PaintSelection  PatBlt not implemented');
 {$ELSE}

As for loading text into HtmlPanel, this is what I did:

procedure TForm1.Button1Click(Sender: TObject);
var
 h: TIpHTML;
 f: TFileStream;
begin
   h := TIpHTML.Create;
   f := TFileStream.Create('d:\my.html', 0);
   h.LoadFromStream(f);
   IpHTMLPanel1.SetHtml(h);
end;

How can I copy-paste text from Ipro HtmlPanel to other applications now?


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


Re: [lazarus] Turbopower IPro problem - selecting text in HtmlPanel

2006-01-25 Thread Mattias Gaertner
On Thu, 26 Jan 2006 00:22:31 +0100
Panagiotis Sidiropoulos [EMAIL PROTECTED] wrote:

 I managed to display selected text as inverted by replacing
 
   // in ipHtml file, procedure PaintSelection;.
   {$IFDEF IP_LAZARUS}
   writeln('TIpHtml.PaintSelection  PatBlt not implemented');
   {$ELSE}
 
 
 with code that follows:
 
{$IFDEF IP_LAZARUS}
BitMapToInvert := TBitMap.Create;
BitMapToInvert.Width := R.Right - R.Left;
BitMapToInvert.Height := R.Bottom - R.Top;
BitMapToInvert.Canvas.CopyMode := cmMergePaint;
BitMapToInvert.Canvas.CopyRect( Rect( 0, 0, BitMapToInvert.Width, 
 BitMapToInvert.Height ),
PaintBuffer,
R );
PaintBuffer.CopyRect( R,
  BitMapToInvert.Canvas,
  Rect( 0, 0, BitMapToInvert.Width, 
 BitMapToInvert.Height ) );
BitMapToInvert.Free;
{$ELSE}
 
 You have first to declare a TBitMap named BitMapToInvert at
 .PaintSelection  var declarations:
BitMapToInvert: TBitMap;
 It is flickering but works fine inverting colors correctly.

Can you create a patch?
http://wiki.lazarus.freepascal.org/index.php/Creating_A_Patch


Mattias





 
 What I'm still investigating is to make SelectAll method to work.
 Any ideas are welcomed.
 
 Panagiotis
 
 
 From: Timothy Ha timh at jesuschrist.ru
 Subject: Turbopower IPro problem - selecting text in HtmlPanel
 Newsgroups: gmane.comp.ide.lazarus.general
 Date: 2005-11-10 22:46:25 GMT (10 weeks, 5 days, 23 hours and 17 minutes 
 ago)
 
 I was reading Christian U. message at
 http://www.mail-archive.com/lazarus at miraclec.com/msg01959.html and 
 would
 like to know the progress of using Turbopower Ipro to read HTML files.
 
 I could load a HTML into the HTML Panel, but got errors when tried to
 select a bit of text
 
 IpHtml.pas about line 7827 I've got
 
   {$IFDEF IP_LAZARUS}
   writeln('TIpHtml.PaintSelection  PatBlt not implemented');
   {$ELSE}
 
 As for loading text into HtmlPanel, this is what I did:
 
 procedure TForm1.Button1Click(Sender: TObject);
 var
   h: TIpHTML;
   f: TFileStream;
 begin
 h := TIpHTML.Create;
 f := TFileStream.Create('d:\my.html', 0);
 h.LoadFromStream(f);
 IpHTMLPanel1.SetHtml(h);
 end;
 
 How can I copy-paste text from Ipro HtmlPanel to other applications now?
 
 
 _
  To unsubscribe: mail [EMAIL PROTECTED] with
 unsubscribe as the Subject
archives at http://www.lazarus.freepascal.org/mailarchives

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


[lazarus] SVN Update: ChildSizing

2006-01-25 Thread Mattias Gaertner
The following properties now work:

TWinControl.ChildSizing.
  Layout, ControlsPerLine, EnlargeHorizontal, EnlargeVertical,
ShrinkHorizontal, ShrinkVertical

With these properties a TWinControl can automatically position its childs in
rows and/or columns.
An example are TRadioGroup and TCheckGroup, which layout code has been
removed and instead use the new properties.Advantage:
TRadioGroup columns can now have different sizes.
I also added the new property TCheckGroup.AutoFill.


Mattias

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