[lazarus] SVN Update: ChildSizing
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
Re: [lazarus] Turbopower IPro problem - selecting text in HtmlPanel
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 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 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
Re: [lazarus] Turbopower IPro problem - selecting text in HtmlPanel
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 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 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] TrayIcon preview
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] TrayIcon preview
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), I suggest creating a minimal one and converting/putting that (hmm, might later want to dynamically load them because not everyone uses X11 together with gtk+ - though the majority does): Screen* gdk_x11_screen_get_xscreen (GdkScreen *screen); > fDisplay := GDK_DISPLAY; that looks like an incomplete cast to me... does it work? (or is it the non-multihead-safe-gdk-version exported global gdk_display variable?) (GdkDrawable methods work on a GdkWindow) Display *gdk_x11_drawable_get_xdisplay(GdkDrawable *drawable); > // SHowMessage(IntToStr(Integer(fDisplay))); > Widget := PGtkWidget(GtkForm.Handle); ok > fWindow := PX11GdkDrawable(PGdkWindowObject(Widget^.window)^.impl)^.xid; ok (O_o is GDK_WINDOW_XID missing too? :)) #define GDK_WINDOW_XID(win) (gdk_x11_drawable_get_xid (win)) XID gdk_x11_drawable_get_xid (GdkDrawable *drawable); (XID being just "Window" from X I think) > fScreen := XDefaultScreenOfDisplay(fDisplay); // get the screen um... this is evil. > fScreenID := XScreenNumberOfScreen(fScreen); // and it's number gintgdk_screen_get_number (GdkScreen *screen); > > But the Icon doesn´t show (I have no idea why). Is space for the icon allocated in the tray - i.e. is there a "hole" ? - and it just doesnt draw or doesn't "anything" happen? In your version, check the value of fWindow and use "xwininfo -id x" to see if it's correct... Most of those kind of problems with lowlevel X stuff not getting executed properly have to do with the widget not being realized yet... Might want to make double-sure that it is :) > > Any help is appreciated =) > > thanks, > -- > Felipe Monteiro de Carvalho cheers, Danny _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] TAChart and Parabola graph
Ok, all rigth, it is another also variant word for my dictionary and vocabulary. - Original Message - From: "Graeme Geldenhuys" <[EMAIL PROTECTED]> To: Sent: Wednesday, January 25, 2006 5:10 AM Subject: Re: [lazarus] TAChart and Parabola graph We develop mathematical products, and our math experts told me it is a "parabola" that they need. I added the "graph" bit. :-) http://dictionary.reference.com/search?q=parabola [A plane curve formed by the intersection of a right circular cone and a plane parallel to an element of the cone or by the locus of points equidistant from a fixed line and a fixed point not on the line.] Maybe I should have said a "parabolic curve", it does sound better. Anyway, thanks to everybody for the information. I will try out the TAChart component. Regards, - Graeme - PS: I like your ASCII chart. Pretty good! On 1/25/06, Prof. Paulo Amaral <[EMAIL PROTECTED]> wrote: Function second grade y = ax2 + bx + c is parable graph (isn't "parabola", is parable in english) ' ' '' '' x ' ' | ' ' | ' y - Original Message - From: "Marc Santhoff" <[EMAIL PROTECTED]> To: Sent: Tuesday, January 24, 2006 2:30 PM Subject: Re: [lazarus] TAChart and Parabola graph > Am Dienstag, den 24.01.2006, 12:04 +0200 schrieb Graeme Geldenhuys: >> Hi, >> >> Does anybody know if the TAChart component supports the Parabola >> graph? If not, is there any other Lazarus or Free Pascal componet >> that can be used? > > I don't understand, you want to draw the graph of a parabolic function? > If so, yes, TAGraph supports arbitrary plot data. The example program > itself (in the package) does in fact draw a parabolic curve: > >>From the source: > > var > Serie:TTASerie; > i:Integer; > begin > Serie:=TTASerie.Create(TAChart1); > TAChart1.AddSerie(Serie); > Serie.ShowLines:=CheckBox3.Checked; > Serie.ShowPoints:=CheckBox2.Checked; > Serie.Title:='Sqr'; > for i:=-5000 to 5000 do > Serie.AddXY(i/10,Sqr(i/10)/1000,clRed); > > HTH, > Marc > > > _ > To unsubscribe: mail [EMAIL PROTECTED] with >"unsubscribe" as the Subject > archives at http://www.lazarus.freepascal.org/mailarchives > > > _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] setColor patch
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 < 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.Color<>clNone) 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.Name<>DefFontData.Name) or (AWinControl.Font.Size<>0) 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 Widget<>nil then begin - ClientWidget:=GetFixedWidget(Widget); - if ClientWidget=nil then -ClientWidget:=Widget; -end; AWindow:=Drawable; DCOrigin:=GetDCOffset(TDeviceContext(DC)); Area.X:=ARect.Left+DCOrigin.X; @@ -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 @@ TheWinControl.CNPreferredSizeChanged;
Re: [lazarus] TAChart and Parabola graph
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