Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix crash nella funzione 'stampa database' #2

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Binary file modified libreria/output/lib200-832/rel/DBLANG.DLL
Binary file not shown.
Binary file modified libreria/output/lib200-832/rel/DBLANG.lib
Binary file not shown.
Binary file modified libreria/output/lib200-832/rel/DBLANGBR.DLL
Binary file not shown.
Binary file modified libreria/output/lib200-832/rel/DBLANGBR.lib
Binary file not shown.
Binary file modified libreria/output/lib200-832/rel/DBLANGEN.DLL
Binary file not shown.
Binary file modified libreria/output/lib200-832/rel/DBLANGEN.lib
Binary file not shown.
Binary file modified libreria/output/lib200-832/rel/DBLANGES.DLL
Binary file not shown.
Binary file modified libreria/output/lib200-832/rel/DBLANGES.lib
Binary file not shown.
Binary file modified libreria/output/lib200-832/rel/DBLANGIT.DLL
Binary file not shown.
Binary file modified libreria/output/lib200-832/rel/DBLANGIT.lib
Binary file not shown.
Binary file modified libreria/output/lib200-832/rel/VDBSEE1O.DLL
Binary file not shown.
Binary file modified libreria/output/lib200-832/rel/VDBSEE1O.lib
Binary file not shown.
Binary file modified libreria/output/lib200-832/rel/VDBSEE1S.DLL
Binary file not shown.
Binary file modified libreria/output/lib200-832/rel/VDBSEE1S.lib
Binary file not shown.
Binary file modified libreria/output/lib200-832/rel/VDBSEE1X.lib
Binary file not shown.
Binary file modified libreria/output/lib200-832/rel/omf/VDBSEE1O.lib
Binary file not shown.
Binary file modified libreria/output/lib200-832/rel/omf/VDBSEE1S.lib
Binary file not shown.
Binary file modified libreria/output/lib200-832/rel/uuid.lib
Binary file not shown.
16 changes: 16 additions & 0 deletions libreria/src/base/DDFILE.PRG
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
#include "dfstd.ch"
#include "dfset.ch"

//FWH: 2021-10-29
// se valorizzata contiene il nome della finestra da aprire quando si chiama la funzione ddwin
MEMVAR INFOTEL_DEFAULT_WIN

* �����������������������������������������������������������������������������
FUNCTION ddFilePos( cFile, lErrMsg )
* �����������������������������������������������������������������������������
Expand Down Expand Up @@ -224,6 +228,18 @@ RETURN cS1
* �����������������������������������������������������������������������������
FUNCTION ddIndexWin() // Finestra sull'indice
* �����������������������������������������������������������������������������

//FWH: 2021-10-29
// la finestra alternativa viene visualizzata solo se
// INFOTEL_DEFAULT_WIN non e' vuota
// i primi 6 caratteri del nome della finestra alternativa sono uguali a quelli
// impostati attraverso l'indice (es. ANAWIN e ANAWIN1)
IF .not. empty(INFOTEL_DEFAULT_WIN)
IF LEFT(ALLTRIM(INFOTEL_DEFAULT_WIN),6) = LEFT(ALLTRIM(dbdd->Field_Chk),6)
RETURN ALLTRIM(INFOTEL_DEFAULT_WIN)
ENDIF
ENDIF

RETURN ALLTRIM(dbdd->Field_Chk)

* �����������������������������������������������������������������������������
Expand Down
13 changes: 10 additions & 3 deletions libreria/src/base/DFCOL2PR.PRG
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ Programmer : Baccan Matteo
#include "dfMsg.ch"
#include "common.ch"

* ����������������������������������������������������������������������������
* ����������������������������������������������������������������������������?
FUNCTION dfCol2Prn( oTbr, cTitle )
* ����������������������������������������������������������������������������
* ����������������������������������������������������������������������������?
LOCAL k,oC,aTag:={},aP:={}
LOCAL cH

Expand All @@ -21,6 +21,13 @@ FOR k:=1 to oTbr:COLCOUNT
//cH:=oC:HEADING
cH:=tbGetColHeading(oC)

// FWH: 2020-06-18 -------------------------------------------------
// cH potrebbe essere un oggetto (per esempio 'S2CellGroup')
if valtype(cH) # "C"
cH = var2char(cH)
endif
// -----------------------------------------------------------------

//Maudp 30/05/2011 In caso di funzione eseguo la compile e poi la eval
IF !EMPTY(cH) .AND. "_FX_" $ cH
cH := ALLTRIM(STRTRAN(cH,"!",""))
Expand All @@ -29,7 +36,7 @@ FOR k:=1 to oTbr:COLCOUNT
// AADD(aP,oC:HEADING)
/////////////////////////////////////////
//Mantis 2161
//Se l'intestazione delle colonne vuoto allora si puavere un runtime error.
//Se l'intestazione delle colonne ?vuoto allora si pu?avere un runtime error.
/////////////////////////////////////////
IF EMPTY(cH)
cH := "Colonna_"+STRZERO(k,3,0)
Expand Down
2 changes: 1 addition & 1 deletion libreria/src/base/DFLIBDAT.PRG
Original file line number Diff line number Diff line change
@@ -1 +1 @@
FUNCTION dfLibDate(); RETURN ("18/10/2019")
FUNCTION dfLibDate(); RETURN ("29/10/2021")
15 changes: 13 additions & 2 deletions libreria/src/base/INITVAR.PRG
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,17 @@
//Programmatore : Baccan Matteo
//*****************************************************************************

* ����������������������������������������������������������������������������
* ����������������������������������������������������������������������������?
PROCEDURE dfInitVar() // Dichiara PUBLIC
* ����������������������������������������������������������������������������
* ����������������������������������������������������������������������������?
MEMVAR EnvId, SubId
MEMVAR A, Sa, Act
MEMVAR dfHotFun
//FWH: 2021-03-17
MEMVAR INFOTEL_LAST_MENU_PROMPT

//FWH: 2021-10-29
MEMVAR INFOTEL_DEFAULT_WIN

// Help
PUBLIC EnvId := ""
Expand All @@ -22,4 +27,10 @@ PUBLIC Act := " " // azione contenente tre caratteri mnemonici

PUBLIC dfHotFun := "dfCalc" // Funzione associata al tasto caldo

//FWH: 2021-03-17
PUBLIC INFOTEL_LAST_MENU_PROMPT := "" // memorizza il nome dell'ultima voce di menu cliccata

//FWH: 2021-10-29
PUBLIC INFOTEL_DEFAULT_WIN := "" // se valorizzata contiene il nome della finestra da aprire quando si chiama la funzione ddwin

RETURN
14 changes: 12 additions & 2 deletions libreria/src/base/ddqry.prg
Original file line number Diff line number Diff line change
Expand Up @@ -136,10 +136,20 @@ IF !EMPTY(aStruct)
cPic := REPLICATE( "X", 50 )

ENDCASE
dfGetW( MAXROW()/2, 1, ALLTRIM(aFieldDes[ATAIL(aFilter)[QRY_FIE]]) +" " +;

// FWH: 2021-09-02 -------------------------------------------------
// con alcune finestre (tipo quelle con il resize automatico)
// maxrow() restituisce un numero molto (ma molto) grande. Questo
// causa un malfunzionamento in dfGetW che, a cascata, impedisce
// il corretto funzionamento delle finestre di stampa. In questi
// casi bisognava terminare il programma forzatamente.
// Ho sperimentato che 12 e' un valore accettabile quindi prendo
// il minore tra 12 e MAXROW()/2
// -----------------------------------------------------------------
dfGetW( min(12, MAXROW()/2), 1, ALLTRIM(aFieldDes[ATAIL(aFilter)[QRY_FIE]]) +" " +;
ATAIL(aFilter)[QRY_COND],;
{|x|IF(x==NIL,uVar,uVar:=x)}, cPic )

DO CASE
CASE M->Act=="esc" .OR.; // Ho premuto ESC
(EMPTY(uVar) .AND. !VALTYPE(uVar)$"N") // o e' vuoto
Expand Down
72 changes: 71 additions & 1 deletion libreria/src/s2/S2FORM.prg
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,30 @@ MEMVAR ACT, A, SA




// #####################################################################
// # FWH 2021-10-08
// #####################################################################
//
// esiste un problema in xbase con l'istruzione SUPER
// che si manifesta quando una classe usa l'ereditarieta' multipla (come S2Form).
// In particolare le applicazioni vanno in crash quando viene chiamata
// S2Form:Destroy()
// esistono tre soluzioni temporanee al momento:
//
// 1) utilizzare xbase 2.0.1354 (problemi con univar dopo il passaggio da win7 -> win10)
//
// 2) modificare la catena di derivazione di S2Form in questo modo: CLASS S2Form FROM XbpDialogBmpMenu, S2Window, S2FormCompatibility
//
// 3) modificare xbparts.prg (2.0.1503) in questo modo:
// METHOD XbpDialog:Destroy()
// IF ::GetFrameState() == XBPDLG_FRAMESTAT_KIOSK
// KioskSystemKeyHandler():deinstall()
// ENDIF
// RETURN ::XbpBaseDialog:Destroy()
//
// Non avendo ricevuto risposta da Baccan sulle conseguenze della soluzione 2
// procedo con la soluzione 3 che sembra la meno invasiva in attesa di un fix ufficiale
// da parte di Alaska (ha confermato via email che sono al lavoro per correggere SUPER)

CLASS S2Form FROM S2Window, XbpDialogBmpMenu, S2FormCompatibility //, ServiceDialog //, AutoResize //, DbFilter
PROTECTED:
Expand Down Expand Up @@ -1780,6 +1803,14 @@ METHOD S2Form:ToolBarCreate(nSize, nMessageHeight)
LOCAL oImgStd, oImgDisabled, oImgFocus
LOCAL cTbrID
LOCAL bExe

// FWH 2021-03-19
// Aggiungo una var local per contare quanti bottoni ho aggiunto
// tramite template. I bottoni tramite template hanno ID che inizializza
// col carattere '9'
LOCAL i
LOCAL infotel_buttons := array(0)
LOCAL nSeparatori := 0

// Parent della toolbar
oWin := self
Expand Down Expand Up @@ -1834,6 +1865,45 @@ METHOD S2Form:ToolBarCreate(nSize, nMessageHeight)
// non era lo stesso array passato al :bToolbarHandler (questo procurava il problema 1.)
//
// come soluzione inizializzo sempre :aToolbar con l'array ritornato da :_ToolbarDefault()


// FWH 2021-03-19
// devo contare quanti bottoni sono stati aggiunti
// tramite template (hanno id che inizia con '9')

IF .not. ::aToolBar == NIL

FOR i := 1 TO len(::aToolBar)

IF len(::aToolBar[i]) == 1
nSeparatori += 1
LOOP
ENDIF

IF len(::aToolBar[i]) >= 5 .and. left(::aToolBar[i][5], 1) == "9"
aadd(infotel_buttons, ::aToolBar[i])
ENDIF

NEXT

ENDIF

// FWH 2021-03-19
// se la toolbar contiene sono bottoni inseriti tramite
// template allora ne faccio il merge con la toolbar di default
IF .not. ::aToolBar == NIL

IF len(::aToolBar) - len(infotel_buttons) - nSeparatori == 0
::aToolBar := ::_ToolBarDefault()

FOR i := 1 TO len(infotel_buttons)
aadd(::aToolBar, infotel_buttons[i])
NEXT

ENDIF

ENDIF

IF ::aToolBar==NIL
::aToolBar := ::_ToolBarDefault()
ENDIF
Expand Down
32 changes: 19 additions & 13 deletions libreria/src/s2/S2MENU.prg
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,32 @@
#include "dfWin.ch"
#include "DFMENU.CH"

//FWH: 2021-03-17
// aggiunto metodo S2Menu:handleEvent per memorizzare
// l'ultima voce di menu cliccata

MEMVAR INFOTEL_LAST_MENU_PROMPT

// S2Menu: Gestione Menu
// ---------------------
CLASS S2Menu FROM XbpMenuBmp
EXPORTED:
VAR id, methods, menuArray //, itemHighLighted
METHOD popUp, create //, handleEvent
METHOD popUp, create, handleEvent
ENDCLASS

//
// // Gestisce anche l'evento di evidenziazione voce di menu
// METHOD S2Menu:handleEvent(nEvent, mp1, mp2)
// DO CASE
// CASE nEvent == xbeMenu_HighLight
// IF ! EMPTY(::itemHighLighted)
// EVAL(::itemHighLighted, mp1, mp2, self)
// ENDIF
// OTHERWISE
// ::XbpMenu:handleEvent(nEvent, mp1, mp2)
// ENDCASE
// RETURN self
METHOD S2Menu:handleEvent(nEvent, mp1, mp2)
if nEvent == xbeP_ItemSelected
// dbmsgw(::XbpMenuBmp:getTitle() + " S2Menu:handleEvent(xbeP_ItemSelected)")
// dbmsgw(mp1)
// dbmsgw(mp2)
// dbmsgw(::XbpMenuBmp:getItem(mp1)[1])
INFOTEL_LAST_MENU_PROMPT := ::XbpMenuBmp:getItem(mp1)[1]
endif

::XbpMenu:handleEvent(nEvent, mp1, mp2)
RETURN self


METHOD S2Menu:Create(oParent, aPP, lVisible, aMethods, aMenuArray)
Expand Down
9 changes: 7 additions & 2 deletions libreria/src/s2/S2PRNMNU.prg
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,13 @@ METHOD S2PrintMenu:init( oParent, oOwner, aPos, aSize, aPP, lVisible )
::close := {|| ::nAction := 0 }

oXbp := XbpPushButton():new( ::drawingArea, , {204,12}, {96,24})
oXbp:caption := dfStdMsg1(MSG1_S2PRNMNU02)
oXbp:activate := {|u1,u2,o| IIF(o:isVisible(), dfFltRep( ::aBuffer ), NIL) }
oXbp:caption := dfStdMsg1(MSG1_S2PRNMNU02)

// FWH: 2021-09-02 -------------------------------------------------
// mostro il filtro attuale prima di iniziare la procedura per
// la creazione di un nuovo filtro
// -----------------------------------------------------------------
oXbp:activate := {|u1,u2,o| IIF(o:isVisible(), {dbmsgerr(::aBuffer[REP_QRY_EXP], "filtro attuale", XBPSTATIC_SYSICON_ICONINFORMATION), dfFltRep( ::aBuffer )}, NIL) }
oXbp:tabStop := .T.
::addShortCut(oXbp:caption, oXbp)
::addShortCut("A_f", oXbp)
Expand Down