Hello,
I need help determining the screen coordinates to determine the width and height of a listbox with the outlook interface. I have clients with multiple resolutions so I need to code the application to handle the height minus the height of the taskbar and width minus outlook splitter on left. Here is my code for your reference. Thank You.
#include "fivewin.ch"
#include "outlook.ch"
#include "splitter.Ch"
static lBar := .t.
FUNCTION Main()
local oWnd, oOut, oSpl, oFont, oFont2, oBar, oBtn, oMenu , ;
oIcon , ;
oLbx , ;
nScrnW := GetSysMetrics(0) , ;
nScrnH := GetSysMetrics(1) , ; cSearch := "" , ;
cSearchK := SPACE(40) , ;
aSearch := {} , ;
aGet[02]
PUBLIC Ptitle := "CDM WinFrt Air Module"
// Init...
AADD( aSearch, "A. File Number" )
// Init...
cSearch := aSearch[01]
// Init...
DEFINE ICON oIcon RESOURCE "AIR"
DEFINE FONT oFont NAME GetSysFont() SIZE 0,-12 BOLD
DEFINE FONT oFont2 NAME GetSysFont() SIZE 0,-14 BOLD
MENU oMenu
MENUITEM "&Close"
ENDMENU
DEFINE WINDOW oWnd FROM 0, 0 TO nScrnH, nScrnW ;
MENU oMenu TITLE Ptitle ICON oIcon
@ 0, 0 OUTLOOK oOut ;
SIZE 200, oWnd:nHeight() ;
PIXEL ;
FONT oFont ;
COLOR "W+/R" ;
OF oWnd
SET MESSAGE OF oWnd TO Ptitle DATE TIME KEYBOARD
DEFINE GROUP OF OUTLOOK oOut PROMPT "&OPS"
DEFINE BITMAP OF OUTLOOK oOut ;
RESOURCE "AIR" ;
PROMPT "New Shipment" ;
ACTION Msginfo( "New Shipment", oSay:cCaption )
@ 0, 200 SPLITTER oSpl ;
VERTICAL ;
PREVIOUS CONTROLS oOut ;
LEFT MARGIN 70 ;
RIGHT MARGIN 200 ;
SIZE 4, nil PIXEL ;
OF oWnd ;
_3DLOOK ;
UPDATE
// Combo Box...
@ 1, 205 COMBOBOX aGet[01] VAR cSearch ITEMS aSearch SIZE 200,150 OF oWnd FONT oFont2 PIXEL
@ 1, 405 GET aGet[02] VAR cSearchK SIZE 200,20 OF oWnd FONT oFont2 PIXEL PICTURE "@!" ON CHANGE MsgInfo( @cSearchK, cSearch )
// Open...
USE air NEW SHARED
// Listbox...
@45, 205 LISTBOX oLbx FIELDS air->file , ;
TRIM(air->hbill) ;
HEADERS "File No.", "HAWB" ;
FIELDSIZES 200 , 100 ;
FONT oFont2 ;
OF oWnd SIZE oWnd:nWidth()-45, oWnd:nHeight()-50 PIXEL ;
COLOR "R/W" ;
ACTIVATE WINDOW oWnd ;
ON RESIZE oSpl:AdjRight() MAXIMIZED
// Close...
DbCloseAll()
RETURN NIL
Screen coordinates
- James Bott
- Posts: 4654
- Joined: Fri Nov 18, 2005 4:52 pm
- Location: San Diego, California, USA
- Contact: