-
Notifications
You must be signed in to change notification settings - Fork 0
002_PAGE blocks
Now we come to the chapter we can actually set up the true database. Please note, most MyData files have multiple page blocks, and they are defined like this:
[PAGE:My Page]
This will cause MyData to open a new tab and all fields can then be added, and if you want a new page simple start a new [PAGE] block with a new name and add your fields there. A few notices are to be taken in order though:
- As the Mono version of MyData uses the GTK# framework which in turn uses GTK it is not really set to specific sizes, and therefore it should try to resize the window when there are too many fields on a page to fit in the window. MyData does not check for this, so you need to keep track of this yourself.
- The [PAGE] system also serves to keep your stuff well-organized, use it wisely.
- Take good note on how you organize it, as systems like these are easily turned into a mess... No exceptions, so MyData isn't an exception either.
- GTK# does not really handle lack of space caused by long page names or an overuse of pages well, causing tabs to fall out of the window if you do not take proper care.
Adding fields to a page is a bit inspired on the way you declare variables in C, however you do not close each line with a ; and you cannot set up really complex setups. Just a typename and the field name. The types MyData will support are "string", "int", "double", "bool", "color", "mc", "date", "time", and there are the special types "strike", "info" and some item types prefixed with a "@". Well if you just type "string Name" then a string field named "name" will be created. When you'd use MyData for your own personal adress book with additional data (hey, it's possible), you could set it up like this.
[PAGE:People]
string Name
string Postal_Address
string City
string PostalCode
string Country
date Born
mc Gender
@i Male
@i Female
bool Married
int HeightCM
I guess this looks easy. Let's break this down shall we...
- string: Any form of text
- int: Any integer number
- double: Numbers requiring decimals
- bool: Can contain either 'true' or 'false', and that will show in radio buttons in MyData
- date: Field showing a date (planned)
- time: Field showing time (planned)
- color: Allow colors to be added in RGB format
- mc: Multiple Choice - Will give the user choices and the 'subtypes' decide which items there will be (mc will export as string)
- @i: Just add a simple item
- @f: Add files in a folder (works recursively).
- @f: Alternately you can in stead of a folder also refer to a JCR6 resource file (and WAD and QuakePAK is also supported, but those are just added well, because it was just adding 1 extra line of code) :P
- @db: Add all names of records of an other database file as choices (it's strongly recommended only to refer to databases in the same folder).
- Now there are a few more features to this for advanced users, which may be added to this documentation later.
Well, I guess that covers it all... ;)