Re: System Tray, Full Screen and Sort By
Posted by webmaster Guido on January 14, 2003 at 13:01:40:
In Reply to: System Tray, Full Screen and Sort By posted by Fejab01 on January 14, 2003 at 08:33:35:
: 3 things.
: 1. Can you make a delphi program go fullscreen at all? not maximised, i mean fullsreen like a game (im trying 2 make an interface and menu 4 a game).
: 2. Can you make a program reside in the System Tray, say like winamp or MSN or something of the like?
: 3. I'm not completely stupid, but can someone either give me a Sort by Name code snippit or algorithm or tell me how to sort by name in a column using TTable (without having a index key)
Everything that's possible in C++ (or Visual Basic or whatever high-level language) can also be done in Delphi :)
1. Yes, it's possible to show an application full-screen, without a title-bar and thus no border-icons (the system menu and minimize/ restore/ maximize buttons in the top corners). Try this example:
procedure TForm1.FormCreate(Sender: TObject); begin BorderStyle := bsNone; // remove borders and titlebar WindowState := wsMaximized; // go fullscreen end;
2. Yes, you can move a Delphi program to the tray icon. You can even hide a Delphi application from the taskbar and/or from the tasklist (the list of active programs that you get with ctrl-alt-del).
3. Sorting a TTable without using an index can be done, but not with just one or a couple of simple commands. You would have to write quite a complex procedure for this.
In database-language, by "sorting" we mean physically re-ordering the records. Usually sorting is done by writing a *new* table with the same records but in a different order, next delete (or rename) the original table, next give the original name to the new sorted table. And each time that a record is changed afterwards, you have to repeat the entire process if you want to keep the table sorted. That's why physically "sorting" a table is almost never done, except in a few cases when the result is not changed anymore after the sorting, if you use the table as read-only afterwards.
"Indexing" on the other hand does not involve any physical re-ordering of the records, it's a lot faster, and it's quite automatic. An external "index" file is created automatically by the database-system, in which it records the order for accessing and showing records. And you don't have to "re-index" each time a record is changed, the database-system automatically keeps the index up-to-date.