PowerBASIC Peer Support Forums
 

Go Back   PowerBASIC Peer Support Forums > User to user Discussions > Third-Party Addons

Third-Party Addons User to user discussions of third-party addons and user-recommended links to related web sites. Advertisements are permitted only in this forum, for products designed to work with and enhance PowerBASIC compilers.

Reply
 
Thread Tools Display Modes
  #1  
Old May 5th, 2012, 01:00 PM
Francisco Castanedo Francisco Castanedo is offline
Member
 
Join Date: Nov 2008
Location: Caracas, Venezuela
Posts: 216
Red face Looking for an AppFace example (Done)

I'm testing AppFace to skin my app and it works fine so far. I use only two commands: SkinStart and SkinRemove which pretty much is like "skin on" and "skin off".

The trial has many examples, not compiled into exe, but none are for PowerBasic. They claim it works for PowerBasic but since there are no source code examples in PB, and I do not master any other language, it is almost impossible for me to build a PB example.

Does anyone has a working PB example?
__________________
Francisco Castanedo
Software Developer
Distribuidora 3HP, C.A.
http://www.distribuidora3hp.com

Last edited by Francisco Castanedo; May 12th, 2012 at 01:10 PM.
Reply With Quote
  #2  
Old May 7th, 2012, 06:49 PM
Francisco Castanedo Francisco Castanedo is offline
Member
 
Join Date: Nov 2008
Location: Caracas, Venezuela
Posts: 216
Well, it seems that nobody has an example that can show AppFace capabilities.

I'm translating one VB6 example to PowerBasic (thanks a lot PBForms) but since I'm not expert on VB6 I am missing some functions in the process.

Is anyone of you ex-VB6 guys willing to compile an example and hand over the required compiled file(s) so I can see what it really does? That way I may be able to finish the PowerBasic example which I will post once I finish it.

To get the VB6 example please go to
http://www.appface.com/eng/download-skins.htm
and download the installer and zip package.

Thanks
__________________
Francisco Castanedo
Software Developer
Distribuidora 3HP, C.A.
http://www.distribuidora3hp.com
Reply With Quote
  #3  
Old May 7th, 2012, 07:14 PM
Chris Boss Chris Boss is offline
Member
 
Join Date: Feb 1999
Posts: 5,771
I didn't see a reference to PowerBasic, but Purebasic !

That said though, it appears that it is a DLL and should be able to be used with PowerBasic.
__________________
Chris Boss
Computer Workshop
Developer of "EZGUI"
http://cwsof.com
http://twitter.com/EZGUIProGuy
Reply With Quote
  #4  
Old May 7th, 2012, 07:41 PM
Chris Boss Chris Boss is offline
Member
 
Join Date: Feb 1999
Posts: 5,771
They don't provide an include file for PowerBasic.

There are two separate DLL's, one for ansi and the other for unicode. Choose the one you prefer.

There are only a few function calls so it should be easy. Personally I find using a C header file easier to translate. There is a VB include file, but be careful that with VB when it says a string parameter, VB converts it to an asciiz string. It is not a PB OLE string.

The C header will show a char string, which is asciiz.

I would start with the ansi version and get that working and then later try the unicode version.

The runtime DLL is about 700 KB in size. Not small, but not too bad.
__________________
Chris Boss
Computer Workshop
Developer of "EZGUI"
http://cwsof.com
http://twitter.com/EZGUIProGuy
Reply With Quote
  #5  
Old May 7th, 2012, 09:16 PM
Francisco Castanedo Francisco Castanedo is offline
Member
 
Join Date: Nov 2008
Location: Caracas, Venezuela
Posts: 216
Here is the include file for PowerBasic

Code:
'*******************************************
'AppFace Include File for PowerBASIC 10
'Converted from the Visual Basic 6.0 Module  AppFace.bas
'Date: 05/05/2012 Francisco Castanedo
'*******************************************

%GWL_WNDPROC                  = (-4)
'%WM_USER                      = &H400 ' Already defined in PB9 & PB10 (Built-in Numeric Equates)


' Already defined in WIN32API.INC:
'TYPE RECT
'    Left   AS LONG
'    Top    AS LONG
'    Right  AS LONG
'    Bottom AS LONG
'END TYPE


'--------------------------------------------------------
'The below defines come from VB6 appface.h

%WM_FRAME_BUTTON              = %WM_USER + &H364
%WM_TRANSPARENT_GIF           = %WM_USER + &H365

%BK_MENU_HOVER                = 10
%BK_CUSTOM                    = 10000

'For WM_FRAME_BUTTON  WPARAM
%FRAME_BUTTON_MAX             = 1
%FRAME_BUTTON_RESTORE         = 2
%FRAME_BUTTON_MIN             = 3
%FRAME_BUTTON_CLOSE           = 4
%FRAME_BUTTON_CUSTOMBASE      = &H200  ' For custom frame button

'Windows skin type,used for SkinWindowSet function
%SKIN_CLASS_NOSKIN            = 0             'Do not skin a window ,but allocate the needed resource for it

  'Windows
%SKIN_CLASS_AUTOFILTER        = 1         'AppFace skin this window automatically

%SKIN_CLASS_PAUSESKIN         = 2          'Pause skin for a special window,but do not free resource
%SKIN_CLASS_REDOSKIN          = 3           'Redo skin from pause state
%SKIN_CLASS_REMOVESKIN        = 4         'Unskin a window and remove all the allocated skin resource for it at the same time
%SKIN_CLASS_NOSKINEX          = 5           'Unskin a window and all the child windows of it
%SKIN_CLASS_UNKNOWN           = 6
%SKIN_CLASS_AUTOFILTEREX      = 7
%SKIN_CLASS_SCROLLWIN         = 10
%SKIN_CLASS_SCROLLWINBORDER   = 11
%SKIN_CLASS_FRAMEWIN          = 101
%SKIN_CLASS_FRAMEDIALOG       = 102
%SKIN_CLASS_INSIDEDIALOG      = 103
%SKIN_CLASS_MDICLIENT         = 104
%SKIN_CLASS_SCROLLPANEL       = 105
%SKIN_CLASS_FRAMEBACKGROUND   = 106

  'Controls
%SKIN_CLASS_COMBOBOX          = 201
%SKIN_CLASS_DATETIME          = 202
%SKIN_CLASS_HEADER            = 203
%SKIN_CLASS_GROUPBOX          = 204
%SKIN_CLASS_IMAGEBUTTON       = 205
%SKIN_CLASS_MENU              = 206
%SKIN_CLASS_PROGRESS          = 207
%SKIN_CLASS_PUSHBUTTON        = 208
%SKIN_CLASS_SCROLLBAR         = 209
%SKIN_CLASS_SLIDER            = 210
%SKIN_CLASS_SPIN              = 211
%SKIN_CLASS_SPILTER           = 212
%SKIN_CLASS_STATUSBAR         = 213
%SKIN_CLASS_TAB               = 214
%SKIN_CLASS_TEXT              = 215
%SKIN_CLASS_TOOLBAR           = 216
%SKIN_CLASS_TOOLBARPANEL      = 217
%SKIN_CLASS_PANEL             = 218
%SKIN_CLASS_PANELEX           = 219
%SKIN_CLASS_PANELELIXIR       = 220
%SKIN_CLASS_HYPERLINK         = 221
%SKIN_CLASS_STATUSBAR_VB6     = 222
%SKIN_CLASS_SHAPEWIN          = 223
%SKIN_CLASS_CHECKBUTTON       = 224
%SKIN_CLASS_RADIOBUTTON       = 225
%SKIN_CLASS_READONLYEDIT      = 226
%SKIN_CLASS_FRAMEBTN          = 227
%SKIN_CLASS_SLIDEREX          = 228
%SKIN_CLASS_EDITBOX           = 229
%SKIN_CLASS_LISTBOX           = 230
%SKIN_CLASS_COMBOBOXEX        = 231
%SKIN_CLASS_LISTVIEW          = 232
%SKIN_CLASS_TREE              = 233
%SKIN_CLASS_TOOLBARREAL       = 301
%SKIN_CLASS_SHADOW            = 302

 'Only for SkinWindowSetEx
%SKIN_SET_TRANSPARENT         = 601
%SKIN_SET_THEME_COLOR         = 602
%SKIN_SET_EFFECT              = 603
%SKIN_SET_REDRAW              = 604
%SKIN_SET_PAINTCUSTOMPROC     = 605
%SKIN_SET_NCPAINTCUSTOMPROC   = 606
%SKIN_SET_SPECIAL_TOOL        = 610

'Only for VB6 scrollbar control
%SKIN_SET_VB6_SCROLL_INFO     = 611

'allow shadow effect for all the frame windows and pop menus
%SKIN_SET_SHADOW_ENABLE       = 612

'disable shadow effect for all the frame windows and pop menu(by default)
%SKIN_SET_SHADOW_DISABLE      = 613
%SKIN_SET_UNSKIN              = 660
%SKIN_SET_UNICODE_URF_FONT    = 661

'Pause all the skin functions of AppFace for all windows in the target process,
'SKIN_CLASS_PAUSESKIN only pause skin functions for one special window .
'These two parameters do not release the allocated resource both.
%SKIN_SET_PAUSESKIN           = 662

'Restore skin functions from SKIN_SET_PAUSESKIN state
%SKIN_SET_REDOSKIN            = 663

'Indicate skin or not skin VC static control automatically
%SKIN_SET_VCLABEL             = 664

'To control the custom frame button
%SKIN_SET_FRAMEBTN            = 665

'Create bk object from another URF
%SKIN_GET_BK                  = 701

'--------------------------------------------------------

' Development tool used (Programming Language)

%WINDOW_TYPE_AUTOFILTER  = 0                    ' AppFace detects the default window type automatically
%WINDOW_TYPE_SDK         = 1                    ' Windows SDK
%WINDOW_TYPE_VC          = %WINDOW_TYPE_SDK     ' Visual C++
%WINDOW_TYPE_PB          = %WINDOW_TYPE_SDK     ' PowerBasic, PureBasic
%WINDOW_TYPE_VB6         = 2                    ' Visual Basic 6.0, PowerBasic
%WINDOW_TYPE_BCB         = 3                    ' Borland C++ Builder
%WINDOW_TYPE_DELPHI      = %WINDOW_TYPE_BCB     ' Borland Delphi
%WINDOW_TYPE_NET         = 4                    ' VB.Net or C#.Net


' How to load URF

%GTP_LOAD_FILE           = 1     ' Load URF from disk file and Skin windows automatically
%GTP_LOAD_MEMORY         = 2     ' Load URF from memory and Skin windows automatically
%GTP_LOAD_RESOURCE       = 3     ' Load URF from resource and Skin windows automatically
%GTP_LOAD_FILE_ONLY      = 4     ' Load URF from disk file,but do not skin any windows until user call SkinWindowSet
%GTP_LOAD_MEMORY_ONLY    = 5     ' Load URF from memory,but do not skin any windows until user call SkinWindowSet
%GTP_LOAD_RESOURCE_ONLY  = 6     ' Load URF from resource,but do not skin any windows until user call SkinWindowSet


' Skin Effect (special effect for the form open/close event )

%EFFECT_IN_SPIN          = 2     ' Spin in effect
%EFFECT_IN_VORTEX        = 3     ' Vortex in effect
%EFFECT_IN_SCATTER       = 4     ' Scatter in effect
%EFFECT_IN_STAR          = 5     ' Star in effect
%EFFECT_IN_RAZZLE        = 6     ' Razzle in effect
%EFFECT_OUT_SPIN         = 52    ' Spin out effect
%EFFECT_OUT_VORTEX       = 53    ' Vortex out effect
%EFFECT_OUT_SCATTER      = 54    ' Scatter out effect
%EFFECT_OUT_STAR         = 55    ' Star out effect
%EFFECT_OUT_RAZZLE       = 56    ' Razzle out effect



' 'For custom frame button - Frame Button States

%FB_COMMAND_REMOVE       = 0     ' Remove this frame button
%FB_COMMAND_ENABLE       = 1     ' Enable this frame button
%FB_COMMAND_DISABLE      = 2     ' Disable this frame button
%FB_COMMAND_CHECK        = 3     ' Checked this frame button
%FB_COMMAND_UNCHECK      = 4     ' Unchecked this frame button


' Type of Background to be created

%BK_DIALOGPANEL          = 1     ' Dialog or form
%BK_MDICLIENT            = 2     ' MDIClient window
%BK_MDICHILD             = 3     ' MDI child window
%BK_SPLITTER             = 4     ' Splitter
%BK_STATUSBAR            = 5     ' StatusBar
%BK_MENUBARBK            = 6     ' The menu bar of frame window
%BK_MENUBARHOVER         = 7     ' The menu bar item hover state of frame window
%BK_MENUBARDOWN          = 8     ' The menu bar item mouse down state of frame window
%BK_MENU_BK              = 9     ' Pop menu
%BK_MENU_HOVER           = 10    ' Pop menu item hilite state
%BK_SCROLL_BK            = 11    ' ScrollBar
%BK_SLIDER_CHANNEL_H     = 12    ' The horizontal slider channel
%BK_SLIDER_CHANNEL_V     = 13    ' The vertical slider channel
%BK_PROGRESS_H_NORMAL    = 14    ' The horizontal progress bar normal state
%BK_PROGRESS_V_NORMAL    = 15    ' The vertical progress bar normal state
%BK_PROGRESS_H_OVER      = 16    ' The horizontal progress bar overcast state
%BK_PROGRESS_V_OVER      = 17    ' The vertical progress bar overcast state
%BK_IMAGE_ARROW          = 1001  ' The arrows for ScrollBar
%BK_CUSTOM               = 10000 ' Indicate this background comes from custom skin objects (only for v.2.6 or better)


DECLARE FUNCTION BkCreate LIB "appfaceu.dll" ALIAS "BkCreate" (BYVAL nBkType   AS LONG) AS LONG
DECLARE FUNCTION BkDelete LIB "appfaceu.dll" ALIAS "BkDelete" (BYVAL nBkHandle AS DWORD) AS LONG
DECLARE FUNCTION BkDraw LIB "appfaceu.dll" ALIAS "BkDraw"(BYVAL nBkHandle AS DWORD, BYVAL dcTarget AS LONG, BYREF rcTarget AS RECT, BYVAL nReserved AS LONG) AS LONG
DECLARE FUNCTION SkinRemove LIB "appfaceu.dll" ALIAS "SkinRemove" () AS LONG
DECLARE FUNCTION SkinStart LIB "appfaceu.dll" ALIAS "SkinStart" (BYVAL SkinFile AS STRING, BYVAL nDefWinType AS LONG, BYVAL CheckSum AS STRING, BYVAL nType AS LONG, BYVAL hInstance AS DWORD, BYREF szResType AS LONG) AS LONG
DECLARE FUNCTION SkinStartW LIB "appfaceu.dll" ALIAS "SkinStart" (BYVAL SkinFile AS WSTRING, BYVAL nDefWinType AS LONG, BYVAL CheckSum AS STRING, BYVAL nType AS LONG, BYVAL hInstance AS DWORD, BYREF szResType AS LONG) AS LONG
DECLARE FUNCTION SkinThread LIB "appfaceu.dll" ALIAS "SkinThread" () AS LONG
DECLARE FUNCTION SkinWindowSet LIB "appfaceu.dll" ALIAS "SkinWindowSet" (BYVAL hWnd  AS LONG, BYVAL bSkin AS LONG) AS LONG
DECLARE FUNCTION SkinWindowSetEx LIB "appfaceu.dll" ALIAS "SkinWindowSetEx" (BYVAL hWnd AS LONG, BYVAL nSkinType AS LONG, BYVAL nResourceId AS LONG, BYVAL nUrfLoadType AS LONG, BYVAL SkinFile AS STRING, BYVAL hInstance AS DWORD, _
                                                                             BYREF szResType AS LONG) AS LONG
DECLARE FUNCTION SkinWindowSetExW LIB "appfaceu.dll" ALIAS "SkinWindowSetEx" (BYVAL hWnd AS LONG, BYVAL nSkinType AS LONG, BYVAL nResourceId AS LONG, BYVAL nUrfLoadType AS LONG, BYVAL SkinFile AS STRING, BYVAL hInstance AS DWORD, _
                                                                              BYREF szResType AS LONG) AS LONG
__________________
Francisco Castanedo
Software Developer
Distribuidora 3HP, C.A.
http://www.distribuidora3hp.com
Reply With Quote
  #6  
Old May 12th, 2012, 12:14 PM
Francisco Castanedo Francisco Castanedo is offline
Member
 
Join Date: Nov 2008
Location: Caracas, Venezuela
Posts: 216
Well, I had to do one example myself. My null knowledge of VB6 didn't help but I got 80% of the code working. I hope someone may complete the other 20% (and correct errors too). The coding is based on what the PowerForm 2.0 translated from the VB6 sample in the AppFace Trial.

I've have learned a couple of good tricks doing it.

You will need the trial to run the sample.

There are references to PowerBasic in the AppFace site, but they are scattered. Nevertheless they "support" PowerBasic. They have the Inc file for it. The one above I made myself.

AppFace is a terrific product. And it is affordable too. I already bought a license.

http://www.appface.com/eng/
Attached Files
File Type: rar PowerBASIC Appface Samples.rar (693.0 KB, 18 views)
__________________
Francisco Castanedo
Software Developer
Distribuidora 3HP, C.A.
http://www.distribuidora3hp.com
Reply With Quote
  #7  
Old May 12th, 2012, 12:50 PM
Francisco Castanedo Francisco Castanedo is offline
Member
 
Join Date: Nov 2008
Location: Caracas, Venezuela
Posts: 216
Oops!

I forgot to tell that the 20% I could not translate, I DISABLED it. (The code is there, though)
So the corresponding buttons won't work.
__________________
Francisco Castanedo
Software Developer
Distribuidora 3HP, C.A.
http://www.distribuidora3hp.com
Reply With Quote
  #8  
Old May 13th, 2012, 12:26 PM
Michael Mattias Michael Mattias is offline
Member
 
Join Date: Aug 1998
Location: Racine WI USA
Posts: 36,491
Code:
%GWL_WNDPROC                  = (-4)
'%WM_USER                      = &H400 ' Already defined in PB9 & PB10 (Built-in Numeric Equates)

' Already defined in WIN32API.INC:
'TYPE RECT
'    Left   AS LONG
'    Top    AS LONG
'    Right  AS LONG
'    Bottom AS LONG
'END TYPE
==>

Code:
#IF NOT %DEF(%GWL_WNDPROC) 
    %GWL_WNDPROC = whatever
#ENDIF
And actually the compiler does not care if you define an equate twice as long as you define it the same way twice.

Too bad
A)
Code:
%IF NOT %DEF (RECT) 
    TYPE RECT 
       member 
       member 
       ...
    END TYPE
... is not (in spite of a new feature request) supported
AND
B)
Code:
 
   LOCAL X AS LONG 
   LOCAL A AS something 
   ... 
   LOCAL X AS LONG
... does not detect "defined twice but the same way so it's not an error" the way it works for equates.


MCM
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 12:11 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Copyright 1999-2011 PowerBASIC, Inc. All Rights Reserved.
Error in my_thread_global_end(): 1 threads didn't exit