Page 1 of 1

Folders

Posted: Thu Oct 13, 2005 1:02 am
by Jeff Barnes
Hi Everybody,

I have never used folders before and now have a need to.

I would like to create the folders from resources (Borland Resource Workshop).

Can someone please provide a sample as to how I would create folders.

Thanks,

Jeff

Re: Folders

Posted: Thu Oct 13, 2005 2:02 am
by DanielPuente
Jeff:

// This is the main dialog that contains the folder control

DEFINE DIALOG oDlg RESOURCE "OCOMPRA" ;
TITLE OEMTOANSI("Actualizaci¢n de Orden de Compra N§ ")+LEFT(MOVSTOCK->OCNUM,2)+"-"+;
SUBSTR(MOVSTOCK->OCNUM,3,4)+'-'+RIGHT(MOVSTOCK->OCNUM,4) ;
COLOR CLR_BLACK, RGB(202, 197, 192)

// This is the folder declaration

REDEFINE FOLDER oFld ID 701 OF oDlg ;
PROMPT "Datos Generales","Articulos","Vista Previa","Recibido del proveedor",;
oemtoansi("Env¡os realizados");
DIALOGS "FOLDER_DATOSG" ,"FOLDER_OPMER","OPVPREVIA","ENTREGA3","ENVIOS"


// This is a get that belongs to that main dialog

REDEFINE GET cFecha ID 103 FONT oFont3 OF oDlg PICTURE "@d" UPDATE

// This are controls that belongs to the first folder

REDEFINE GET oNumdoc VAR cOcNum ID 101 FONT oFont1 OF oFld:aDialogs[1] ;
VALID Valnumdoc(oFld,lNew,cXoc,@cOcNum,cEjercicio,oNumdoc,cOcOf) PICTURE "99999";
WHEN (WNRO_NIV == 1)
REDEFINE SAY oEjercicio PROMPT "/ "+SUBSTR(cEjercicio,3,2) ID 118 FONT oFont1 OF oFld:aDialogs[1]


// This to the second folder

REDEFINE SBUTTON OT:oBtn[1] FONT oFont4 ID 121;
RESOURCE "B_RNW","B_RNW","B_RNW" OF oFld:aDialogs[2] ;
PROMPT "&Agrega" ;
ACTION ( TAgrega(),Habilita(),OBACEPTAR:DISABLE(),OBCANCELAR:DISABLE(),oImprimir:Disable(),;
oAceptar:Enable(),oCancelar:enable(),oImprimir:Disable() ) ;
TOOLTIP "Agrega una nueva partida de articulos (Insert)" ;
TEXT POSITION ON_BOTTOM;
LOOK W97

// Finally, you activate the main dialog as usual

ACTIVATE DIALOG oDlg CENTERED VALID OPSALIR(oDlg,oFld,oAceptar,oCancelar,OBACEPTAR,OBCANCELAR,OIMPRIMIR,;
owCodSubp,owNomSubp1,owNomSubp2,@cwCodsubp,@cwNomsubp1,@cwNomsubp2) ;
ON INIT desabilita(oAceptar,oCancelar)

The dialogs in workshop have to be:

-Window type: CHILD
-Dialog style: only visible checked


Regards,

Jeff Barnes wrote:Hi Everybody,

I have never used folders before and now have a need to.

I would like to create the folders from resources (Borland Resource Workshop).

Can someone please provide a sample as to how I would create folders.

Thanks,

Jeff

Posted: Thu Oct 13, 2005 8:37 am
by Taiwan
Hello Jeff,

This is fix/Enhance Folder function. Below:

Code-PRG

#include "Fivewin.ch"
#include "Folder.ch"
.........
REDEFINE FOLDER ::oFld ID 300 OF ::oDlg ;
PROMPTS "基本資料" , "家屬成員", "現狀圖" ,;
"平面設計圖", "交屋贈品", "業主申訴" ,;
"禮品發送" , "完工照片" ;
DIALOGS "D_DR_WIN_CUSTMSF_FLD1", "D_DR_WIN_CUSTMSF_FLD2",;
"D_DR_WIN_CUSTMSF_FLD3", "D_DR_WIN_CUSTMSF_FLD4",;
"D_DR_WIN_CUSTMSF_FLD5", "D_DR_WIN_CUSTMSF_FLD6",;
"D_DR_WIN_CUSTMSF_FLD7", "D_DR_WIN_CUSTMSF_FLD8" ;
BITMAPS { GetC5MenuIconDir()+"TCustMsf01.ico",;
GetC5MenuIconDir()+"TCustMsf02.ico",;
GetC5MenuIconDir()+"TCustMsf03.ico",;
GetC5MenuIconDir()+"TCustMsf04.ico",;
GetC5MenuIconDir()+"TCustMsf05.ico",;
GetC5MenuIconDir()+"TCustMsf06.ico",;
GetC5MenuIconDir()+"TCustMsf07.ico",;
GetC5MenuIconDir()+"TCustMsf08.ico" }

::oFld:SetFont( oFnt1 )


Resource File

D_DR_WIN_CUSTMSF DIALOG 5, -17, 508, 367
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "客戶基本資料"
FONT 12, "細明體"
{
CONTROL "", 301, "TCBrowse", WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 1, 274, 506, 80
CONTROL "", 300, "SysTabControl32", 0 | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 1, 19, 506, 254
}




Regards,

Richard Huang
Fivetech.net Taiwan
http://www.fivetech.com.tw

Posted: Fri Oct 14, 2005 11:01 am
by Antonio Linares
Jeff,

You may review the working samples\TestFld... prg at FWH samples directory.

Posted: Sun Oct 23, 2005 5:15 pm
by Jeff Barnes
Thanks guys ... I have it working now.