Movie Database - personal edition
Looks better, it's getting there.
My only 'beef' is the amount of flicker. For example, bring up the edit records dialogue and then (without closing the dialogue) hit the 'edit records' toolbar button again. See what I mean? Could be just my system I guess, although it's perhaps worth checking out.
My only 'beef' is the amount of flicker. For example, bring up the edit records dialogue and then (without closing the dialogue) hit the 'edit records' toolbar button again. See what I mean? Could be just my system I guess, although it's perhaps worth checking out.
I may look like a mule, but I'm not a complete ass.
- netmaestro
- PureBasic Bullfrog
- Posts: 8451
- Joined: Wed Jul 06, 2005 5:42 am
- Location: Fort Nelson, BC, Canada
I know why it does that, it's always closing the active window and opening the next chosen one if it gets a toolbar button press, it isn't checking to see if that one's already open. I'll add that and it won't do it anymore. That's easy, now if you can help me get the flicker out of the listicon in browse mode as a result of resizing, bring it on, baby!
BERESHEIT
This was one of the reasons why I opted to take over all aspects of painting the client area with the egrid library as PB (perhaps it's the Windows default) does generate a lot of flicker when resizing coloured list icons.netmaestro wrote:... now if you can help me get the flicker out of the listicon in browse mode as a result of resizing, bring it on, baby!
With this I was able to dispense with all default processing of #WM_ERASEBKGND (and indeed egrid simply kills this message). This did require that I take steps to erase all 'unused' areas of the client area with the default windows colour but the end product is a far far smoother grid.
There are of course other ways, but I think they all involve quite a bit of work.
Last edited by srod on Wed Jan 17, 2007 1:19 pm, edited 1 time in total.
I may look like a mule, but I'm not a complete ass.
- netmaestro
- PureBasic Bullfrog
- Posts: 8451
- Joined: Wed Jul 06, 2005 5:42 am
- Location: Fort Nelson, BC, Canada
There is a flicker when opening and closing database windows.
When a window is open (like edit records), the toolbar window can't be moved. Yet it still works.
The "titlebar" of the toolbar window looks at the right side. (Is there a reason you don't use a standard window border?)
At the bottom of the toolbar window there is a grey line. Unless it does something, it should have the default window colour.
The grey parts of the diskette toolbar button image are actually transparent, so the diskette doesn't look good when another window colour than grey is selected.
When the program is first opened, the statusbar text shows the filename without the path, if you select another database the statusbar incudes the path.
The window position and state is not saved.
The position of the toolbar window isn't saved.
If you open a database window, then starts to select a new database, but clicks cancel, the database window shouldn't close.
It's not clear that the "seek" button has anything to do with the "search" text field, it should be positioned beside it.
Also, it's not clear what the red X does. Does it delete the record count, since it placed right behind it? Or does it simply cancel and closes the window without updating? Better make a normal text button which says "delete". You can also be sure that a lot of users will close the window without clicking update. And when the window background is set to red, it doesn't show at all.
You play a sound and show a message when a database entry is added. Firstly, I've set my sound theme to no sounds because I don't want to hear any sounds, second, there is no need to tell the user that a basic operation completed successfully. It's like showing a message box saying "The page is loaded" in Firefox.
In the help file you use "MS Sans Serif" some places. Don't use that font, because if the user enables antialiasing that font still isn't antialised.
If you try to close the main window when a child window is open, the child window is closed instead.
When a window is open (like edit records), the toolbar window can't be moved. Yet it still works.
The "titlebar" of the toolbar window looks at the right side. (Is there a reason you don't use a standard window border?)
At the bottom of the toolbar window there is a grey line. Unless it does something, it should have the default window colour.
The grey parts of the diskette toolbar button image are actually transparent, so the diskette doesn't look good when another window colour than grey is selected.
When the program is first opened, the statusbar text shows the filename without the path, if you select another database the statusbar incudes the path.
The window position and state is not saved.
The position of the toolbar window isn't saved.
If you open a database window, then starts to select a new database, but clicks cancel, the database window shouldn't close.
It's not clear that the "seek" button has anything to do with the "search" text field, it should be positioned beside it.
Also, it's not clear what the red X does. Does it delete the record count, since it placed right behind it? Or does it simply cancel and closes the window without updating? Better make a normal text button which says "delete". You can also be sure that a lot of users will close the window without clicking update. And when the window background is set to red, it doesn't show at all.
You play a sound and show a message when a database entry is added. Firstly, I've set my sound theme to no sounds because I don't want to hear any sounds, second, there is no need to tell the user that a basic operation completed successfully. It's like showing a message box saying "The page is loaded" in Firefox.
In the help file you use "MS Sans Serif" some places. Don't use that font, because if the user enables antialiasing that font still isn't antialised.
If you try to close the main window when a child window is open, the child window is closed instead.
How you resize your listicon to get that flicker I've got no idea, it doesn't happen here:
Code: Select all
OpenWindow(0, 100, 100, 300, 100, "ListIcon Example", #PB_Window_SystemMenu | #PB_Window_ScreenCentered | #PB_Window_SizeGadget)
CreateGadgetList(WindowID(0))
ListIconGadget(0, 5, 5, 290, 90, "Name", 100, #PB_ListIcon_FullRowSelect|#PB_ListIcon_AlwaysShowSelection)
AddGadgetColumn(0, 1, "Address", 250)
AddGadgetColumn(0, 2, "A2", 250)
AddGadgetColumn(0, 3, "A3", 250)
AddGadgetColumn(0, 4, "A4", 250)
For I = 0 To 200
AddGadgetItem(0, -1, "Harry Rannit" + #LF$ + "12" + #LF$ + "Parliament Way" + #LF$ + "Battle Street" + #LF$ + "By the Bay")
Next
For I = 0 To 200 Step 2
SetGadgetItemColor(0, I, #PB_Gadget_BackColor, $CCCCCC)
Next
Repeat
Select WaitWindowEvent()
Case #PB_Event_SizeWindow
SendMessage_(GadgetID(0), #WM_SETREDRAW, 0, 0)
ResizeGadget(0, 0, 0, WindowWidth(0), WindowHeight(0))
SetGadgetItemAttribute(0, 0, 1, WindowWidth(0)/5, 0)
SetGadgetItemAttribute(0, 0, 1, (WindowWidth(0)/5)-20, 1)
SetGadgetItemAttribute(0, 0, 1, WindowWidth(0)/5, 2)
SetGadgetItemAttribute(0, 0, 1, WindowWidth(0)/5, 3)
SendMessage_(GadgetID(0), #WM_SETREDRAW, 1, 0)
SetGadgetItemAttribute(0, 1, #PB_ListIcon_ColumnWidth, WindowWidth(0)/5, 4)
Case #PB_Event_CloseWindow
Break
EndSelect
ForEver
Looking again I see what Trond means! I didn't realise the flicker was quite this bad!
Even with Trond's example scaled down to just a simple ResizeGadget() without the WM_SETREDRAW's and SetGadgetItemAttribute() there is still little flicker.
In fact, resizing the window containing the movie browser, you sometimes see that the non-client area of the window is sometimes delayed in being repainted, suggesting a massive loop in progress. I would guess netmaestro that your code is doing something which is causing a massive amount of repainting/erasing, perhaps to do with the way your dynamically resizing columns etc.
Even with Trond's example scaled down to just a simple ResizeGadget() without the WM_SETREDRAW's and SetGadgetItemAttribute() there is still little flicker.
In fact, resizing the window containing the movie browser, you sometimes see that the non-client area of the window is sometimes delayed in being repainted, suggesting a massive loop in progress. I would guess netmaestro that your code is doing something which is causing a massive amount of repainting/erasing, perhaps to do with the way your dynamically resizing columns etc.
I may look like a mule, but I'm not a complete ass.
@Netmaestro: may be you should redesign the database structure.
for example, if you want to store more than two actors:
Main Table: ID, MovieName, imdb, year, genreID
Actor-Table: ID, Name, Remark
Link-Table: ID_Movie, ID_Actor
its called database normalization.
Look here : http://en.wikipedia.org/wiki/Database_normalization
for example, if you want to store more than two actors:
Main Table: ID, MovieName, imdb, year, genreID
Actor-Table: ID, Name, Remark
Link-Table: ID_Movie, ID_Actor
its called database normalization.
Look here : http://en.wikipedia.org/wiki/Database_normalization
- netmaestro
- PureBasic Bullfrog
- Posts: 8451
- Joined: Wed Jul 06, 2005 5:42 am
- Location: Fort Nelson, BC, Canada
@Trond, thx for suggestions, I'm going to implement most if not all, but I haven't got it done yet. The new version fixes most resize bugs in the browse window and adds quickjump functionality to the sorted columns. I'm going to be switching the Browse listicon for an eGrid soon.
New version available, more functions in Browse mode, link in first post.
New version available, more functions in Browse mode, link in first post.
BERESHEIT
- netmaestro
- PureBasic Bullfrog
- Posts: 8451
- Joined: Wed Jul 06, 2005 5:42 am
- Location: Fort Nelson, BC, Canada
- netmaestro
- PureBasic Bullfrog
- Posts: 8451
- Joined: Wed Jul 06, 2005 5:42 am
- Location: Fort Nelson, BC, Canada
New version available, column resizing added, a couple new features and a big fat easter egg - When this app gets released, this won't be published but for now, if you browse the sample database included with this version and find the movie I'm starring in, then double-click it like you were going to pull up the IMDB page for it, you will find the egg. Have fun with it!
BERESHEIT