Logo on Dialogs |
This is a User Interface Tips example to demonstrate how MAKEMSI can may "on the fly" changes to a standard template allowing you to accept templates from other people.
The standard dialogs (in "uisample.msi") have a white bar with a graphic on the right, the whole thing being scalable. With dialogs its important to know that they don't use pixels or any other common measurement so it is impossible to create an icon or bitmap and know how much dialog space it will cover.
Since the standard bar and graphic are combined and since graphics don't scale very well it is almost impossible to replace the standard graphic with your own and have it look reasonable.
The code below implements my solution which is basically to divide the graphic into two pieces:
;--- MAKEMSI MSI smaller, use smaller banner graphic ------------------------ #define? UISAMPLE_BITMAP_WHITE_BANNER white.bmp ;;Pure white banner (no graphic) <$Binary "<$UISAMPLE_BITMAP_WHITE_BANNER>" KEY="bannrbmp" DOCO="N" @Validate="FIELD"> ;;Very small image gets sized to fill area ;--- If user wants a small graphic on the banner (like original) then add it --- #define? UISAMPLE_BITMAP_BANNER_GRAPHIC #if ['<$UISAMPLE_BITMAP_BANNER_GRAPHIC>' <> ''] ;--- User wants the small right hand side graphic ----------------------- <$Binary "<$UISAMPLE_BITMAP_BANNER_GRAPHIC>" KEY="BannerGraphic.BMP" DOCO="N"> ;;Will place fixed size bitmap on right of filled area <$Table "Control"> #( ;--- Add new control for fixed size logo on right -------------------- <$Row @Where="`Control` = 'BannerBitmap'" @Method="INSERT" @OK=^? > 0^ Control="CompanyLogo" X="330" Y="10" Width="26" Height="26" Attributes="&H00100001" ;;Fixed size bitmap Text="BannerGraphic.BMP" Control_Next="" > #) <$/Table> #end if