change title header of outlook2003

change title header of outlook2003

Postby Silvio » Fri Aug 01, 2008 5:27 pm

How I can to modify the title header of outlook2003 of each agroup ?

when I change record of xbrowse I want call this

FUNCTION RefreshCont(oCont,cdbf)
oCont:cTitle:="Cust "+tran((cdbf)->(OrdKeyNo()),'@E 999,999')+" / "+tran((cdbf)->(OrdKeyCount()),'@E 999,999')
oCont:refresh()
return NIL


oCont must be the header of outlook2003 group number 1
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Postby Antonio Linares » Fri Aug 01, 2008 7:30 pm

Silvio,

oOutLook2003:aGroups[ n ]:cPrompt = "text"
oOutLook2003:aGroups[ n ]:Paint()
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42122
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Silvio » Fri Aug 01, 2008 9:48 pm

Application
===========
Path and name: C:\work\errori\testoutlook3\test2003.Exe (32 bits)
Size: 1,489,920 bytes
Time from start: 0 hours 0 mins 2 secs
Error occurred at: 08/02/08, 23:44:37
Error description: Error BASE/1004 Class: 'NIL' has no exported method: AGROUPS
Args:
[ 1] = U


Code: Select all  Expand view  RUN



#include "FiveWin.ch"
#include "Splitter.ch"
#include "xbrowse.ch"

REQUEST DBFCDX, DBFFPT
External ordkeyno, ordkeycount,ordcreate

static lExit := .F.
STATIC aCtrl         // <-----
static oGrid ,nsplit:=0
static oBar
static oWnd
static oOutLook2003
//----------------------------------------------------------------------------//

function Main()

   local oWnd, oOutLook2003, oStatusBar, oSplit, cCombo, oRad, nValue := 1
   local oFont
   lOCAL nSplit:=191
    RddSetDefault( "DBFCDX" )
   DEFINE WINDOW oWnd TITLE "WinBeach - 1.00 - Light version" MDI ;
   MENU BuildMenu()


    DEFINE BUTTONBAR oBar _3D SIZE 44, 46 OF oWnd 2007
     oBar:bRClicked := { || .t. }

       DEFINE BUTTON OF oBar ;
      RESOURCE "BB1"       ;
      TOOLTIP i18n( "Gestión de documentos" ) ;
      MESSAGE i18n( "Gestión de del fichero de documentos." ) ;
      NOBORDER











   DEFINE OUTLOOK2003 oOutLook2003 OF oWnd ;
      PROMPTS "Spiaggia", "Calendario", "Contatti", "Restaurant" ;
      BITMAPS ".\bitmaps\mail.bmp", ".\bitmaps\calendar.bmp", ".\bitmaps\notes.bmp";
      ON CHANGE (Show (oOutLook2003, oWnd:oWndClient,nSplit)) // <-----

   aCtrl := Array (Len (oOutLook2003:aGroups))                  // <-----

   oWnd:oLeft = nil // Because the splitter is going to control the resize



   // DIALOG 1
   @ 1, 2 BUTTON "New" OF oOutLook2003:aDialogs[ 1 ] SIZE 80, 22 ACTION BuildDlg()
   @ 3, 2 BUTTON "Edit" OF oOutLook2003:aDialogs[ 1 ] SIZE 80, 22 ACTION MsgInfo( "Edit" )
   @ 5, 2 BUTTON "Search" OF oOutLook2003:aDialogs[ 1 ] SIZE 80, 22 ACTION MsgInfo( "Search" )



  // DIALOG 3
   @ 1, 2 BUTTON "New" OF oOutLook2003:aDialogs[ 3] SIZE 80, 22 ACTION BuildDlg()
   @ 3, 2 BUTTON "Edit" OF oOutLook2003:aDialogs[ 3 ] SIZE 80, 22 ACTION MsgInfo( "Edit" )
   @ 5, 2 BUTTON "Search" OF oOutLook2003:aDialogs[ 3 ] SIZE 80, 22 ACTION MsgInfo( "Search" )















   @ 1, 1 COMBOBOX cCombo ITEMS { "January", "February", "March", "April", "May" } ;
      OF oOutLook2003:aDialogs[ 2 ] SIZE 170, 100

   DEFINE FONT oFont NAME "Arial" SIZE 0, -10

   @ 12, 10 SAY Date() OF oOutLook2003:aDialogs[ 2 ] SIZE 80, 20 FONT oFont

   @ 3, 1 RADIO oRad VAR nValue OF oOutLook2003:aDialogs[ 2 ] ;
      ITEMS "&Day", "&Week", "&Month" SIZE 100, 20

   oRad:SetFont( oFont )

   #ifndef __CLIPPER__
      DEFINE STATUSBAR oStatusBar PROMPT "  FWH Class TOutLook2003" OF oWnd
   #else
      DEFINE MESSAGE oStatusBar PROMPT "  FWH Class TOutLook2003" OF oWnd
   #endif

   SetParent( oOutLook2003:hWnd, oWnd:hWnd )

   oWnd:oClient = nil

   @ 0, 191 SPLITTER oSplit ;
      VERTICAL _3DLOOK ;
      PREVIOUS CONTROLS oOutLook2003 ;
      HINDS CONTROLS oWnd:oWndClient ;
      SIZE 4, oWnd:nHeight - 70 PIXEL ;
      OF oWnd

   SetParent( oSplit:hWnd, oWnd:hWnd )


   *oWnd:bResized := {|| ResizeWndMain() }


   ACTIVATE WINDOW oWnd ;
     ON RESIZE oSplit:Adjust();
      VALID lExit := .T.

      return nil

Function ResizeWndMain(oWnd)
   local aClient
   aClient := GetClientRect (oWnd:hWnd )
   oGrid:SetSize( aClient[4], oWnd:nHeight - 26 )
      return nil

//----------------------------------------------------------------------------//



//----------------------------------------------------------------------------//

function BuildDlg()

   local oDlg, oOutL2003

   DEFINE DIALOG oDlg RESOURCE "Test"

   REDEFINE OUTLOOK2003 oOutL2003 ID 110 OF oDlg ;
      PROMPTS "One", "Two", "Three" ;
      BITMAPS ".\bitmaps\mail.bmp", ".\bitmaps\calendar.bmp", ".\bitmaps\notes.bmp" ;
      DIALOGS "Page1", "Page2", "Page3"

   REDEFINE BUTTON ID 110 OF oOutL2003:aDialogs[ 1 ] ACTION MsgInfo( "Click" )

   ACTIVATE DIALOG oDlg CENTERED

return nil

//----------------------------------------------------------------------------//

function WinRun()

   while NoGPF()
      if lExit
         PostQuitMessage( 0 )
      endif
   end

return nil

//----------------------------------------------------------------------------//

#pragma BEGINDUMP

#include <windows.h>
#include <hbapi.h>

BOOL SysRefresh( void );

HB_FUNC( NOGPF )
{
   __try
   {
      hb_retl( SysRefresh() );
   }
   __except ( ( hb_retl( TRUE ), TRUE ) )
   {}
}

#pragma ENDDUMP






#define LIGHTBLUE    nRGB(  89, 135, 214 )
#define DARKBLUE     nRGB(   3,  56, 147 )
#define LIGHTORANGE1 nRGB( 250, 227, 143 )
#define DARKORANGE1  nRGB( 238, 152, 25 )
#define LIGHTCYAN    nRGB( 203, 225, 252 )
#define DARKCYAN     nRGB( 125, 165, 224 )
#define LIGHTORANGE2 nRGB( 255, 255, 220 )
#define DARKORANGE2  nRGB( 247, 192, 91 )







//---------------------------------------------------------------
FUNCTION Show (oOutLook, oWnd,nSplit)          // <-----

LOCAL nPage := AScan( oOutLook:aGroups, { | o | o:lSelected } )
LOCAL nAllPages := Len (oOutLook:aGroups)
LOCAL oDlg, oCtrl, i
Local hDC :=oWnd:getdc()
Local oGrid,oFont
Local ntop   ,ocol  ,for

DEFINE FONT oFont NAME "Arial" SIZE 0, -20


FOR i := 1 TO nAllPages
  IIF (Valtype (aCtrl[i]) ="O",aCtrl[i]:Hide(), )
NEXT

nTop = oWnd:nHeight - ( Len(oOutLook:aGroups ) *166 )

DO CASE
CASE nPage = 1
     IF Valtype (aCtrl[nPage]) ="O"
    aCtrl[nPage]:Show()
ELSE



ENDIF
CASE nPage = 2







CASE nPage = 3

  IF Valtype (aCtrl[nPage]) ="O"
    aCtrl[nPage]:Show()
ELSE
    //header

      Gradient( hDC,  { nTop, 50, nTop + 30,  oWnd:nWidth() }, DARKBLUE, LIGHTBLUE, .T. )
      oWnd:Say( nTop + 8 , 200,"Customer",CLR_WHITE,,oFont, .T., .T. )




   /* DEFINE DIALOG aCtrl[nPage] FROM 1,1 TO 15,35 OF oWnd ;
           TITLE "I am at the right side"
    ACTIVATE DIALOG aCtrl[nPage] ;
             ON INIT aCtrl[nPage]:Center (oWnd);
             NOWAIT

      */




   // GRID
    Db_Open("customer", "CUST" )



   oGrid := TXBrowse():New( oWnd )
   oGrid:nTop    := nTop +50
   oGrid:nLeft   := nSplit+1
   oGrid:nBottom :=   oWnd:nheight()
   oGrid:nRight  :=  oWnd:nWidth()
   oGrid:cAlias := "CUST"


   oGrid:nMarqueeStyle       := MARQSTYLE_HIGHLCELL
   oGrid:nColDividerStyle    := LINESTYLE_BLACK
   oGrid:nRowDividerStyle    := LINESTYLE_BLACK
   oGrid:lColDividerComplete := .f.

   oGrid:SetRDD()

    for nFor := 1 to len( oGrid:aCols )
      oCol:= oGrid:aCols[ nFor ]
      oCol:nEditType := 1
      oCol:bOnPostEdit := {|o, v, n| iif( n != VK_ESCAPE, FieldPut( o:nCreationOrder, v ), ) }
   next

   oGrid:CreateFromCode()
   oWnd := oGrid
          oCont:= oOutLook2003:aGroups[ 3 ]:cPrompt
          oGrid:bChange  := { || RefreshCont( oCont,"CUst") }







    */








ENDIF


  CASE nPage = 4

IF Valtype (aCtrl[nPage]) ="O"
    aCtrl[nPage]:Show()
ELSE

oWnd:Say( nTop + 8 , 200,"tavoli",CLR_WHITE,,oFont, .T., .T. )




ENDIF

ENDCASE


RETURN (nil)



  FUNCTION RefreshCont(oCont,cdbf)
    oCont:cTitle:="Cust "+tran((cdbf)->(OrdKeyNo()),'@E 999,999')+" / "+tran((cdbf)->(OrdKeyCount()),'@E 999,999')
    oCont:refresh()
    return NIL


   FUNCTION Db_Open(cdbf, cAlias )
  use &cDbf ALIAS  &cAlias index &cDbf
  RETURN .t.



Function BuildMenu()

   local oMenu
   MENU oMenu 2007

      MENUITEM "&Archivo"
         MENU
            MENUITEM i18n( "Specificare Stampante" ) ;
               ACTION PrinterSetup() ;
               MESSAGE i18n( " Configurazione stampantea. " )
            SEPARATOR
            MENUITEM i18n( "Uscita" ) ;
               ACTION oWnd:end() ;
               MESSAGE i18n( " Terminare la esecuzione del programma. " )
         ENDMENU
   ENDMENU
RETURN oMenu





Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Postby Antonio Linares » Fri Aug 01, 2008 10:44 pm

Silvio,

You have to previously initialize oOutLook2003. It is nil, thats why you get the error.
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42122
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Silvio » Sat Aug 02, 2008 6:33 am

sorry but i not understand , i take your source sample:

 DEFINE OUTLOOK2003 oOutLook2003 OF oWnd

and oOutLook2003 is static

why not found it ?

i only add a xbrowse to right

and then i want resize the xbrowse when i resize the main window.
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Postby Antonio Linares » Sat Aug 02, 2008 7:44 am

Silvio,

In FWH\samples\Test2003.prg add this line:
Code: Select all  Expand view  RUN
   DEFINE OUTLOOK2003 oOutLook2003 OF oWnd ;
      PROMPTS "Mail", "Calendar", "Contacts", "" ;
      BITMAPS "..\bitmaps\mail.bmp", "..\bitmaps\calendar.bmp", "..\bitmaps\notes.bmp"
     
   MsgInfo( ValType( oOutLook2003 ), oOutLook2003:ClassName() )   // this one!
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42122
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Silvio » Sat Aug 02, 2008 3:58 pm

right and I made on function Show

LOCAL nPage := AScan( oOutLook:aGroups, { | o | o:lSelected } )
LOCAL nAllPages := Len (oOutLook:aGroups)


FOR i := 1 TO nAllPages
IIF (Valtype (aCtrl[i]) ="O",aCtrl[i]:Hide(), )
NEXT

nTop = oWnd:nHeight - ( Len(oOutLook:aGroups ) *166 )

DO CASE

....

CASE nPage = 3

IF Valtype (aCtrl[nPage]) ="O"
aCtrl[nPage]:Show()
ELSE

oGrid := TXBrowse():New( oWnd )

oCont:= oOutLook2003:aGroups[ nPage ]:cPrompt

oGrid:bChange := { || RefreshCont( oCont,"CUst") }


where is the error ?
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Postby Antonio Linares » Sat Aug 02, 2008 5:21 pm

Silvio,

>
oCont:= oOutLook2003:aGroups[ nPage ]:cPrompt

oGrid:bChange := { || RefreshCont( oCont,"CUst") }
>

oCont is a string! You should do:

oCont:= oOutLook2003:aGroups[ nPage ]
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42122
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Silvio » Sun Aug 03, 2008 1:12 am

Antonio ,
it run ok but I wanted show it on headder on top and not on menu
I hope Uunderstand me
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Postby Antonio Linares » Sun Aug 03, 2008 7:22 am

Silvio,

No, sorry, I don't understand what you mean.

Please post a screenshot, thanks
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42122
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Silvio » Sun Aug 03, 2008 10:00 am

the Header I want modify must not be the down title "sala1" but on the top "contatti"


Now I have another error look it please i need you help

Image

when I click on menu "sala1" I want see only the buttons but I see also the xbrowse ( customer) why ?

thanks
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Postby Antonio Linares » Sun Aug 03, 2008 10:16 am

Silvio,

> the Header I want modify must not be the down title "sala1" but on the top "contatti"

oOutLook2003:oHeader:cPrompt = "new Text"
oOutLook2003:Paint()
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42122
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Antonio Linares » Sun Aug 03, 2008 10:17 am

Silvio,

Please provide a small and self contained example so we can test it and help you, thanks
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42122
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Silvio » Sun Aug 03, 2008 3:24 pm

the sample is here
www.teramoest.it/test_antonio_outlook3.rar
I use two dbf ( customer and part they are in sample directory) and I use a panel to show many buttons

when I open the application I must see the buttons but I not see they
then
I select the second menu I see the first xbrowse
then
I select the third menu I see the second xbrowse but the procedure not erase the first xbrowse
then
I select the first menu now I see the button but there are also the xbrowse 1 and xbrowse 2

How I can to see one screen ( xbrowse1 or xbrowse2 or Panel button) ?

i think this technical method can be usefull for all community

thanks
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 40 guests