There appears to be no samples using the new DDT Listview command set.
Am I missing something in my install?
Am I missing something in my install?
'Testing Listview statments in PBWin 9.0 '=================================================================================================== #COMPILE EXE #DIM ALL #INCLUDE "WIN32API.INC" '********************** You need to include the following file for the ' SET LISTVIEW STYLE statements to compile: #INCLUDE "CommCtrl.INC" '----------------------------------------------------------------------------------------- %IdForm = 200 %IdListView1 = 20001 %left = 0 %right = 1 %center = 2 '=================================================================================================== FUNCTION PBMAIN () AS LONG LOCAL hForm AS DWORD LOCAL FormX AS DWORD LOCAL FormY AS DWORD LOCAL FormWide AS DWORD LOCAL FormHigh AS DWORD LOCAL FormStyleN AS DWORD LOCAL FormStyleX AS DWORD LOCAL ViewStyleN AS DWORD LOCAL ViewStyleX AS DWORD LOCAL I AS DWORD LOCAL LV1RowCount AS DWORD LOCAL FontBodyN AS DWORD LOCAL FontBodyI AS DWORD LOCAL FontBodyB AS DWORD LOCAL FontBodyX AS DWORD LOCAL FontHeadB AS DWORD '----------------------------------------------------------------------------------------- START_: GOSUB CreateFontHandles GOSUB CreateFormWindow GOSUB BuildTestListview GOSUB BuildFormButtons DIALOG SHOW MODAL hForm, CALL FormProcCallback GOSUB DestroyFontHandles CEASE_: EXIT FUNCTION '----------------------------------------------------------------------------------------- CreateFormWindow: FormX = 0 FormY = 0 FormWide = 400 FormHigh = 250 FormStyleN = %WS_CAPTION OR %WS_SYSMENU FormStyleX = 0 ViewStyleN = %WS_TABSTOP OR %LVS_REPORT OR %LVS_SHOWSELALWAYS OR %LVS_EDITLABELS DIALOG NEW 0, "Sample Listview",,, FormWide, FormHigh, FormStyleN, FormStyleX TO hForm RETURN '----------------------------------------------------------------------------------------- BuildFormButtons: CONTROL ADD BUTTON, hForm, %IDCANCEL, "&Cancel", 340, 10, 50, 14 RETURN '----------------------------------------------------------------------------------------- BuildTestListview: CONTROL ADD LISTVIEW, hForm, %IdListView1, $NUL, 10, 40, 380, 200, ViewStyleN CONTROL SET FONT hForm, %IdListView1, FontBodyB LISTVIEW INSERT COLUMN hForm, %IdListView1, 1, "Col 1", 50, %left ' according to the documentation the ' justification of the first column ' is ALWAYS left, no matter what ' you specify or desire. Thanks, M$ LISTVIEW INSERT COLUMN hForm, %IdListView1, 2, "Col 2", 50, %right LISTVIEW INSERT COLUMN hForm, %IdListView1, 3, "Col 3", 100, %center LISTVIEW INSERT COLUMN hForm, %IdListView1, 4, "Col 4", 300, %left CONTROL SET FONT hForm, %IdListView1, FontBodyB ' This sets the font for the whole ' listview table, including the headers, ' and overrides any previous ' control set font statements LV1RowCount = 100 FOR I = 1 TO LV1RowCount LISTVIEW INSERT ITEM hForm, %IdListView1, I, 0, STR$( I ) LISTVIEW SET TEXT hForm, %IdListView1, I, 2, STR$( I ) LISTVIEW SET TEXT hForm, %IdListView1, I, 4, STR$( I ) NEXT I '********** ' Try uncommenting the following line for an unexpected result ' LISTVIEW DELETE COLUMN hForm, %idListView1, 1 '********** ' Hide column 1 instead... LISTVIEW SET COLUMN hForm, %IdListView1, 1, 0 LISTVIEW SET STYLE hForm, %IdListView1, %LVS_EX_GRIDLINES OR %LVS_EX_ONECLICKACTIVATE RETURN '----------------------------------------------------------------------------------------- CreateFontHandles: FONT NEW "Calibri", 12, 0 TO FontBodyN FONT NEW "Calibri", 12, 2 TO FontBodyI FONT NEW "Calibri", 12, 1 TO FontBodyB FONT NEW "Calibri", 12, 3 TO FontBodyX FONT NEW "Consolas", 12, 0 TO FontHeadB RETURN '----------------------------------------------------------------------------------------- DestroyFontHandles: FONT END FontHeadB FONT END FontBodyX FONT END FontBodyB FONT END FontBodyI FONT END FontBodyN RETURN '----------------------------------------------------------------------------------------- END FUNCTION '+================================================================================================== CALLBACK FUNCTION FormProcCallback() AS LONG SELECT CASE AS LONG CB.MSG CASE %WM_INITDIALOG GOSUB ProcessInitializeMessage CASE %WM_COMMAND GOSUB ProcessControlMessage END SELECT EXIT FUNCTION '----------------------------------------------------------------------------------------- ProcessInitializeMessage: RETURN '----------------------------------------------------------------------------------------- ProcessControlMessage: SELECT CASE AS LONG CB.CTL CASE %IDCANCEL DIALOG END CB.HNDL, 0 END SELECT RETURN '----------------------------------------------------------------------------------------- END FUNCTION
CONTROL ADD LISTVIEW, hDlg, %ID_LISTVIEW, "", 0, 0, 0, 0, %WS_VISIBLE OR %WS_TABSTOP OR %LVS_ICON OR %LVS_SHOWSELALWAYS OR %LVS_SINGLESEL
We process personal data about users of our site, through the use of cookies and other technologies, to deliver our services, and to analyze site activity. For additional details, refer to our Privacy Policy.
By clicking "I AGREE" below, you agree to our Privacy Policy and our personal data processing and cookie practices as described therein. You also acknowledge that this forum may be hosted outside your country and you consent to the collection, storage, and processing of your data in the country where this forum is hosted.
Comment