GROUP LABEL "GroupLabel COLORS B,W"
Please use color constants like this:
GROUP LABEL "GroupLabel" COLORS CLR_WHITE,CLR_BLUE
This works with a window, but I was looking forward to using it with dialogs that are established in a resource file ( using the tbar control ).
We concede that we developed and tested on Window only. However, the way it is implemented now, it requires some extra work to make it work on Dialogs from Source/Resources.
Example of Dialog created by code:
#include "fivewin.ch"
function Main()
local oDlg, oBar
DEFINE DIALOG oDlg SIZE 800,300 PIXEL TRUEPIXEL TITLE "USING WINGDINGS AS BITMAPS"
DEFINE BUTTONBAR oBar OF oDlg SIZE 56,64 2013 HEIGHT 96
DEFINE BUTTON OF oBar PROMPT "Back" RESOURCE 0x100DF GROUP LABEL "Navigate" COLORS CLR_WHITE,CLR_HBLUE
DEFINE BUTTON OF oBar PROMPT "Top" RESOURCE 0x100E9
DEFINE BUTTON OF oBar PROMPT "Bottom" RESOURCE 0x100EA
DEFINE BUTTON OF oBar PROMPT "Add" RESOURCE 0x2002F GROUP LABEL "Edit" ;
COLORS CLR_WHITE, { { 1, CLR_BLACK, CLR_WHITE }, .F. }
DEFINE BUTTON OF oBar PROMPT "Edit" RESOURCE 0x20022
DEFINE BUTTON OF oBar PROMPT "Delete" RESOURCE 0x20033
DEFINE BUTTON OF oBar PROMPT "Save" RESOURCE 0x1003C GROUP LABEL "Export" COLORS CLR_WHITE,CLR_GREEN
DEFINE BUTTON OF oBar PROMPT "Refresh" RESOURCE 0x30050
DEFINE BUTTON OF oBar PROMPT "Setup" RESOURCE 0x1005D BTNRIGHT
AEval( oBar:aControls, { |oBtn| oBtn:bColorMap := { |o| If( o:lMOver, { CLR_BLACK, CLR_HRED }, nil ) } } )
ACTIVATE DIALOG oDlg CENTERED //ON INIT DlgInit( oDlg, oBar )
return nil
/*
function DlgInit( oDlg, oBar )
oBar:nBtnHeight := oBar:nHeight - 30
AEval( oBar:aControls, { |o| o:nHeight := oBar:nBtnHeight } )
oBar:Refresh()
return nil
*/
Example of Dialog from Resources:
#include "fivewin.ch"
REQUEST DBFCDX
function main()
local oDlg, oBar, oFont, oBrw
USE CUSTOMER NEW SHARED ALIAS CUST VIA "DBFCDX"
DEFINE FONT oFont NAME "TAHOMA" SIZE 0,-14
DEFINE DIALOG oDlg RESOURCE "timbar" TITLE FWVERSION FONT oFont
REDEFINE BUTTONBAR oBar ID 100 OF oDlg 2013 SIZE 80,90
DEFINE BUTTON OF oBar PROMPT "Add" FILE "c:\fwh\bitmaps\32x32\new.bmp" GROUP LABEL "Edit" COLORS CLR_WHITE,CLR_GREEN
DEFINE BUTTON OF oBar PROMPT "Edit" FILE "c:\fwh\bitmaps\32x32\edit.bmp"
DEFINE BUTTON OF oBar PROMPT "Delete" FILE "c:\fwh\bitmaps\delete.bmp" GROUP LABEL "Two" COLORS CLR_WHITE,CLR_BLUE
DEFINE BUTTON OF oBar PROMPT "Print" FILE "c:\fwh\bitmaps\print32.bmp"
DEFINE BUTTON OF oBar PROMPT "Quit" FILE "c:\fwh\bitmaps\32x32\exit.bmp" ACTION oDlg:End() BTNRIGHT
REDEFINE XBROWSE oBrw ID 101 OF oDlg DATASOURCE Alias() AUTOCOLS AUTOSORT FOOTERS
REDEFINE SAY oBrw:oSeek VAR oBrw:cSeek ID 4002 OF oDlg COLOR CLR_HRED,CLR_YELLOW
ACTIVATE DIALOG oDlg CENTERED //ON INIT DlgInit( oDlg, oBar )
RELEASE FONT oFont
return nil
/*
static function DlgInit( oDlg, oBar )
oBar:nBtnHeight := oBar:nHeight - 35
oBar:nWidth := oDlg:nWidth - 4
AEval( oBar:aControls, { |o| o:nHeight := oBar:nBtnHeight } )
oBar:Refresh()
return nil
*/
Resource file:
// RESOURCE SCRIPT generated by "Pelles C for Windows, version 8.00".
#include <windows.h>
#include <commctrl.h>
#include <richedit.h>
LANGUAGE LANG_ENGLISH,SUBLANG_ENGLISH_US
TIMBAR DIALOG DISCARDABLE 0, 0, 448, 244
STYLE WS_POPUP|DS_MODALFRAME|WS_CAPTION|WS_SYSMENU
EXSTYLE WS_EX_CLIENTEDGE|WS_EX_TRANSPARENT
CAPTION "Test"
FONT 8, "MS Sans Serif"
{
CONTROL "", 100, "TBar", 0x00000000, 0, 0, 448, 75
CONTROL "OK", IDOK, "Button", BS_DEFPUSHBUTTON|WS_TABSTOP, 316, 208, 50, 20
CONTROL "Cancel", IDCANCEL, "Button", WS_TABSTOP, 380, 208, 50, 20
CONTROL "", 101, "TXBrowse", WS_TABSTOP, 12, 112, 416, 84
CONTROL "cSeek", 4002, "Static", WS_GROUP, 40, 84, 356, 16, WS_EX_CLIENTEDGE
}
We shall be glad if you can test variants of the above samples and let us know if you encounter any problems.
Incidentally, the above samples also demonstrate using horizontal gradients as label backgrounds.
We are working on making these features work as straight forward as possible similar to window by either eliminating or reducing the requirement of extra code. So you may now try the above examples only for testing and reporting any problems. Please do not start implementing for dialogs in your regular applications till we come back again on this subject.