123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- //---------------------------------------------------------------------------
- #include <vcl.h>
- #pragma hdrstop
- #include "Global.h"
- #include "Animations.h"
- #include "Animations96.h"
- #include "Animations120.h"
- #include "Animations144.h"
- #include "Animations192.h"
- #include "GUITools.h"
- #include "GUIConfiguration.h"
- //---------------------------------------------------------------------------
- #pragma package(smart_init)
- #pragma link "PngImageList"
- #ifndef NO_RESOURCES
- #pragma resource "*.dfm"
- #endif
- //---------------------------------------------------------------------------
- static TAnimationsModule * AnimationsModule = NULL;
- //---------------------------------------------------------------------------
- TAnimationsModule * __fastcall GetAnimationsModule()
- {
- if (AnimationsModule == NULL)
- {
- HANDLE ResourceModule = GUIConfiguration->ChangeToDefaultResourceModule();
- try
- {
- AnimationsModule = new TAnimationsModule(Application);
- }
- __finally
- {
- GUIConfiguration->ChangeResourceModule(ResourceModule);
- }
- }
- return AnimationsModule;
- }
- //---------------------------------------------------------------------------
- __fastcall TAnimationsModule::TAnimationsModule(TComponent * Owner)
- : TDataModule(Owner)
- {
- int PixelsPerInch = Screen->PixelsPerInch;
- TDataModule * ScaledModule;
- if (PixelsPerInch >= 192)
- {
- ScaledModule = new TAnimations192Module(Application);
- }
- else if (PixelsPerInch >= 144)
- {
- ScaledModule = new TAnimations144Module(Application);
- }
- else if (PixelsPerInch >= 120)
- {
- ScaledModule = new TAnimations120Module(Application);
- }
- else
- {
- ScaledModule = new TAnimations96Module(Application);
- }
- // Not really necessary as we never acccess AnimationImages by name
- CopyDataModule(this, ScaledModule);
- AnimationImages = NOT_NULL(dynamic_cast<TPngImageList *>(FindComponent(AnimationImages->Name)));
- }
- //---------------------------------------------------------------------------
|