Hi, gurus!

 

I want to register non-visible component (such as ConnectedRecordSet).

 

TQuery - Runtime Class (for Test)

--------------------------------------------------

{curl 4.0 package}
{package COM.WIDGETS.TQUERY, version = "1.0"}

{import * from CURL.GUI.STANDARD}

{define-class public TQuery

  field public progress:String = "A"
   
  {constructor public {default}
    ||{construct-super ...}
  }
 
  {method public {show-progress}:void
    {popup-message self.progress}
  }
}

-----------------------------------------------------

 

 

Ext Class

-----------------------------------------------------


{import * from CURL.GUI.STANDARD}
{import * from COM.WIDGETS.TQUERY, location="COM.WIDGETS.TQUERY.scurl"}

{import * farom COM.CURL.LAYOUT-EDITOR.PALETTE-ITEMS}

{define-class public open DesignTimeTQuery {inherits DesignTimeGraphic}

  {constructor public {default}
    {construct-super
        {ObjectMetaData
            default-selected-property = "design-name", ||""
            default-selected-event = "RecordsChanged", ||""
            {MetaDataCategory
                name = {host-localize "General"},
                design-name-pmd
            },
            {EventHandlerCategory
                {EventHandlerMetaData "RecordsChanged"}, ||""
                {EventHandlerMetaData "RecordFieldsChanged"} ||""
            }
        }
    }
  }

  {getter protected open {palette-graphic}:Graphic
    {return
        {image
            blocking? = true,
            source = {make-vle-image-url "palette-connect-data"} ||""
        }
    }
  }

  {getter public open {graphic-icon}:#Graphic
    {return
        {Frame
            border-width = 2px,
            border-style = BorderStyle.raised,
            border-color = "#c0c0c0", ||""
            vorigin = "bottom", ||""
            {image
                blocking? = true,
                source = {make-vle-image-url "palette-connect-data"} ||""
            }
        }
    }
  }

  {getter public open {visual?}:bool
    {return false}
  }

  {getter public open {palette-tab-name}:String
    {return {host-localize "WIDGETS"}}
  }

  {getter public open {design-time-class-name}:String
    {return "TQuery"} ||""
  }

  {getter public open {runtime-class-name}:String
    {return "TQuery"} ||""
  }
 
||--  {getter public open {initial-properties}:{Array-of PropertyDescriptor}
||--    {return
||--        {new {Array-of PropertyDescriptor},
||--            {PropertyDescriptor data-connection-pmd,
||--                |"{BasicConnection {url ""}}"| ||""
||--            }
||--        }
||--    }
||--  }

  {method protected open {new-object element:LayoutElement}:Object
    {error "Should not be called"} ||""
  }

  {method public open {new-design-object dc:DesignContainer}:DesignObject
    let le:LayoutElement = {self.new-element}
    let dob:DesignObject = {le.create-design-object dc}
    {return dob}
  }

  {method public open {new-element}:LayoutElement
    {return
        {RecordSetLayoutElement
            self
        }
    }
  }

  {method public open {new-element-from-source
                          les:LayoutItemSource,
                          parent:#DesignTimeGraphic = null
                      }:LayoutElement
    {return {LayoutElement.from-source les, dtg = self, parent = parent}}
  }
}

{register-palette-item DesignTimeTQuery}

 

-----------------------------------------------------

 

When I added this TQuery to a Container by a drag & drop on  on the VLE,

an error occurred;

"SyntaxError in curl://string/{nonvisual-element void:TQuery    {TQuery    }} at line

3 [0]: Bad design-time class name for nonvisual element."

 

Honestly, I don't understand ConnectedRecordSet class.

It's very hard, ^^;;

 

How can I solve this problem?

I tested that on Curl 4.0 beta.

 

 

If you know how to correct that problem, tell me please.
Besides, if you have any advices for me about that problem,

Thanks all

vidkid

 

Reply via email to