Compiling using Delphi 7 Personal ?

If you need help on how to use the program
antp
Site Admin
Posts: 9725
Joined: 2002-05-30 10:13:07
Location: Brussels
Contact:

Post by antp »

It is a kind of inheritance: if you do not change a value/attribute on the main form, it takes it from the original frame.
So you should be able to change it in that frame to have the changes directly updated in main window and options window.
The value which are changed compared to the original values are show in bold in the object inspector, so these won't change when you change the original frame. Normally by default none of the values are in bold.
All changes have so to be done in the original frame. If you delete or rename objects it is better to have main form and the default pref form open in background, else the next time you open these it will ask you why some names are not found anymore.
bad4u
Posts: 1148
Joined: 2006-12-11 22:54:46

Post by bad4u »

antp wrote:If you delete or rename objects it is better to have main form and the default pref form open in background, else the next time you open these it will ask you why some names are not found anymore.
Yes, I made that experience more than once ;)

But now I understand why some objects on main form did follow original frame, others not. Same for the source of main.dfm, where not all objects appeared while they are all listed in framemovie.dfm. I thought it might be this way before, but could not find the correct conjunction between both windows. My fault was that I did lots of changes on main form before I had a closer look on original one..

I just deleted the objects that were listed on 'inline FrmMovie: TMovieFrame' in the file main.dfm ('inherited') and now I have both windows set to the same style again (=as on original frame).

Thanks again!
antp
Site Admin
Posts: 9725
Joined: 2002-05-30 10:13:07
Location: Brussels
Contact:

Post by antp »

Alternatively, to revert back to original frame attributes for a control you can click with right mouse button on it and select "revert to inherited" (easier than delete the line from the dfm ;))
bad4u
Posts: 1148
Joined: 2006-12-11 22:54:46

Post by bad4u »

antp wrote:.. you can click with right mouse button on it and select "revert to inherited" (easier than delete the line from the dfm ;))
But then I couldn't be sure to reset all changes at once.. and there were a lot of them ^^

Two more questions:
When there is no movie list loaded or no movie selected from a list, the field names on FrmMovie are greyed and the fields are inactive. I created a PageControl (from Win32 unit) and some TabSheets within MovieFrame (original) and moved some fields and field names into the TabSheets. These ones appear on FrmMovie, too, and seem to work properly, but the field names inside this TabSheets are no longer greyed out when not in use, only the edit fields are inactive. I did not find anything on the components or source about that, and although it has no influence on functionality it would be nice to add this effect again. Could you lead me the correct way ?

What about bevels from unit additional. They work perfect in Delphi windows when I use them on MovieFrame (and so on FrmMovie, i.e. when I change window size, too), but after compiling the program they only show up when I open default English language as fullscreen window. When I change window size or open another language file at startup, they are not visible. Can I change that behaviour, maybe on language file or translator ?

Btw.. please let me know if my questions waste too much of your time or just get on your nerves. It's not my intention to cause more work than the program and forum together :D
antp
Site Admin
Posts: 9725
Joined: 2002-05-30 10:13:07
Location: Brussels
Contact:

Post by antp »

Enabling/disabling controls is done in the main form in the "MovieSelected" function :

Code: Select all

    with FrmMovie do
      for i := 0 to ControlCount-1 do
        Controls[i].Enabled := SelCount = 1;
The pagecontrol is disabled with the other controls, but a disabled pagecontrol does not disable visually each control that it contains, so you have to do this:

Code: Select all

    with FrmMovie do
      for i := 0 to ControlCount-1 do
        if Controls[i] is TPageControl then
        begin
          with Controls[i] as TPageControl do
            for j := 0 to ControlCount-1 do
              Controls[j].Enabled := SelCount = 1;
        end
        else
          Controls[i].Enabled := SelCount = 1;
and add "j" in the var section.

I am not sure to understand that bevel problem, can you make a screenshot of what it looks like on your form?

Questions do not annoy me, it is nice that people work on it, so if I can't continue the program at least others can :D
bad4u
Posts: 1148
Joined: 2006-12-11 22:54:46

Post by bad4u »

After some modifications I got the enabling/disabling controls on the TabSheets running now.. I needed to go one step further on objects tree and use the TTabSheets within the TPageControl with your function to get it running :)

Code: Select all

    with FrmMovie do
      for i := 0 to ControlCount-1 do
        if Controls[i] is TPageControl then
        begin
          with Controls[i] as TPageControl do
            for j := 0 to ControlCount-1 do
              if Controls[j] is TTabSheet then
              begin
                with Controls[j] as TTabSheet do
                  for k := 0 to ControlCount-1 do
                    Controls[k].Enabled := SelCount = 1;
              end;
        end else
          Controls[i].Enabled := SelCount = 1;
It seems to work properly now, but maybe you could have a short look on the code, to see if I did oversee anything ? Thanks !

About the bevel problem: I used the bevel just cause it looks nice around some controls on MovieFrame/FrmMovie window, but on compiled version I can only see it when I start program with "English default" language set and full screen window - else bevel is simply not visible. When I then change back from fullscreen to windowed mode, bevel disappears, too (As long as I'm in delphi and did not compile the source, changing size of main window works perfect with bevels, no problems at all). I'll do some screenshots and upload them tomorrow, now I need to get some sleep ^^
antp
Site Admin
Posts: 9725
Joined: 2002-05-30 10:13:07
Location: Brussels
Contact:

Post by antp »

I forgot the TabSheet level indeed.

About the bevel, except a problem with the Anchors attributes, I have no idea...
bad4u
Posts: 1148
Joined: 2006-12-11 22:54:46

Post by bad4u »

I wanted to make some screenshot with/without bevel, but on my last compiled version I did not get bevels visible at all.. weired :/

When I tried changing code to show bevels again and read the helpfile about bevels, I found another possibility to get the same graphical effect using an empty TPanel in the background. And it makes no problems on changing window size.
bad4u
Posts: 1148
Joined: 2006-12-11 22:54:46

Post by bad4u »

After wasting some hours on a problem again, maybe you can point me the right way once more..

I want to appear the picture on a fixed position/size on the same TabSheet I mentioned above, while visibility should still be switchable if possible.

When I move the ToolbarPictureWindow (TTBXToolWindow) with PanelPicture (TPanel), ScrollBox1 (TScrollBox) and MoviePicture (TPicture) into PanelMovieInfos (via TreeView) or into FrmMovie (only via source code) it works without problems : I can set a fixed position/size, without frame, visibility can be switched and it loads full size picture on click. No problems at all.

Then I move it into a TabSheet (TTabSheet / via source code, not possible on TreeView) and the compilation of source code still runs without any error message - but the new executable starts with an access violation and can only be terminated via task manager. When I save this code on Delphi and open it again, ToolbarPictrueWindow and other components have been deleted (they are simply gone) :/

Isn't it possible to get the TTBXToolWindow running within the TabSheet, or is it a similar problem like the one from above and the picture has to be enabled/disabled from another instance/level ? Or do I need to go a completly different way..?
antp
Site Admin
Posts: 9725
Joined: 2002-05-30 10:13:07
Location: Brussels
Contact:

Post by antp »

As it is a floating item, the TTBXToolWindow much be put on a TTBXDock when it is not floating. If you check the object treeview, there is a dock between the tool window and the panel.
Though that it actually should work without that, I think.

If components disappear it is probably because they are not properly declared, or on components on which they are not suppose to be. Do you do these changes directly into the DFM file? It is better to rather use the visual designer + the object treeview to move components, as there it checks if the components are compatible or not.
bad4u
Posts: 1148
Joined: 2006-12-11 22:54:46

Post by bad4u »

The TTBxToolWindow does work without the dock, no problem, but it is not at all running within the TabSheets from the original frame.. at least not without bigger code changes I guess. I really tried a lot, but as I didn't get it running the last 3 days, I gave up and changed the layout today (for the moment ;) ). I might change this again later in a future update..

When components disappeared it is indeed after I did some changes in the source instead of using the visual designer.. as the designer didn't want me to do it. But sometimes it was neccessary..

Nevertheless thanks again ^^
antp
Site Admin
Posts: 9725
Joined: 2002-05-30 10:13:07
Location: Brussels
Contact:

Post by antp »

bad4u wrote:as the designer didn't want me to do it
There is probably a reason :D
If you copy/paste (using the visual designer) the picture tool window and paste it in the frame (not the one included in main window, but the original frame) it should work
bad4u
Posts: 1148
Joined: 2006-12-11 22:54:46

Post by bad4u »

I tried that among others, but it didn't work either. The picture can use the dock from original frame, but not as default one. Most of the time I got access violations on compiled executable then.
It only works for me if picture and dock are on the same unit. I guess it is because of some procedures and variables on the source, and it will only work if these will be moved to original frame, too.. (like TMainWindow.LoadMoviePicture, as it cannot access 'MoviePicture' if this has been moved to original frame - but at the same time uses other variables from Main unit). Don't know how I can explain it better ;)
bad4u
Posts: 1148
Joined: 2006-12-11 22:54:46

Post by bad4u »

A short question to properties of original frame (MovieFrame). I can set properties on object inspector, but I cannot use these properties on the unit itself : i.e. I wanted to use MovieFrame.Width but compiler tells me that 'Form MovieFrame references form MovieFrame declared in unit movieframe which is not in your USES list...' . I understand what's going wrong, and that I cannot declare a unit within itself, but is there another way to read width and height of original MovieFrame (on unit framemovie) ?
antp
Site Admin
Posts: 9725
Joined: 2002-05-30 10:13:07
Location: Brussels
Contact:

Post by antp »

You mean use by code the properties of the frame, in the frame's unit?
You do not have to prefix it by "movieframe" as it is the "current" object, i.e. if you are putting code in movieframe's functions/procedures, you can directly access its properties.
I am not sure that this is clear.
bad4u
Posts: 1148
Joined: 2006-12-11 22:54:46

Post by bad4u »

Ahh.. I could have had that idea myself, just leave the prefix away. Thanks, works !
bad4u
Posts: 1148
Joined: 2006-12-11 22:54:46

Post by bad4u »

Is there an easy way to check for operating system from a delphi program ? Maybe some routine or function that could be used in a 'if vista = true then..' condition ?

I tested game catalog layout on Vista PE and it seems to run properly although I'm using transparent labels, but there is another problem on the layout : It seems that the top value of objects changes on Vista, at least the space between fields seems to be larger than it is on XP. So the field at the bottom of the page is not visible on small resolutions and the cover picture on my main window appears on a slightly wrong position . Same effect with AMC on Vista PE, there the description and comments fields disappear completely when you resize to a small resolution :/

So it would be fine if I could detect which operating system is currently running and maybe find a fix for the layout problem (eventually changing top values).

(I can send a screenshot if needed)
antp
Site Admin
Posts: 9725
Joined: 2002-05-30 10:13:07
Location: Brussels
Contact:

Post by antp »

A screenshot would be welcome indeed, though that I could test that at work on a colleague PC.
Maybe the problem is fixable in a smart/other way, but anyway to reply to your question you can easily check the version of the OS.
In functions_sys unit (from the folder named "common", and that unit is probably used in AMC) you have a "IsWindowsXP" constant initialized as such:

Code: Select all

  IsWindowsXP := (IsWindowsNT) and (((Win32MajorVersion = 5) and (Win32MinorVersion >= 1)) or (Win32MajorVersion > 5));
You can simply add this one:

Code: Select all

  IsWindowsVista := (IsWindowsNT) and (Win32MajorVersion > 5);
bad4u
Posts: 1148
Joined: 2006-12-11 22:54:46

Post by bad4u »

Screenshots come via mail. If there should be another way fixing this problem it would be very appreciated (and maybe useful for AMC Vista users, too). Else I will try your workaround and probably only change size and/or position of cover picture when detecting Vista..

Thanks again!
antp
Site Admin
Posts: 9725
Joined: 2002-05-30 10:13:07
Location: Brussels
Contact:

Post by antp »

I will try to try AMC tomorrow on a normal retail version of Vista at work and let you know if the problem occurs on that one too ;)
Post Reply