Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2001-02

New components needed

17 messages · 11 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Shane Miller

TImage would be fairly easy. Components like TButton, TEdit are REAL easy because there is a coresponding component in GTK. All you do is create a constant (like csbutton or csedit) that tells the widget seet what to create, then in gtkobject's CreateComponent you add an entry to the case statement

csEdit : p := gtk_edit_new;

Whith TImage I don't think thee's a coresponding component so it's a little more difficult but not much. You just ahve to decide waht a TImage is. Really it's just a canvas you can draw on with functions to load images.

Shane

Earlier message 16 lines
-----Original Message----- From: FoodTechnologist To: Date: Friday, February 09, 2001 4:04 AM Subject: [lazarus] New components needed >As far as I see, some everyday components (such as TImage) are not availabe >yet. >Let's make it! I don't think this to be too difficult. > >_________________________________________________________________ > To unsubscribe: mail with > "unsubscribe" as the Subject > archives at http://www.miraclec.com/list_archives/lazarus >

Reply by email

Florian Klaempfl
to Vincent Snijders: I have uploaded a small test program to show this bug. Some speedbuttons in the IDE…
you wrote 13 lines
Vincent Snijders wrote: > > I hope this may help in finding the cause of this bug, because IMHO > this bug makes lazarus unworkable on win32. Hmmm. Interesting. This statement seems to imply that you at least can getting working in some fashion. I tried to do a build of the IDE in Win32 and it runs but all of the windows are empty except for the speed buttons. Do you see more of the screen? Do you see the menus, tabs, etc. etc.? Can you use the editor? Just curious because I wasn't sure if it was my machine or if it was the build itself.

It isn't your machine, I'd the same problem a few days ago. But Vincent seems to give a glue what the problem is.

Reply by email

Vincent Snijders
to Vincent Snijders: I have uploaded a small test program to show this bug. Some speedbuttons in the IDE…
Show quoted text 11 lines
>Hmmm. Interesting. This statement seems to imply that you at least can >getting working in some fashion. I tried to do a build of the IDE in >Win32 and it runs but all of the windows are empty except for the speed >buttons. Do you see more of the screen? Do you see the menus, tabs, etc. >etc.? Can you use the editor? > >Just curious because I wasn't sure if it was my machine or if it was the >build itself. It isn't your machine, I'd the same problem a few days ago. But Vincent seems to give a glue what the problem is.

I made some changes to main.pp to get it working in win32. I replaced the picture om most of the speedbuttons with a tedt picture and enabled all of them.. I also removed the first two component pages, because some of the components had 'bad' (redraw causing) glyphs.

This modified main.pp can be downloaded from
ftp://lazarus.freepascal.org/lazarus/main.pp
With this file you can make lazarus and see 'almost' the same as under linux.

Vincent

Reply by email

Robert Scott Horning
to Unknown author: There is a TGtkImage widget in GTK, so TImage should be really easy as well; Only you…
Show quoted text 27 lines
On Fri, 9 Feb 2001, Shane Miller wrote: > TImage would be fairly easy. Components like TButton, TEdit are REAL easy > because there is a coresponding component in GTK. All you do is create a > constant (like csbutton or csedit) that tells the widget seet what to > create, then in gtkobject's CreateComponent you add an entry to the case > statement > > csEdit : p := gtk_edit_new; > > Whith TImage I don't think thee's a coresponding component so it's a little > more difficult but not much. You just ahve to decide waht a TImage is. > Really it's just a canvas you can draw on with functions to load images. There is a TGtkImage widget in GTK, so TImage should be really easy as well; Only you would still have to provide conversion routines for various formats as GTK works with xpm mostly. Michael > Shane > > > >As far as I see, some everyday components (such as TImage) are not availabe > >yet. > >Let's make it! I don't think this to be too difficult. > >

Before you get all in a hurry to reimplement the TImage component, please take a look at the TGraphic object first. The really nice thing about this object class hierarchy is that it addresses a common interface for all graphical image formats (for example, a TPNG and TGIF library is already available, and Borland included a TJPG library that wouldn't be TOO difficult to reimplement). Remember, these are native libraries, as opposed to grabbing an image from the OS, such as using bonabo or DirectDraw. Wrappers can be written to even accommodate such instances, and it all is encompassed by the TGraphic class, which TImage uses to do all of its processing. All of the TGraphic libraries are self-registering as well (that I've used) so all you need to do is include the unit with your source code (in the uses declaration or in the project file) and then your software now has support for that file format.

This is particularly powerful when you are writing graphical editing software (as I've done a bit in the past) and then you extend the capabilities without having to re-code everything. Delphi also has the TOpenPictureDialog and TSavePictureDialog classes using the TGraphic information for the supported file types and for the image preview, as well as being able to use the clipboard in a considerably easier fashion, together with stream and general file I/O support.

What I'm getting at is that this is not a tiny project, but it can also be broken up into smaller pieces for getting it to work properly. To start with, working with uncompressed bitmaps would be strongly recommended (not necessarily Windows Bitmap format... although that may also be a possibility) and then gradually add additional support. The TGIF stuff is a part of the JEDI project now (I'm not sure about the license, but he is giving away the source code), and I believe that TPNG has been GPL'd, so we might be able to add that directly into Lazarus anyway.

Doing stuff like this on the Windows side is also pretty easy to do natively (on the API side), and it would be worthwhile to see what kinds of stuff we'd like to do with it. In addition, the TCanvas object is closely related to a TGraphic object as well, which should make designing custom components quite a bit easier to do as well, from a component designer's viewpoint.

Robert Scott Horning Trans-Lux West 1651 North 1000 West Logan, Utah 84321 Phone: (435) 716-8696 FAX: (435) 752-8513 E-mail:

Reply by email

Vincent Snijders

Hi,

I have uploaded a small test program to show this bug. Some speedbuttons in the IDE behave well, but for example the viewforms and viewunits speedbutton cause a repeat in drawing. Maybe those should be recreated, but I don't know how that could be done.

The test program lets you show a good speedbutton with a tedit.xpm button face and a bad speedbutton with a viewunits.xpm.

To test thing in lazarus's main.pp, I replaced all bad xpm's with tedit.xpm, but when a speedbuttons is disabled, the redrawing starts again.

I hope this may help in finding the cause of this bug, because IMHO this bug makes lazarus unworkable on win32.

Vincent Snijders

-------------- next part --------------
A non-text attachment was scrubbed...
Name: zip00000.zip
Type: application/octet-stream
Size: 2901 bytes
Desc: "spdbtns.zip"
Url : http://localhost/pipermail/lazarus/attachments/20010208/7bce945f/zip00000.obj

Reply by email

Unknown author
to Shane Miller: TImage would be fairly easy. Components like TButton, TEdit are REAL easy because there…
Shane Miller wrote 11 lines
TImage would be fairly easy. Components like TButton, TEdit are REAL easy because there is a coresponding component in GTK. All you do is create a constant (like csbutton or csedit) that tells the widget seet what to create, then in gtkobject's CreateComponent you add an entry to the case statement csEdit : p := gtk_edit_new; Whith TImage I don't think thee's a coresponding component so it's a little more difficult but not much. You just ahve to decide waht a TImage is. Really it's just a canvas you can draw on with functions to load images.

There is a TGtkImage widget in GTK, so TImage should be really easy as well; Only you would still have to provide conversion routines for various formats as GTK works with xpm mostly.

Michael

Show quoted text 24 lines
Shane -----Original Message----- From: FoodTechnologist To: Date: Friday, February 09, 2001 4:04 AM Subject: [lazarus] New components needed >As far as I see, some everyday components (such as TImage) are not availabe >yet. >Let's make it! I don't think this to be too difficult. > >_________________________________________________________________ > To unsubscribe: mail with > "unsubscribe" as the Subject > archives at http://www.miraclec.com/list_archives/lazarus > _________________________________________________________________ To unsubscribe: mail with "unsubscribe" as the Subject archives at http://www.miraclec.com/list_archives/lazarus

Reply by email

Michael A. Hess
to Vincent Snijders: I have uploaded a small test program to show this bug. Some speedbuttons in the IDE…
Vincent Snijders wrote
I hope this may help in finding the cause of this bug, because IMHO this bug makes lazarus unworkable on win32.

Hmmm. Interesting. This statement seems to imply that you at least can getting working in some fashion. I tried to do a build of the IDE in Win32 and it runs but all of the windows are empty except for the speed buttons. Do you see more of the screen? Do you see the menus, tabs, etc. etc.? Can you use the editor?

Just curious because I wasn't sure if it was my machine or if it was the build itself.

==== Programming my first best destiny! ==== Michael A. Hess Miracle Concepts, Inc. http://www.miraclec.com

Reply by email

Shane Miller

Why are you implementing it as a customcontrol? Why not use the GTKImage control? Shane

>> 02/10/01 02:17AM >>>

I'm trying implement TImage not as widget control, but as custom control. You've just implemented bitmaps (oof!! it is very poor!!). So, I need only TPicture and TImage. The problem is TBitmap drawing, it has property Canvas, but when should it be attached?
Yesterday I've got Access violation. I'll try debugging.

_________________________________________________________________ To unsubscribe: mail with
"unsubscribe" as the Subject
archives at http://www.miraclec.com/list_archives/lazarus

Reply by email

Vincent Snijders
to Vincent Snijders: I have uploaded a small test program to show this bug. Some speedbuttons in the IDE…
This modified main.pp can be downloaded from ftp://lazarus.freepascal.org/lazarus/main.pp

Micheal Hess suggested

Maybe you should put some temporary #ifdefs in the code for this section so that it can stay with the main code in CVS.
I have done as you suggested, if I understood you right.
I put this code at the top of main.pp:
{$ifdef win32}
  {$define spdbtnworkaround}
{$endif}
I add my code in ifdefs like, keep the original in the else clause:
{$ifdef spdbtnworkaround}
  if not LoadResource('tedit',Pixmap1) then
{$else}
  if not LoadResource('btn_viewunits',Pixmap1) then
{$endif}

Attached is a diff-file, so you can apply this as a temporary patch, till someone has found out, why some pixmaps cause this problem.

Vincent Snijders

-------------- next part --------------
A non-text attachment was scrubbed...
Name: bin00000.bin
Type: application/octet-stream
Size: 1669 bytes
Desc: "main.pp.diff"
Url : http://localhost/pipermail/lazarus/attachments/20010210/7e045a0c/bin00000.bin

Reply by email

FoodTechnologist
to Shane Miller: Why are you implementing it as a customcontrol? Why not use the GTKImage control? Shane…

Shane Miller �����:

Show quoted text 19 lines
Why are you implementing it as a customcontrol? Why not use the GTKImage control? Shane >>> 02/10/01 02:17AM >>> I'm trying implement TImage not as widget control, but as custom control. You've just implemented bitmaps (oof!! it is very poor!!). So, I need only TPicture and TImage. The problem is TBitmap drawing, it has property Canvas, but when should it be attached? Yesterday I've got Access violation. I'll try debugging. _________________________________________________________________ To unsubscribe: mail with "unsubscribe" as the Subject archives at http://www.miraclec.com/list_archives/lazarus _________________________________________________________________ To unsubscribe: mail with "unsubscribe" as the Subject archives at http://www.miraclec.com/list_archives/lazarus

1. I'm not very strong in gtk programming.
2. There is a property 'TImage.Picture.Bitmap' and I don't know how to implement it with control

I think, I'll have to implement a gtk control, as lazarus's TBitmap is too poor! I even can't load it from xpm! (LoadFromXPM crushes).

Reply by email

Marc Weustink
to FoodTechnologist: Shane Miller �����: 1. I'm not very strong in gtk programming. 2. There is a…

+ From: FoodTechnologist
+
+ 1. I'm not very strong in gtk programming.
+ 2. There is a property 'TImage.Picture.Bitmap' and I don't
+ know how to implement it with control
+
+ I think, I'll have to implement a gtk control, as lazarus's
+ TBitmap is too poor! I even can't load it from xpm! (LoadFromXPM crushes).

What (GTK) error messages do you get ?

Marc

Reply by email