Welcome to the SRP Forum! Please refer to the SRP Forum FAQ post if you have any questions regarding how the forum works.
Subclass combo
This was working prior to OI 10.0.8.1 and srp controls 4.1.?
Different forms are started and closed and restarted.
The issue is when a form is restarted the control on the form that is sublassed as a combo dropdown is back to being an editline when opened a second and subsequent times. (Ok the first time)
When the form that has the Panel Control is closed and then reopened from menu, the combo sub class field is not subclassed.
You have to full exit OI.
DWELLING_TYPE is field refered to in this case
This is the section in the form that has the Panel control.
Buttons are clicled to select which form to open inside the panel then calls this:
This is in the create event of the form:
Different forms are started and closed and restarted.
The issue is when a form is restarted the control on the form that is sublassed as a combo dropdown is back to being an editline when opened a second and subsequent times. (Ok the first time)
When the form that has the Panel Control is closed and then reopened from menu, the combo sub class field is not subclassed.
You have to full exit OI.
DWELLING_TYPE is field refered to in this case
This is the section in the form that has the Panel control.
Buttons are clicled to select which form to open inside the panel then calls this:
// Remove the current form and destory it
Send_Message(OleSrpPanel$, "OLE.RemoveForm", 1)
Enabled=Yes$
Gosub SetOLESoldDataButtons
// Add window to the form
NewWindow = Start_Window(WinId,@Window,'SKIPCREATEEVENT')
Handle = Get_Property(WinId, "HANDLE")
*If Handle then
Send_Message(OleSrpPanel$, "OLE.SetForm", Handle, 0, 0)
call promoted_create_proc(WinId,'',CreateParam)
call send_event(WinId,"CREATE",CreateParam)
Set_Property_only(CtrlEntID, "OLE.Background", green$)
Set_Property_only(Parent,"@CHILDWINDOWS", WinId)
*end
This is in the create event of the form:
call forward_event(Param1)
CtrlId = @Window:".DWELLING_TYPE"
Handle = Get_Property(CtrlId, "HANDLE")
rv = Exec_Method(OleSubClass$, "OLE.Subclass", Handle, CtrlId)
rv=Exec_Method(OleSubClass$,"QUALIFY_EVENT","OnComboClick",1)
Gosub CreateDwellingTypeCombo
CreateDwellingTypeCombo:
PropertyID=getproperty("@.PROPERTY_ID","TEXT")
Gosub InitDwellingTypeDropDown
DwellingTypes= combo_load_proc("","COMBO_LISTS","DWELLING_TYPE",1)
Convert @fm To @vm In DwellingTypes
ExisingKeys=xlate("PROPERTIES_SOLD_DATA_RESIDENTIAL_REL",PropertyID,1,"X")
Cnt=fieldcount(DwellingTypes,@vm)
DwellingTypesDrop=null$
for X = 1 to Cnt
Locate PropertyId:"*":DwellingTypes<0,X> In ExisingKeys setting foo Then
RecordExists="Yes"
End Else
RecordExists=''
end
DwellingTypesDrop:=DwellingTypes<0,X>:@fm:RecordExists:@rm
next X
*Bys = 'A'
* Justs = 'L'
* call V119('S', '', Bys, Justs, DwellingTypesDrop, '')
DwellingTypesDrop[-1,1]=null$
convert @rm to @tm in DwellingTypesDrop
convert @fm to @stm in DwellingTypesDrop
DwellingTypeDropDown<2,3>=DwellingTypesDrop
CtrlId=@Window:".DWELLING_TYPE"
Convert "." to ";" in CtrlId
Set_Property(OleSubClass$, "OLE.Combo[":CtrlId:"]", DwellingTypeDropDown)
Set_Property(OleSubClass$, "OLE.MouseWheelDisabled[":CtrlId:"]", 1)
Comments
if anorther window is opened (i.e. this one closed) and I 'reopen' this one and look at OLE_SUBCLASS (@window is the same value as before) OI Crashes (I can look at other values).
Like I said this has been working for 18 months say.
First time opened:
Open Different form:
Second Time opened:
I found a copy on my laptop that works.
OI 10.0.7 / Srp ole 4.1.2 ; utilities 2.1.0
I will upgrade each one to the lastest and test as I go to see if I can show up where the error is.
Yep, That worked.
Do you want me to still see where the error is still, I assume srp_ole_controls?