Hello all,
I have rebar control that houses my toolbar and various dropdown boxes. The rebar is broken into 3 breaks. My issue is on the first break in which the toolbar is placed. I am trying to insert a edit control on there but the program will not draw it. If I click around it will become visiable for a second but with no label text. I am lost can anyone assist?
Here is my rebar function. I can post more as needed but I suspect the issue is here. The problem area is for the rebar insert for CreateFindScreenBox
I have rebar control that houses my toolbar and various dropdown boxes. The rebar is broken into 3 breaks. My issue is on the first break in which the toolbar is placed. I am trying to insert a edit control on there but the program will not draw it. If I click around it will become visiable for a second but with no label text. I am lost can anyone assist?
Here is my rebar function. I can post more as needed but I suspect the issue is here. The problem area is for the rebar insert for CreateFindScreenBox
Code:
Function CreateRebar (ByVal hParent As Dword) As Long
Local rbi As REBARINFO
Local rbBand As REBARBANDINFO
Local rc As Rect
Local hCbPackageBox As Dword
Local hCbPackageTYPEBox As Dword
Local hCbFileTYPEBox As Dword
Local hCbDataPathBox As Dword
Local hCbBrowseButtonBox As Dword
Local hLabelBox As Dword
Local hCBYearBox As Dword
Local hCBScreenBox As Dword
Local szCbText As Asciiz * 255
Local szCbPText As Asciiz * 255
Local hTbSBar As Dword
Local hETbBar As Dword
Local hTbBar As Dword
Local hPTbBar As Dword
Local szTbText As Asciiz * 255
Local dwBtnSize As Dword
Local hCbFindScreenBox As Dword
LOCAL hCbBUTTON AS DWORD
CONTROL ADD $REBARCLASSNAME, hParent, %ID_REBAR, "", 0, 0, 0, 0, _
%WS_CHILD OR %WS_VISIBLE OR %WS_CLIPSIBLINGS OR %WS_CLIPCHILDREN OR _
%RBS_VARHEIGHT OR %RBS_BANDBORDERS OR %WS_BORDER 'Or %CCS_NODIVIDER
CONTROL HANDLE hParent, %ID_REBAR TO hRebar
' Initialize and send the REBARINFO structure
rbi.cbSize = SIZEOF(rbi)
rbi.fMask = 0
rbi.himl = 0
CONTROL SEND hParent, %ID_REBAR, %RB_SETBARINFO, 0, VARPTR(rbi)
'// Initialize REBARBANDINFO for all rebar bands
rbBand.cbSize = SIZEOF(rbBand)
rbBand.fMask = %RBBIM_COLORS OR _ '// clrFore and clrBack are valid
%RBBIM_CHILD OR _ '// hwndChild is valid
%RBBIM_CHILDSIZE OR _ '// cxMinChild and cyMinChild are valid
%RBBIM_STYLE OR _ '// fStyle is valid
%RBBIM_ID OR _ '// wID is valid
%RBBIM_SIZE OR _ '// cx is valid
%RBBIM_TEXT OR _ '// lpText is valid
%RBBIM_IDEALSIZE OR _
%RBBIM_BACKGROUND '// hbmBack is valid
rbBand.clrFore = RGB(0,0,0) '// Black
rbBand.clrBack = RGB(236,233,216) '// Grey
rbBand.fStyle = %RBBS_NOVERT Or _ '// do not display in vertical orientation
%RBBS_CHILDEDGE Or _
%RBBS_NOGRIPPER Or _
%RBBS_FIXEDBMP
rbBand.hbmBack = 0
hTbBar = CreateMainToolBar(hParent)
dwBtnSize = SendMessage(hTbBar, %TB_GETBUTTONSIZE, 0, 0)
rbBand.hwndChild = hTbBar
rbBand.wID = %IDC_TOOLBAR
rbBand.cxMinChild = 230
rbBand.cyMinChild = HiWrd(dwBtnSize)
rbBand.cx = 250
'// Insert band into rebar
CONTROL SEND hParent, %ID_REBAR, %RB_INSERTBAND, -1, VARPTR(rbBand)
'insert find screen edit box
hCbFindScreenBox = CreateFindScreenBox(hParent)
szCbText = "Find Screen"
rbBand.lpText = VarPtr(szCbText)
rbBand.hwndChild = hCbFindScreenBox
rbBand.wID = %IDC_LOCSCREEN
GetWindowRect hCbFindScreenBox, rc
rbBand.cxMinChild = 85
rbBand.cyMinChild = rc.nBottom - rc.nTop
rbBand.cx = 85
rbBand.fStyle = %RBBS_NOVERT Or _ '// do not display in vertical orientation
%RBBS_CHILDEDGE Or _
%RBBS_NOGRIPPER Or _
%RBBS_FIXEDBMP
'// Insert band into rebar
Control Send hParent, %ID_REBAR, %RB_INSERTBAND, -1, VarPtr(rbBand) 'create blank label so the program doesnt make the last control in the rebar huge
hLabelBox = CreateBlankLabel(hParent)
szCbPText = ""
rbBand.lpText = VarPtr(szCbPText)
rbBand.hwndChild = hLabelBox
rbBand.wID = %IDC_BLANKLABEL
GetWindowRect hLabelBox, rc
rbBand.cxMinChild = 400
rbBand.cyMinChild = rc.nBottom - rc.nTop
rbBand.cx = 400
Control Send hParent, %ID_REBAR, %RB_INSERTBAND, -1, VarPtr(rbBand)
'// insert Tax year drop down
hCbYearBox = CreateTaxYearComboBox(hParent)
szCbText = "Tax Year"
rbBand.lpText = VARPTR(szCbText)
rbBand.hwndChild = hCbYearBox
rbBand.wID = %IDC_CMBYEAR
GETWINDOWRECT hCbYearBox, rc
rbBand.cxMinChild = 50
rbBand.cyMinChild = rc.nBottom - rc.nTop
rbBand.cx = 50
rbBand.fStyle = %RBBS_NOVERT Or _ '// do not display in vertical orientation
%RBBS_CHILDEDGE Or _
%RBBS_NOGRIPPER Or _
%RBBS_FIXEDBMP Or _
%RBBS_BREAK
'// Insert band into rebar
CONTROL SEND hParent, %ID_REBAR, %RB_INSERTBAND, -1, VARPTR(rbBand)
'insert Package drop down
hCbPackageBox = CreatePackageComboBox(hParent)
szCbText = "Package"
rbBand.lpText = VARPTR(szCbText)
rbBand.hwndChild = hCbPackageBox
rbBand.wID = %IDC_FEDSTLIST
GETWINDOWRECT hCbPackageBox, rc
rbBand.cxMinChild = 85
rbBand.cyMinChild = rc.nBottom - rc.nTop
rbBand.cx = 85
rbBand.fStyle = %RBBS_NOVERT Or _ '// do not display in vertical orientation
%RBBS_CHILDEDGE Or _
%RBBS_NOGRIPPER Or _
%RBBS_FIXEDBMP
'// Insert band into rebar
CONTROL SEND hParent, %ID_REBAR, %RB_INSERTBAND, -1, VARPTR(rbBand)
'insert Package Type drop down
hCbPackageTypeBox = CreatePackageTypeComboBox(hParent)
szCbText = "Type"
rbBand.lpText = VARPTR(szCbText)
rbBand.hwndChild = hCbPackageTypeBox
rbBand.wID = %IDC_PACKAGE
GETWINDOWRECT hCbPackageTypeBox, rc
rbBand.cxMinChild = 50
rbBand.cyMinChild = rc.nBottom - rc.nTop
rbBand.cx = 50
'// Insert band into rebar
CONTROL SEND hParent, %ID_REBAR, %RB_INSERTBAND, -1, VARPTR(rbBand)
'insert screen list dropdown
hCbScreenBox = CreateScreenComboBox(hParent)
szCbText = "Screen"
rbBand.lpText = VarPtr(szCbText)
rbBand.hwndChild = hCbScreenBox
rbBand.wID = %IDC_SCREEN
GetWindowRect hCbScreenBox, rc
rbBand.cxMinChild = 150
rbBand.cyMinChild = rc.nBottom - rc.nTop
rbBand.cx = 150
rbBand.fStyle = %RBBS_NOVERT Or _ '// do not display in vertical orientation
%RBBS_CHILDEDGE Or _
%RBBS_NOGRIPPER Or _
%RBBS_FIXEDBMP
'// Insert band into rebar
Control Send hParent, %ID_REBAR, %RB_INSERTBAND, -1, VarPtr(rbBand)
'// create blank label so the program doesnt make the last control in the rebar huge
hLabelBox = CreateBlankLabel(hParent)
szCbPText = ""
rbBand.lpText = VarPtr(szCbPText)
rbBand.hwndChild = hLabelBox
rbBand.wID = %IDC_BLANKLABEL
GetWindowRect hLabelBox, rc
rbBand.cxMinChild = 400
rbBand.cyMinChild = rc.nBottom - rc.nTop
rbBand.cx = 400
Control Send hParent, %ID_REBAR, %RB_INSERTBAND, -1, VarPtr(rbBand)
'// insert File Type drop down
hCbFileTypeBox = CreateFileTypeComboBox(hParent)
szCbText = "File Type"
rbBand.lpText = VarPtr(szCbText)
rbBand.hwndChild = hCbFileTypeBox
rbBand.wID = %IDC_CMBDATATYPE
GetWindowRect hCbFileTypeBox, rc
rbBand.cxMinChild = 50
rbBand.cyMinChild = rc.nBottom - rc.nTop
rbBand.cx = 50
rbBand.fStyle = %RBBS_NOVERT Or _ '// do not display in vertical orientation
%RBBS_CHILDEDGE Or _
%RBBS_NOGRIPPER Or _
%RBBS_FIXEDBMP Or _
%RBBS_BREAK
'// Insert band into rebar
Control Send hParent, %ID_REBAR, %RB_INSERTBAND, -1, VarPtr(rbBand)
'// insert Data Path drop down
hCbDataPathBox = CreateDataPathComboBox(hParent)
szCbText = "Search Path"
rbBand.lpText = VarPtr(szCbText)
rbBand.hwndChild = hCbDataPathBox
rbBand.wID = %IDC_DATAPATH
GetWindowRect hCbDataPathBox, rc
rbBand.cxMinChild = 264
rbBand.cyMinChild = rc.nBottom - rc.nTop
rbBand.cx = 264
rbBand.fStyle = %RBBS_NOVERT Or _ '// do not display in vertical orientation
%RBBS_CHILDEDGE Or _
%RBBS_NOGRIPPER Or _
%RBBS_FIXEDBMP
'// Insert band into rebar
Control Send hParent, %ID_REBAR, %RB_INSERTBAND, -1, VarPtr(rbBand)
'// insert Browse Button
hCbBrowseButtonBox= CreateBrowseButtonBox(hParent)
szCbText = ""
rbBand.lpText = VarPtr(szCbText)
rbBand.hwndChild = hCbBrowseButtonBox
rbBand.wID = %IDC_BROWSE
GetWindowRect hCbBrowseButtonBox, rc
rbBand.cxMinChild = 85
rbBand.cyMinChild = rc.nBottom - rc.nTop
rbBand.cx = 85
'// Insert band into rebar
Control Send hParent, %ID_REBAR, %RB_INSERTBAND, -1, VarPtr(rbBand)
'// insert blank label
hLabelBox = CreateBlankLabel(hParent)
szCbPText = ""
rbBand.lpText = VarPtr(szCbPText)
rbBand.hwndChild = hLabelBox
rbBand.wID = %IDC_BLANKLABEL
GetWindowRect hLabelBox, rc
rbBand.cxMinChild = 400
rbBand.cyMinChild = rc.nBottom - rc.nTop
rbBand.cx = 400
Control Send hParent, %ID_REBAR, %RB_INSERTBAND, -1, VarPtr(rbBand)
END FUNCTION
Comment