1. ImageLeft
2. ImageCenter
3. ImageRight
I prefer to email you..
Code: Select all
/*
My OCX create with VB
by Fafi
*/
#include "FiveWin.ch"
static oGetEvent,cGetEvent,oWnd,oBrushSilver,oBrushBlack,oBrushBlue,oAct1,oAct2,oAct
function Main()
RegisterServer( "StyleButton.ocx" )
RegisterServer( "FafiXPBar.ocx" )
RegisterServer( "FafiXRBar.ocx" )
cGetEvent := ""+CRLF
DEFINE FONT oFont NAME "Tahoma" size 0,-32 BOLD
DEFINE ICON oIcon NAME "BASEPRO"
DEFINE BRUSH oBrushSilver COLOR nRGB(208,212,221)
DEFINE BRUSH oBrushBlack COLOR nRGB(83,83,83)
DEFINE BRUSH oBrushBlue COLOR nRGB(142,176,218)
DEFINE WINDOW oWnd TITLE "FWH Support Fafi OCX" MENU BuildMenu() BRUSH oBrushSilver ICON oIcon
define dialog oDlg from 120,202 to 742,1600 pixel of oWnd style nOR( WS_VISIBLE, WS_CHILD ) BRUSH oBrushBlue transparent
@70,150 say "Hi ! Antonio.. FWH is the Best for ActiveX Support.. I Created OCX with VB.. then use in FWH" size 300,200 of oDlg pixel font oFont color CLR_YELLOW
@70,10 say "Hello Event " size 60,12 of oDlg pixel
@80,10 get oGetEvent var cGetEvent size 120,200 of oDlg pixel memo
// nTop, nLeft. nWidth, nHeight
oAct2 := TActiveX():New( oWnd, "FafiButton.StylerButton", 130, 220, 350, 100 )
oAct2:SetProp("Caption","Fafi Button")
oAct3 := TActiveX():New( oWnd, "FafiButton.StylerButton", 130, 600, 350, 100 )
oAct3:SetProp("Caption","Fivewin 8.05")
oAct3:SetProp("RoundedValue",20)
oAct3:SetProp("FocusDottedRect",.f.)
oAct2:SetProp("FocusDottedRect",.f.)
oFontButton := TOleAuto():New( ActXPdisp( oAct3:hActiveX ) )
oFontButton := oFontButton:Font()
oFontButton:Size := 48
oFontButton:Name := "Times New Roman"
oFontButton := TOleAuto():New( ActXPdisp( oAct2:hActiveX ) )
oFontButton := oFontButton:Font()
oFontButton:Size := 48
oFontButton:Name := "Times New Roman"
oAct2:bOnEvent := { | cEvent, aParams, pParams | ButtonEvent( cEvent, aParams, pParams ) }
oAct3:bOnEvent := { | cEvent, aParams, pParams | ButtonEvent( cEvent, aParams, pParams ) }
oAct1 := TActiveX():New( oWnd, "FafiOCX.RibbonBar", 0, 0, 1800, 120 )
oAct1:bOnEvent := { | cEvent, aParams, pParams | RibbonEvent( cEvent, aParams, pParams ) }
oAct1:SetProp("Theme",2)
oAct1:do("AddTab", "1", "Effect")
oAct1:do("AddTab", "2", "Tab 2" )
oAct1:do("AddTab", "3", "Sample Tab")
oAct1:do("AddTab", "4", "New Tab")
oAct1:do("AddTab", "5", "Print")
oAct1:do("AddTab", "6", "Exit")
oAct1:do("Refresh")
oAct1:do("AddCat" , "1", "1", "Please select Effect Button", .f.)
oAct1:do("AddButton", "1", "1", " SILVER ", 501 )
oAct1:do("AddButton", "2", "1", " BLACK ", 5 )
oAct1:do("AddButton", "3", "1", " BLUE ", 5 )
oAct1:do("Refresh")
oAct := TActiveX():New( oWnd, "FafiOCX.ExpBar", 120, 0, 200, 578 )
oAct:Do("AddSpecialItem","File")
oAct:Do("AddSubItem", 1, "Open")
oAct:Do("AddSubItem", 1, "Close")
oAct:Do("AddSpecialItem","Print")
oAct:Do("AddSubItem", 2, "Setup")
oAct:Do("AddSubItem", 2, "Preview")
oAct:Do("AddSpecialItem","Event")
oAct:Do("AddSubItem", 3, "Clear Event")
oAct:Do("AddSpecialItem","Change Fafi Button Theme")
oAct:Do("AddSubItem", 4, "Media Center Edition")
oAct:Do("AddSubItem", 4, "Media Player 11")
oAct:Do("AddSubItem", 4, "Office 2007 1")
oAct:Do("AddSubItem", 4, "Office 2007 2")
oAct:Do("AddSubItem", 4, "Vista 1")
oAct:Do("AddSubItem", 4, "Vista 2")
oAct:Do("AddSubItem", 4, "XP Blue")
oAct:Do("AddSubItem", 4, "XP Olive Green")
oAct:Do("AddSubItem", 4, "XP Silver")
//oAct:Do("AddSpecialItem","Change Fafi Button Style")
//oAct:Do("AddSubItem", 5, "Normal")
//oAct:Do("AddSubItem", 5, "Round")
//oAct:Do("AddSubItem", 5, "More Round")
oAct:bOnEvent := { | cEvent, aParams, pParams | ExplorerBarEvent( cEvent, aParams, pParams ) }
activate dialog oDlg nowait
SET MESSAGE OF oWnd TO "Ready" NOINSET CLOCK DATE KEYBOARD 2007
ACTIVATE WINDOW oWnd MAXIMIZED
return nil
static function ExplorerBarEvent( cEvent, aParams, pParams )
cEvent := upper(alltrim(cEvent))
if left(cEvent,5) == "MOUSE" // don't use mouse event
else
cGetEvent += cEvent + CRLF
endif
do case
case cEvent == "SUBITEMCLICK"
cGetEvent += alltrim(oAct:do("SubItem",aParams[1],aParams[2]))+CRLF
if upper(alltrim(oAct:do("SubItem",aParams[1],aParams[2]))) == "CLEAR EVENT"
cGetEvent := ""+CRLF
endif
if upper(alltrim(oAct:do("SubItem",aParams[1],aParams[2]))) == upper("Media Center Edition")
oAct2:SetProp("Theme",1)
oAct3:SetProp("Theme",1)
endif
if upper(alltrim(oAct:do("SubItem",aParams[1],aParams[2]))) == upper("Media Player 11")
oAct2:SetProp("Theme",2)
oAct3:SetProp("Theme",2)
endif
if upper(alltrim(oAct:do("SubItem",aParams[1],aParams[2]))) == upper("Office 2007 1")
oAct2:SetProp("Theme",3)
oAct3:SetProp("Theme",3)
endif
if upper(alltrim(oAct:do("SubItem",aParams[1],aParams[2]))) == upper("Office 2007 2")
oAct2:SetProp("Theme",4)
oAct3:SetProp("Theme",4)
endif
if upper(alltrim(oAct:do("SubItem",aParams[1],aParams[2]))) == upper("Vista 1")
oAct2:SetProp("Theme",5)
oAct3:SetProp("Theme",5)
endif
if upper(alltrim(oAct:do("SubItem",aParams[1],aParams[2]))) == upper("Vista 2")
oAct2:SetProp("Theme",6)
oAct3:SetProp("Theme",6)
endif
if upper(alltrim(oAct:do("SubItem",aParams[1],aParams[2]))) == upper("XP Blue")
oAct2:SetProp("Theme",7)
oAct3:SetProp("Theme",7)
endif
if upper(alltrim(oAct:do("SubItem",aParams[1],aParams[2]))) == upper("XP Olive Green")
oAct2:SetProp("Theme",8)
oAct3:SetProp("Theme",8)
endif
if upper(alltrim(oAct:do("SubItem",aParams[1],aParams[2]))) == upper("XP Silver")
oAct2:SetProp("Theme",9)
oAct3:SetProp("Theme",9)
endif
endcase
oGetEvent:Refresh()
return nil
static function RibbonEvent( cEvent, aParams, pParams )
cEvent := upper(alltrim(cEvent))
if left(cEvent,5) == "MOUSE" // don't use mouse event
else
cGetEvent += cEvent + CRLF
endif
do case
case cEvent == "TABCLICK"
cGetEvent += aParams[2]+ CRLF
if upper(alltrim(aParams[2])) == "EXIT"
if MsgYesNo("Want to Exit ?")
oWnd:End()
endif
endif
case cEvent == "BUTTONCLICK"
cGetEvent += aParams[2]+ CRLF
cAction := upper(alltrim(aParams[2]))
if cAction == "DIALOG"
Dlg()
endif
if cAction == "BLUE"
oWnd:oBrush := oBrushBlue
oWnd:Refresh()
oAct1:SetProp("Theme",1)
oAct1:do("refresh")
endif
if cAction == "BLACK"
oWnd:oBrush := oBrushBlack
oWnd:Refresh()
oAct1:SetProp("Theme",0)
oAct1:do("refresh")
endif
if cAction == "SILVER"
oWnd:oBrush := oBrushSilver
oWnd:Refresh()
oAct1:SetProp("Theme",2)
oAct1:do("refresh")
endif
if upper(alltrim(aParams[2])) == ""
cGetEvent := "Event : "+CRLF
endif
endcase
oGetEvent:Refresh()
return nil
static function ButtonEvent( cEvent, aParams, pParams )
cEvent := upper(alltrim(cEvent))
if left(cEvent,5) == "MOUSE" // don't use mouse event
else
cGetEvent += cEvent + CRLF
endif
if cEvent == "CLICK"
cGetEvent += aParams[1]+ CRLF
endif
oGetEvent:Refresh()
return nil
static function ButtonEvent3( cEvent, aParams, pParams )
cEvent := upper(alltrim(cEvent))
if left(cEvent,5) == "MOUSE" // don't use mouse event
else
cGetEvent += cEvent + CRLF
endif
if cEvent == "CLICK"
cGetEvent += aParams[1]+ CRLF
endif
oGetEvent:Refresh()
return nil
FUNCTION BuildMenu()
local oMenu, oMenu1, oMenu2
local oSub1,oSub2,oSub3
MENU oMenu 2007
MENUITEM oMenu1 PROMPT "Test &1"
MENU
MENUITEM oSub1 PROMPT "Subject&1" CHECKED
/*
MENU
MENUITEM "Choice 1"
MENUITEM "Choice 2"
MENUITEM "Choice 3"
ENDMENU */
MENUITEM "Subject&2"
MENU
MENUITEM "Option 1"
MENUITEM "Option 2"
MENUITEM "Option 3"
MENU
MENUITEM "Selection 1"
MENUITEM "Selection 2"
MENUITEM "Selection 3"
MENU
MENUITEM "Sub-selection 1"
MENUITEM "Sub-selection 2"
MENU
MENUITEM "Sub-sub-selection 1"
MENUITEM "Sub-sub-selection 2"
MENUITEM "Sub-sub-selection 3"
MENU
MENUITEM "Lowest level 1"
MENUITEM "Lowest level 2"
ENDMENU
ENDMENU
ENDMENU
MENUITEM "Selection 4"
ENDMENU
ENDMENU
MENUITEM "Toggle Subject 1 Check" ACTION oSub1:SetCheck( ! oSub1:lChecked )
ENDMENU
MENUITEM "Test 2"
MENU
MENUITEM "Item 1"
MENUITEM "Item 2"
ENDMENU
ENDMENU
// oMenu2:Disable()
RETURN (oMenu)
static function Dlg()
define dialog oDlg from 1,1 to 600,800 pixel of oWnd
activate dialog oDlg centered
return nil
#pragma BEGINDUMP
#include <hbapi.h>
#include <windows.h>
typedef LONG ( * PDLLREGISTERSERVER ) ( void );
HB_FUNC( REGISTERSERVER )
{
HMODULE hDll = LoadLibrary( hb_parc( 1 ) );
LONG lReturn = 0;
if( hDll )
{
FARPROC pRegisterServer = GetProcAddress( hDll, "DllRegisterServer" );
if( pRegisterServer )
lReturn = ( ( PDLLREGISTERSERVER ) pRegisterServer )();
FreeLibrary( hDll );
}
hb_retnl( lReturn );
}
#pragma ENDDUMP