Page 3 of 4
Posted: 2008-05-21 23:51:48
by bad4u
What about the ' ... or (Win32MajorVersion > 5)); ' from the first line of code - I guess it has to be deleted when I add the second line of code ?
Posted: 2008-05-22 07:38:35
by antp
The first test checked if it was =5 and >.1 (5.1 = XP) or if it was >5 (vista and next ones).
As Vista is 6.0 you just have to check that it is >5
Posted: 2008-05-22 07:49:45
by antp
I checked on Vista (with default Vista theme and most of the settings set to default) : all fields display fine

So I guess it is either related to Vista PE, or to the fact that you were using the "old Windows" theme ?
Posted: 2008-05-22 11:03:32
by bad4u
That's good news ! Maybe I should install Vista Home on my notebook or a virtual machine to be able to do some more tests with game catalog. It's just that I successfully avoided using Vista yet.. damned
About the 'old Windows' theme - you mean switching AMC to another icon theme (XP) or changing something on Vista ? Not sure if that would be possible on PE, as it is only a restricted system. So it might be a PE problem, but that's not important if catalog runs properly on standard versions.
Posted: 2008-05-22 11:54:15
by antp
I mean in Vista itself. Maybe in the PE version you cannot get the new themes indeed, I should try to switch to classic theme on the Vista PC then...
Posted: 2008-05-23 19:24:18
by bad4u
When compiling/building game catalog executable, it runs to the end and seems to work fine, but I always get these two warning messages:
Code: Select all
[Warning] FR_Intrp.pas(119): Symbol 'NewStr' is deprecated
[Warning] FR_Intrp.pas(181): Symbol 'DisposeStr' is deprecated
On the code the lines look like:
Code: Select all
(119) p^.Name := NewStr(Name);
(181) DisposeStr(p^.Name);
I got the same messages when compiling AMC, so maybe it's because of the Personal Edition and FreeReport again - but does it affect the program itself (as it is only a 'Warning') ? Any idea how I could test for this ?
Posted: 2008-05-23 19:50:53
by antp
It is not a big problem, these warnings are there because these functions should not be used anymore, they are replaced by other ones. But they still should work fine, they are kept in Delphi for compatibility purposes with old code.
In such case it is safer to continue to use it as it is, especially since I am not sure on how to modify the code, since I did not write it

Posted: 2008-05-24 17:16:21
by bad4u
Good to know

Posted: 2008-05-26 20:36:21
by bad4u
Two short questions, just for understanding:
On unit FileManager there is this function:
Code: Select all
function TFileManager.CheckUnsavedFile: Boolean;
begin
Result := True;
if Modified and FAskToSave then
case MessageWin.Execute(FMessageSaveQuery + IfThen(FCurrentFile <> '', sLineBreak + sLineBreak + FCurrentFile), mtConfirmation, [mbYes, mbNo, mbCancel]) of
1:
Result := Save;
0,3:
Result := False;
end;
if Result and Assigned(FOnCloseFile) then
FOnCloseFile(Self);
end;
1. Why are results (from unit messageform) only 1, 0 and 3 ? I know that buttons are an array[0..3], but with only three buttons on the messagewindow (Yes, No, Cancel) I thought it should result in 0, 1 and 2..
2. As 1 means Yes, where can I see which one is 0 and 3 ? (as far as I know, result is 0 when window is closed by corner button, too, so it should be same as Cancel)
Posted: 2008-05-27 06:23:06
by antp
buttons results are 1..3, not 0..2 nor 0..3

it is not very "natural" but I wanted to have the possibility to "chose" what to do when the window was closed, even if in most of the cases it is linked to 'Cancel' (or 'No' if there is no 'Cancel').
0 is as you said when the user closes with the corner button.
so 0 and 3 are for cancelling here
1 is "yes", so saving
2 is "no", not saving, nothing special to do then.
Posted: 2008-05-27 06:35:33
by bad4u
antp wrote:2 is "no", not saving, nothing special to do then.
That's what I missed. I thought button "no" and "cancel" should deliver "false" , but if "no" is 2 it delivers third case "true" as a result ^^
And thanks again

Posted: 2008-06-01 16:08:59
by bad4u
As I'm going through the code to see what I don't need or should be changed, there are some more questions coming up..
1. Function CheckVersion on file Global.pas uses a variable CurVersion, that could be set when calling the function, but it seems not to be used on the program, so it's always set to settings.version. Is it correct, when this variable should be set from functions call, it would support only version numbers (major/minor..) < 10, as it reads only single numbers from the string [like Major = (Integer(CurVersion[1]) - Zero)] ?
2. The file import.pas isn't neccessary any more, I guess ? Could it be deleted from the project or did I oversee something (I did not find any declaration 'Uses import') ?
3. What about procedure GetPicture2 - has it been forgotten on the helpfile or is there another reason that it should not be used (it supports referer) ?
4. I have a problem with the icon of my catalog files

When I started the project catalogs were still .amc format, later I changed file extension to .sgc (and some fields inside), and the button 'Repair file associations' works fine, too. I thought I changed all icons, but I still have the AMC icon on my catalogs instead of a game catalog icon and did not find out how to change this.. shouldn't the icon be taken from the associated program ? Maybe I did oversee something ? Or is it a windows problem (maybe caching) ?
Posted: 2008-06-01 16:26:18
by antp
1. Indeed. But I never use numbers >9 in my versions, as this is confusing to have 3.10 vs 3.2.0 for example. In Ant Renamer 2, I merged the 2nd and 3rd number simplify versioning. So instead of a.b.c.d I have a.bc.d, I increase bc for new features and d for bug fixing, allowing up to 99 versions with new features which do not justify a really new major version (you still follow me? It is maybe not very clear

)
The day I will make AMC 4 I was planning to use same version style as Ant Renamer.
2. Indeed it could be deleted, it has been replaced by import2.
3. On my desk on my to-do list I still have the item "update AMC help file" :whistle:
4. in the res\icons folder, it is the "icon_doc.ico" file which contains the file used for .amc files. Once you modified this .ico file (which contains six images: 16x16, 32x32, 48x48 in both 16 and 256 colors), run icons.bat to recreate the icons.res file in AMC's code folder. You may have to close and reopen the project to have Delphi reinclude this new res file in the exe.
Posted: 2008-06-01 16:52:23
by bad4u
antp wrote:In Ant Renamer 2, I merged the 2nd and 3rd number simplify versioning. So instead of a.b.c.d I have a.bc.d, I increase bc for new features and d for bug fixing, allowing up to 99 versions with new features which do not justify a really new major version (you still follow me? It is maybe not very clear

)
It's pretty clear

And this is similar of what I was thinking of - I wanted to increase one number more often (for minor feature or layout updates) that should not become a new major version. This number could exceed '9', so I will have to change this procedure.. it should not be a big problem to do this, I think.
About the icons, I will have a look on it the next days, as I wanted to create a new icon set for the first release (the current one has errors on some resolutions because of unclear transparent backgrounds ^^)
Thank you!
Posted: 2008-06-01 18:26:07
by antp
bad4u wrote:(the current one has errors on some resolutions because of unclear transparent backgrounds ^^)
You mean the one of AMC or the one you made?
Posted: 2008-06-01 18:50:15
by bad4u
The ones I rendered for my first tests

Posted: 2008-06-02 20:31:32
by bad4u
On file fields.pas there is a function named GetFieldSQLType that looks like
Code: Select all
function GetFieldSQLType(const FieldName: string): string;
begin
case strFields.IndexOf(FieldName) of
fieldDate: result := 'DATE';
fieldNumber,
fieldYear,
field...
Is the order of these fields important ? I ask because I changed the order/numbering of fieldnames and the order within arrays for strXMLFields and strSQLFields on the same file, too, but this one seems to be sorted on field types only..
Posted: 2008-06-02 20:34:05
by antp
no, in "case" the order is not important.
But of course if there are groups (i.e. order by type), they are important. i.e. all those which end with commas give the same value as the one below which ends by a colon.
Posted: 2008-06-07 18:25:28
by bad4u
antp wrote:4. in the res\icons folder, it is the "icon_doc.ico" file which contains the file used for .amc files. Once you modified this .ico file (which contains six images: 16x16, 32x32, 48x48 in both 16 and 256 colors), run icons.bat to recreate the icons.res file in AMC's code folder. You may have to close and reopen the project to have Delphi reinclude this new res file in the exe.
Little bit confused about the icon files. icon_doc.ico contains your 'default' icon only sized 16x16 in 16 and 256 colors, the higher resolutions are different icons that I have not yet seen somewhere within AMC. So I thought you use the icon_pgm.ico for AMC, which contains the default icon in all 3 resolutions/2 colors.. If that's not the case, where do the different higher resolution icons appear ?
And how does the icons.res file work ? When I changed icons, I loaded them from within Delphi on 'project options -> application' and 'object properties' window. Maybe that was the wrong way if I want to change the .res file directly ?
Posted: 2008-06-07 21:02:12
by antp
I made an error previously (I mixed it with how I embedded an icon in the DLL I think), so I'll reexplain things correctly :
Delphi allows only to set one icon for the project, I wanted two, so I used a .res file created myself to add an icon in addition of the icon defined in project.
To set the main icon (i.e. program's icon) you use the Project Options window, and select the .ico file.
To set the document icon, it is with the .rc/.bat/.res file. When the icons.res file found in project folder is updated, just close and reopen the project. When you recompile it, the new icons.res file will be read by Delphi and embedded in the .exe file because of this line in moviecatalog.dpr :
{$R ICONS.RES}
The icons contained in the .exe are :
Indeed for the 16x16 icons, both are identical.
I just managed that the 1st icon is the program icon (as it is usually like that). The 2nd one is the document icon, associated with the .amc file (a .amc file will appear with that icon rather than the program icon).
To be sure of icons order I just had to give a name to the second one which was after "MAINICON" in alphabetical order ("SAVED1" in this case)
And to associate that 2nd icon to documents rather than the main program icon, when registering .amc extension it passes strAppExe + ',1' : the filepath to icon (moviecatalog.exe) is followed by icon number, starting at 0.