Re: Unified libraries to allow porting code to other oses

new topic     » goto parent     » topic index » view thread      » older message » newer message

A more simple way to follow your recommendation would be:

public procedure set(object id, sequence property, object value) 
  integer wxId, param 
  if sequence(id) then 
    wxId = id[1] 
    param = id[2] 
  else 
    wxId = id 
  end if 
  atom wxClass = getClass(wxId) 
  switch wxClass of 
  case wxListCtrl then 
    if equal(property, "text") then 
      set_string( wxId, param-1, text ) 
    end if 
  case wxListBox then 
    if equal(property, "text") then 
      set_string( wxId, param-1, text ) 
    end if 
  case wxChoice then 
    if equal(property, "text") then 
      set_string( wxId, param-1, text ) 
    end if 
  case wxFrame then 
    if equal(property, "text") then 
      set_label ( wxId,  text ) 
    end if 
  case wxButton then 
    if equal(property, "text") then 
      set_label ( wxId,  text ) 
    end if 
  case wxStaticText then 
    if equal(property, "text") then 
      set_label ( wxId,  text ) 
    end if 
  case wxComboBox then 
    if equal(property, "text") then 
      set_label ( wxId,  text ) 
    end if 
  case wxRadioBox then 
    if equal(property, "text") then 
      set_label ( wxId,  text ) 
    end if 
  case wxStatusBar then 
    if equal(property, "text") then 
      if sequence(id) then 
        set_status_text( wxId, text, param-1) 
      else 
        set_status_text( wxId, text, 0 ) 
      end if 
    end if 
  case wxTextCtrl then 
    if equal(property, "text") then 
      set_text( wxId, text ) 
    end if 
  end if 
end procedure 

Jean-Marc

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu