PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WINDEV 25 → WX - Bootstrap com Webdev e Barra retratil lateral
WX - Bootstrap com Webdev e Barra retratil lateral
Débuté par BOLLER, 09 mar. 2017 00:56 - Aucune réponse
Membre enregistré
3 657 messages
Popularité : +175 (223 votes)
Posté le 09 mars 2017 - 00:56
Prezados,

https://youtu.be/FX3ahESG0vw

Bootstrap com Webdev e Barra retratil lateral, segue codigos apresentados no video:

Procedure PAGE_Responsivo()

gbRetratilOnOff is boolean = True

gnSizeWindowBrowserWidth is int = 0
gnSizeWindowBrowserHeigth is int = 0

gnSizeBarLeftWidth is int = CELL_01..Width
gnSizeBarLeftHeigth is int = CELL_01..Height

gnDivcentralWidth is int = CELL_02..Width
gnDivcentralHeigth is int = CELL_02..Height

gnSizeMainCenterWidth is int = CELL_03..Width
gnSizeMainCenterHeigth is int = CELL_03..Height



//Captura a resolucao da tela
CookieWrite("Width",ResolucaoWidth(),10000)
CookieWrite("Heigth",ResolucaoHeigth(),10000)



// Summary: Displays an area
// Syntax:
//AreaDisplay (<nSubscript> is int)
//
// Parameters:
// nSubscript (integer): Subscript of the area to display
//
Procedure AreaDisplay(nSubscript is int)

nMargin is int = ZONE_Header..Height

BRW_Bar..Collapsed = True

SWITCH nSubscript
CASE 1
ScrollToAnime(ZONE_1..Y - nMargin)
CASE 2
ScrollToAnime(ZONE_2..Y - nMargin)
CASE 3
// YouTube video
ScrollToAnime(ZONE_3..Y - nMargin)

// Start the video playing
EXTERN player
IF player THEN
player.playVideo()
END

CASE 4
ScrollToAnime(ZONE_4..Y - nMargin)
CASE 5
ScrollToAnime(ZONE_5..Y - nMargin)
END



// Scroll to a position
function ScrollToAnime(nPosition){
$('html, body').animate({scrollTop:nPosition}, 'slow');
}



Procedure ArrayBrowserVariables()

DATE_NAVIG is string = DateSys()
TIME_NAVIG is string = TimeSys()
BROWSER_LINK is string = BrowserName()
BROWSER_VERSION is string = sBrowserVersion()
RESOLUTION is string = SysXRes() +" x "+ SysYRes()
NBCOLORS is string = eNbColors()
PLATFORM is string= sInitSystem()

IF Position(PLATFORM,"32") <> 0 THEN
PLATFORM = "32 bits"
ELSE
IF Position(PLATFORM,"64") <> 0 THEN
PLATFORM = "64 bits"
END
END

arrayResultado is array of string

Add(arrayResultado,DATE_NAVIG) // [01]
Add(arrayResultado,TIME_NAVIG) // [02]
Add(arrayResultado,BROWSER_LINK) // [03]
Add(arrayResultado,BROWSER_VERSION) // [04]
Add(arrayResultado,RESOLUTION) // [05]
Add(arrayResultado,NBCOLORS) // [06]
Add(arrayResultado,PLATFORM) // [07]

RESULT (arrayResultado)



Procedure ArrayServerVariables()

gsMessNotAvail is string = "Not available in test mode."

DATE_SERV, TIME_SERV, PATH, PATH_INFO, PATH_TRANSLATED, SCRIPT_NAME, SERVER_PORT, SERVER_PROTOCOL, HTTP_HOST, OS, SERVER_SOFTWARE, IP_ADDRESS_SERVER is string

//Test mode
IF InTestMode() THEN
DATE_SERV = DateSys()
TIME_SERV = TimeSys()
PATH = gsMessNotAvail
PATH_INFO = gsMessNotAvail
PATH_TRANSLATED = gsMessNotAvail
SCRIPT_NAME = gsMessNotAvail
SERVER_PORT = gsMessNotAvail
SERVER_PROTOCOL = gsMessNotAvail
HTTP_HOST = NetMachineName()
OS = "System: Windows " + SysWindowsVersion() +
" Version " + SysWindowsVersion(sysVersionNumber) +
" Compilation " + SysWindowsVersion(sysVersionBuild) +
" Platform " + SysWindowsVersion(sysVersionPlatform)

SERVER_SOFTWARE = gsMessNotAvail
IP_ADDRESS_SERVER = NetIPAddress(NoSpace(HTTP_HOST))


//Deployment mode
ELSE

//Date and time:
DATE_SERV = DateSys()
TIME_SERV = TimeSys()

//Caution: most of the environment variables sought here are
//specific to the server that hosts the WebDev application.
//We will present the most commonly implemented environment variables
//in the control panel of a Windows server.
//Among these variables, some of them may not be found on the server.
//They can be added manually into the configuration panel of Windows.

//Name of the CGI script used
SCRIPT_NAME = Replace( SysEnvironment("SCRIPT_NAME"),"SCRIPT_NAME=", "")

//Content of the "Windows" PATH of the server
PATH = Replace( SysEnvironment("Path"), "PATH=", "")

//Path of the script
PATH_INFO = Replace(SysEnvironment("PATH_INFO"),"PATH_INFO=" ,"")

//Absolute location of the CGI script on the server
PATH_TRANSLATED = Replace(SysEnvironment("PATH_TRANSLATED"),"PATH_TRANSLATED=","")

//Port number used by the server to receive the CGI requests
SERVER_PORT = Replace( SysEnvironment("SERVER_PORT") ,"SERVER_PORT=", "")

//Name and version of the protocol used
SERVER_PROTOCOL = Replace( SysEnvironment("SERVER_PROTOCOL"), "SERVER_PROTOCOL=","")

//Name of the server (if the server is in Windows 95, the HTTP_HOST
// HTTP_HOST = Replace (SysEnvironment("HTTP_HOST"),"HTTP_HOST=","")
HTTP_HOST = NetMachineName()

//Operating system
OS = "System: Windows " + SysWindowsVersion() +
" Version " + SysWindowsVersion(sysVersionNumber) +
" Compilation " + SysWindowsVersion(sysVersionBuild) +
" Platform " + SysWindowsVersion(sysVersionPlatform)


//Name and version of the Web server
SERVER_SOFTWARE = Replace(SysEnvironment("SERVER_SOFTWARE"),"SERVER_SOFTWARE=","")

//IP address of the server
IP_ADDRESS_SERVER = NetIPAddress(NoSpace(HTTP_HOST))

END

arrayResultado is array of string

Add(arrayResultado,DATE_SERV) // [01]
Add(arrayResultado,TIME_SERV) // [02]
Add(arrayResultado,PATH) // [03]
Add(arrayResultado,PATH_INFO) // [04]
Add(arrayResultado,PATH_TRANSLATED) // [05]
Add(arrayResultado,SCRIPT_NAME) // [06]
Add(arrayResultado,SERVER_PORT) // [07]
Add(arrayResultado,SERVER_PROTOCOL) // [08]
Add(arrayResultado,OS) // [09]
Add(arrayResultado,SERVER_SOFTWARE) // [10]
Add(arrayResultado,IP_ADDRESS_SERVER) // [11]

RESULT(arrayResultado)



Procedure DisplayBrowserVariables()

DATE_NAVIG is string = DateSys()
TIME_NAVIG is string = TimeSys()
BROWSER_LINK is string = BrowserName()
BROWSER_VERSION is string = sBrowserVersion()
RESOLUTION is string = SysXRes() +" x "+ SysYRes()
NBCOLORS is string = eNbColors()
PLATFORM is string= sInitSystem()
IF Position(PLATFORM,"32") <> 0 THEN
PLATFORM = "32 bits"
ELSE
IF Position(PLATFORM,"64") <> 0 THEN
PLATFORM = "64 bits"
END
END

resultado is string = DATE_NAVIG +"; "+ TIME_NAVIG +"; "+ BROWSER_LINK +"; "+ BROWSER_VERSION +"; "+ RESOLUTION +"; "+ NBCOLORS +"; "+ PLATFORM

RESULT (resultado)



Procedure DisplayServerVariables()

gsMessNotAvail is string = "Not available in test mode."

DATE_SERV, TIME_SERV, PATH, PATH_INFO, PATH_TRANSLATED, SCRIPT_NAME, SERVER_PORT, SERVER_PROTOCOL, HTTP_HOST, OS, SERVER_SOFTWARE, IP_ADDRESS_SERVER is string

//Test mode
IF InTestMode() THEN
DATE_SERV = DateSys()
TIME_SERV = TimeSys()
PATH = gsMessNotAvail
PATH_INFO = gsMessNotAvail
PATH_TRANSLATED = gsMessNotAvail
SCRIPT_NAME = gsMessNotAvail
SERVER_PORT = gsMessNotAvail
SERVER_PROTOCOL = gsMessNotAvail
HTTP_HOST = NetMachineName()
OS = "System: Windows " + SysWindowsVersion() +
" Version " + SysWindowsVersion(sysVersionNumber) +
" Compilation " + SysWindowsVersion(sysVersionBuild) +
" Platform " + SysWindowsVersion(sysVersionPlatform)

SERVER_SOFTWARE = gsMessNotAvail
IP_ADDRESS_SERVER = NetIPAddress(NoSpace(HTTP_HOST))


//Deployment mode
ELSE

//Date and time:
DATE_SERV = DateSys()
TIME_SERV = TimeSys()

//Caution: most of the environment variables sought here are
//specific to the server that hosts the WebDev application.
//We will present the most commonly implemented environment variables
//in the control panel of a Windows server.
//Among these variables, some of them may not be found on the server.
//They can be added manually into the configuration panel of Windows.

//Name of the CGI script used
SCRIPT_NAME = Replace( SysEnvironment("SCRIPT_NAME"),"SCRIPT_NAME=", "")

//Content of the "Windows" PATH of the server
PATH = Replace( SysEnvironment("Path"), "PATH=", "")

//Path of the script
PATH_INFO = Replace(SysEnvironment("PATH_INFO"),"PATH_INFO=" ,"")

//Absolute location of the CGI script on the server
PATH_TRANSLATED = Replace(SysEnvironment("PATH_TRANSLATED"),"PATH_TRANSLATED=","")

//Port number used by the server to receive the CGI requests
SERVER_PORT = Replace( SysEnvironment("SERVER_PORT") ,"SERVER_PORT=", "")

//Name and version of the protocol used
SERVER_PROTOCOL = Replace( SysEnvironment("SERVER_PROTOCOL"), "SERVER_PROTOCOL=","")

//Name of the server (if the server is in Windows 95, the HTTP_HOST
// HTTP_HOST = Replace (SysEnvironment("HTTP_HOST"),"HTTP_HOST=","")
HTTP_HOST = NetMachineName()

//Operating system
OS = "System: Windows " + SysWindowsVersion() +
" Version " + SysWindowsVersion(sysVersionNumber) +
" Compilation " + SysWindowsVersion(sysVersionBuild) +
" Platform " + SysWindowsVersion(sysVersionPlatform)


//Name and version of the Web server
SERVER_SOFTWARE = Replace(SysEnvironment("SERVER_SOFTWARE"),"SERVER_SOFTWARE=","")

//IP address of the server
IP_ADDRESS_SERVER = NetIPAddress(NoSpace(HTTP_HOST))

END

resultado is string = DATE_SERV +"; "+ TIME_SERV +"; "+ PATH +"; "+ PATH_INFO +"; "+ PATH_TRANSLATED +"; "+ SCRIPT_NAME +"; "+ SERVER_PORT +"; "+ SERVER_PROTOCOL +"; "+ HTTP_HOST +"; "+ OS +"; "+ SERVER_SOFTWARE +"; "+ IP_ADDRESS_SERVER

RESULT(resultado)



FUNCTION eNbColors(){
RETURN screen.colorDepth + " bits";
}



Procedure ResolucaoHeigth()

arrayResultadoGlobal is array of string

arrayResultadoGlobal = ArrayBrowserVariables()

sResolucao is string = arrayResultadoGlobal[5]

x is int = PositionOccurrence(sResolucao,"x",firstRank,FromBeginning)

sResolucaoHeigth is string = Middle(sResolucao,x+1,Length(sResolucao))

RESULT (sResolucaoHeigth)



Procedure ResolucaoWidth()

arrayResultadoGlobal is array of string

arrayResultadoGlobal = ArrayBrowserVariables()

sResolucao is string = arrayResultadoGlobal[5]

x is int = PositionOccurrence(sResolucao,"x",firstRank,FromBeginning)

sResolucaoWidth is string = Middle(sResolucao,1,x-1)

RESULT (sResolucaoWidth)



Procedure Retratil()

gnSizeWindowBrowserWidth = CookieRead("Width")
gnSizeWindowBrowserHeigth = CookieRead("Heigth")

IF gbRetratilOnOff = False THEN
gbRetratilOnOff = True

CELL_01..X = -180
CELL_02..X = 0
CELL_03..X = 0

PAGE_Responsivo.CELL_03..Width = gnSizeWindowBrowserWidth + 480

//info(gnSizeWindowBrowserWidth + 450)

ELSE IF gbRetratilOnOff = True
gbRetratilOnOff = False

CELL_01..X = 0
CELL_02..X = 180
CELL_03..X = 180

PAGE_Responsivo.CELL_03..Width = gnSizeWindowBrowserWidth + 480

//info(gnSizeWindowBrowserWidth - 450)

END



FUNCTION sBrowserVersion(){
RETURN navigator.appVersion
}



FUNCTION sInitSystem(){
RETURN navigator.platform;
}



Procedure ValoresBrowser()

Info(DisplayBrowserVariables())

arrayResultadoGlobal is array of string

arrayResultadoGlobal = ArrayBrowserVariables()

Info(arrayResultadoGlobal[1],arrayResultadoGlobal[2],arrayResultadoGlobal[3],arrayResultadoGlobal[4],arrayResultadoGlobal[5],arrayResultadoGlobal[6],arrayResultadoGlobal[7])

Info(arrayResultadoGlobal[5])

sResolucao is string = arrayResultadoGlobal[5]

Info(sResolucao)

x is int = PositionOccurrence(sResolucao,"x",firstRank,FromBeginning)

sResolucaoWidth is string = Middle(sResolucao,1,x-1)

sResolucaoHeigth is string = Middle(sResolucao,x+1,Length(sResolucao))

Info("Width: "+ sResolucaoWidth)

Info("Heigth: "+ sResolucaoHeigth)



//VARIAIVEIS PARA USO NO SITE RESPONSIVO

gnSizeWindowBrowserWidth = CookieRead("Width")
gnSizeWindowBrowserHeigth = CookieRead("Heigth")

Info(gnSizeWindowBrowserWidth,
gnSizeWindowBrowserHeigth,
gnSizeBarLeftWidth,
gnSizeBarLeftHeigth,
gnDivcentralWidth,
gnDivcentralHeigth,
gnSizeMainCenterWidth,
gnSizeMainCenterHeigth)

Info(DisplayServerVariables())


--
Adriano José Boller
______________________________________________
Consultor e Representante Oficial da
PcSoft no Brasil
+55 (41) 99949 1800
adrianoboller@gmail.com
skype: adrianoboller
http://wxinformatica.com.br/
Message modifié, 09 mars 2017 - 01:00