#include "fivewin.ch"
Function test()
Local oWnd, oBar
DEFINE WINDOW oWnd
oBar = TBar():New( oWnd, 26, 26, .T., "TOP", , .T. )
oBar:bPainted = { | hDC | DrawOnBar( hDC ) }
ACTIVATE WINDOW oWnd
return nil
FUNCTION DrawOnBar( hDC )
local i,nspace:=0
local hBtnSeparator
hBtnSeparator = BMPBTNDBAR()
for i=1 to 3
DrawMasked( hDC, hBtnSeparator, 10, nspace )
nspace += 100
next
DeleteObject( hBtnSeparator )
return nil
//-----------------------------------------------------------------//
#pragma BEGINDUMP
#include "Windows.h"
#include "hbapi.h"
DWORD btndbar [10][10]={
{/*0,0*/0xff00ff,/*1,0*/0xff00ff,/*2,0*/0xff00ff,/*3,0*/0xff00ff,/*4,0*/0xff00ff,/*5,0*/0xff00ff,/*6,0*/0xff00ff,/*7,0*/0xff00ff,/*8,0*/0xff00ff,/*9,0*/0xff00ff},
{/*0,1*/0xff00ff,/*1,1*/0x668eaf,/*2,1*/0x668eaf,/*3,1*/0x668eaf,/*4,1*/0x668eaf,/*5,1*/0x668eaf,/*6,1*/0x668eaf,/*7,1*/0xff00ff,/*8,1*/0xff00ff,/*9,1*/0xff00ff},
{/*0,2*/0xff00ff,/*1,2*/0x668eaf,/*2,2*/0xfefeff,/*3,2*/0xfefeff,/*4,2*/0xfefeff,/*5,2*/0xfefeff,/*6,2*/0xfefeff,/*7,2*/0xff00ff,/*8,2*/0xff00ff,/*9,2*/0xff00ff},
{/*0,3*/0xff00ff,/*1,3*/0x668eaf,/*2,3*/0xfefeff,/*3,3*/0xff00ff,/*4,3*/0xff00ff,/*5,3*/0xff00ff,/*6,3*/0xff00ff,/*7,3*/0xff00ff,/*8,3*/0xff00ff,/*9,3*/0xff00ff},
{/*0,4*/0xff00ff,/*1,4*/0x668eaf,/*2,4*/0xfefeff,/*3,4*/0xff00ff,/*4,4*/0x668eaf,/*5,4*/0xfefeff,/*6,4*/0xff00ff,/*7,4*/0x668eaf,/*8,4*/0xfefeff,/*9,4*/0xff00ff},
{/*0,5*/0xff00ff,/*1,5*/0x668eaf,/*2,5*/0xfefeff,/*3,5*/0xff00ff,/*4,5*/0xff00ff,/*5,5*/0x668eaf,/*6,5*/0x668eaf,/*7,5*/0x668eaf,/*8,5*/0xfefeff,/*9,5*/0xff00ff},
{/*0,6*/0xff00ff,/*1,6*/0x668eaf,/*2,6*/0xfefeff,/*3,6*/0xff00ff,/*4,6*/0xff00ff,/*5,6*/0x668eaf,/*6,6*/0x668eaf,/*7,6*/0x668eaf,/*8,6*/0xfefeff,/*9,6*/0xff00ff},
{/*0,7*/0xff00ff,/*1,7*/0xff00ff,/*2,7*/0xff00ff,/*3,7*/0xff00ff,/*4,7*/0x668eaf,/*5,7*/0x668eaf,/*6,7*/0x668eaf,/*7,7*/0x668eaf,/*8,7*/0xfefeff,/*9,7*/0xff00ff},
{/*0,8*/0xff00ff,/*1,8*/0xff00ff,/*2,8*/0xff00ff,/*3,8*/0xff00ff,/*4,8*/0xff00ff,/*5,8*/0xfefeff,/*6,8*/0xfefeff,/*7,8*/0xfefeff,/*8,8*/0xfefeff,/*9,8*/0xff00ff},
{/*0,9*/0xff00ff,/*1,9*/0xff00ff,/*2,9*/0xff00ff,/*3,9*/0xff00ff,/*4,9*/0xff00ff,/*5,9*/0xff00ff,/*6,9*/0xff00ff,/*7,9*/0xff00ff,/*8,9*/0xff00ff,/*9,9*/0xff00ff}
};
HBITMAP BitmapFromCode( int iWidth, int iHeight, VOID* ImageBits )
{
return CreateBitmap(iWidth,iHeight,1,sizeof(RGBQUAD)*8, ImageBits);
}
HB_FUNC( BMPBTNDBAR )
{
hb_retnl( (long) BitmapFromCode( 10, 10, &btndbar ));
}
#pragma ENDDUMP