Re: newbie developer creating custom object
- From: Lars Clausen <lars raeder dk>
- To: Erik Knight <kutuzof gmail com>, discussions about usage and development of dia <dia-list gnome org>
- Cc:
- Subject: Re: newbie developer creating custom object
- Date: Sun, 24 Apr 2005 21:21:53 -0700
On Sat, 2005-04-23 at 14:25 -0400, Erik Knight wrote:
Hi everyone,
This is the first open source project I've ever worked on, so please
bear with me if I sound like a newb.
I plan to develop a custom object for Dia, similar to the UML objects.
I tried developing with just the .shape files and the text field
variable, but I need more customization than that. So I need to jump
into the C code.
Will happen at a certain complexity.
Ultimately I need:
1) a box that maintains a minimum size, but grows if too much text is added.
Several samples of this.
2) 4-6 text fields that can be edited by going into the properties
menu of the object.
Easy to add.
3) 2-3 text fields that derive from mathematical computations of the
previous text fields. These should auto update each time the above
text fields are modified.
Also easy. I expect these are displayed in the object, and are the text
being added to it.
4) an image with a fixed size. The source of the image file should be
modifiable from the properties menu of the object.
See standard/image for how to do this.
What I'm developing is pretty specific to my needs. (my girlfriends
father wants a program that lets him maintain seating arangements for
his students and keep track of their marks. And lets him easily print
out everything. I need something to impress him to make my girlfriend
happy)
A noble reason:) I hope it will help your girlfriends father
eventually.
I'm not sure if the open source community as a whole will benefit, but
I do plan on documenting my progress and maybe this could become a
HOW-TO for developing custom Dia objects.
That alone would make it a useful contribution.
My question to you fine folks, is where is a good place to start? I've
already read through object.h and object.c and I've started skimming
through some of the other files. RIght now I'm thinking of starting by
modifying the chronogram or UML objects.
Do *not*, I repeat, do *not* base your object on the UML class object,
it is a very bad example. The UML small package or large package may be
of help, though. The chronogram objects are highly specialized and
would probably be confusing to work from.
I have found the Wiki by Lars Clausen on writing programmed objects,
are there any other turorials or how-tos that exist out there?
The Wiki is most of the separate documentation, feel free to add to it.
For something to use as an example for your object, I'd suggest the
Istar other or Jackson domain, if you want the user to be able to add
some text directly.
You'll mainly need to understand the basics of properties and make good
update and draw functions. The rest, including load and save, is mostly
boilerplate. I would suggest starting from a simple object rather than
a complex one.
-Lars
--
Lars Clausen <lars raeder dk>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]