Changeset 66 for trunk


Ignore:
Timestamp:
Jul 1, 2006, 1:28:00 PM (15 years ago)
Author:
Eugene Romanenko
Message:

added application icon and logo bitmap to about dialog

Location:
trunk/Lucide/SOURCE/gui
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Lucide/SOURCE/gui/Lucide.rc

    r64 r66  
    11#include "Lucide_res.H"
    22#include <os2.h>
     3
     4ICON IDI_MAIN_ICON      "bitmaps\\lucide.ico"
     5BITMAP IDB_LOGO         "bitmaps\\lucidelogo.bmp"
    36
    47BITMAP IDB_OPEN         "bitmaps\\open.bmp"
  • trunk/Lucide/SOURCE/gui/Lucide_res.H

    r64 r66  
    3636#define __LUCIDE_RES_H
    3737
    38 #define IDI_MAIN_ICON 1
     38#define IDI_MAIN_ICON   1
     39#define IDB_LOGO                2
    3940
    40 #define IDP_HAND  10
     41#define IDP_HAND                10
    4142
    4243#define IDB_OPEN                20
     
    117118#define IDC_COPYRIGHTS          11
    118119#define IDC_NETLABSURL          12
     120#define IDC_LOGO                        13
    119121
    120122#define IDD_SETTINGS            1006
  • trunk/Lucide/SOURCE/gui/aboutDlg.cpp

    r35 r66  
    3838
    3939#include <stdio.h>
     40#include <string.h>
     41#include <malloc.h>
    4042
    4143#include "lucide.h"
     
    4547void setLinkPointer( HPOINTER hp );
    4648void toLink( HWND hwnd );
     49BOOL DrawTransparentBitmap( HAB hab, HPS hpsDraw, PPOINTL drawptl, HBITMAP hbmp );
     50
     51typedef struct
     52{
     53    PFNWP oldLogoProc;
     54    HBITMAP image;
     55} logoData;
     56
     57#define IMAGE_X 52
     58#define IMAGE_Y 52
     59
     60static MRESULT EXPENTRY LogoProc( HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2 )
     61{
     62    logoData *ld = (logoData *)WinQueryWindowULong( hwnd, QWL_USER );
     63    switch ( msg )
     64    {
     65        case WM_PAINT:
     66            {
     67                HPS hps;
     68                RECTL rect;
     69                WinQueryWindowRect( hwnd, &rect );
     70                hps = WinBeginPaint( hwnd, 0L, 0L );
     71                if ( ld->image != NULLHANDLE )
     72                {
     73                    LONG xPos = ( rect.xRight - IMAGE_X ) / 2;
     74                    LONG yPos = ( rect.yTop - IMAGE_Y ) / 2;
     75                    POINTL ptl = { xPos, yPos };
     76                    DrawTransparentBitmap( hab, hps, &ptl, ld->image );
     77                    //WinDrawBitmap( hps, ld->image, NULL, &ptl, 0, 0, DBM_NORMAL );
     78                }
     79                WinEndPaint( hps );
     80            }
     81            return (MRESULT)FALSE;
     82
     83        case WM_DESTROY:
     84            ld->oldLogoProc( hwnd, msg, mp1, mp2 );
     85            if ( ld->image != NULLHANDLE ) {
     86                GpiDeleteBitmap( ld->image );
     87            }
     88            free( ld );
     89            return (MRESULT)FALSE;
     90    }
     91    return ld->oldLogoProc( hwnd, msg, mp1, mp2 );
     92}
     93
     94void logoImageCreate( HWND hwnd )
     95{
     96    logoData *ld;
     97    ld = (logoData *)malloc( sizeof( logoData ) );
     98    memset( ld, 0, sizeof( logoData ) );
     99    ld->oldLogoProc = WinSubclassWindow( hwnd, LogoProc );
     100    WinSetWindowULong( hwnd, QWL_USER, (ULONG)ld );
     101    HPS hps = WinGetPS( hwnd );
     102    ld->image = GpiLoadBitmap( hps, NULLHANDLE, IDB_LOGO, 0, 0 );
     103    WinReleasePS( hps );
     104    WinInvalidateRect( hwnd, NULL, FALSE );
     105}
     106
    47107
    48108static HWND hWndFrame = NULLHANDLE;
     
    70130                                 PP_BACKGROUNDCOLORINDEX,
    71131                                 sizeof( cpr_clrback ), (PVOID)&cpr_clrback );
     132
     133                logoImageCreate( WinWindowFromID( hwnd, IDC_LOGO ) );
    72134            }
    73135            return (MRESULT)FALSE;
  • trunk/Lucide/SOURCE/gui/dialogs.rc

    r50 r66  
    7979                CONTROL "AD_OK", DID_OK, 83, 6, 50, 14, WC_BUTTON, BS_PUSHBUTTON | BS_DEFAULT | WS_VISIBLE | WS_GROUP | WS_TABSTOP
    8080                PRESPARAMS PP_FONTNAMESIZE "9.WarpSans"
    81 //              CONTROL IDI_MAIN_ICON, -1, 22, 74, 22, 17, WC_STATIC, SS_ICON | WS_VISIBLE
     81                CONTROL "", IDC_LOGO, 12, 72, 44, 32, WC_STATIC, SS_TEXT | WS_VISIBLE
    8282                CONTROL "", IDT_LUCIDEVERSION, 57, 97, 151, 8, WC_STATIC, SS_TEXT | DT_CENTER | DT_VCENTER | DT_WORDBREAK | DT_MNEMONIC | WS_VISIBLE | WS_GROUP
    8383                PRESPARAMS PP_FONTNAMESIZE "9.WarpSans Bold"
  • trunk/Lucide/SOURCE/gui/lucide.cpp

    r64 r66  
    708708
    709709    ULONG ulFrameFlags = FCF_TITLEBAR | FCF_SIZEBORDER | FCF_SYSMENU |
    710                          FCF_MINMAX | FCF_TASKLIST | FCF_NOBYTEALIGN;
     710                         FCF_MINMAX | FCF_TASKLIST | FCF_NOBYTEALIGN | FCF_ICON;
    711711    title = newstrdupL( MSGS_MAIN_WIN_TITLE );
    712712    hWndFrame = WinCreateStdWindow( HWND_DESKTOP, 0, &ulFrameFlags, NULL, title,
    713                                     WS_SYNCPAINT|WS_VISIBLE, NULLHANDLE, 100, NULL );
     713                                    WS_SYNCPAINT|WS_VISIBLE, NULLHANDLE, IDI_MAIN_ICON, NULL );
    714714    hFrameSysmenu  = WinWindowFromID( hWndFrame, FID_SYSMENU );
    715715    hFrameTitlebar = WinWindowFromID( hWndFrame, FID_TITLEBAR );
Note: See TracChangeset for help on using the changeset viewer.