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:
// 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

  • edited October 2
  • How are you assigning the value to OleSubClass$? I am wondering if this is a problem related to multi-instance forms and the form name portion of that variable is no longer valid.
  • OleSubClass$ = @Window:".OLE_SUBCLASS"
  • edited October 2
    If I put in a debug in the create event and then 'look' at the properties of OLE_SUBCLASS for the @window, I can see values and I can look at others BUT:

    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.
  • I can't recreate this in OI 10.0.8.1 with a simple form. Is this only happening on the form with the Panel control, because you made it seem like it's happening for all forms.
  • @KevidFournier It is all forms that aopened inside the panel control, not the for with the panel control.

    First time opened:



    Open Different form:



    Second Time opened:



  • Instead of having RemoveForm destroy the window, what happens if you set that parameter to 0 and close the window yourself using End_Window?
  • Ok, I will try that.
    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.
  • >>Instead of having RemoveForm destroy the window, what happens if you set that parameter to 0 and close the window yourself using End_Window?

    Yep, That worked.
    Do you want me to still see where the error is still, I assume srp_ole_controls?
  • My theory is that OI 10 uses a more proprietary way to close it's windows, so it's probably not possible for the panel to close them correctly unless Revelation is will to document how to do so at a C++ level.
Sign In or Register to comment.