+1 800 256 3608 (toll-free in North America) or +49 7531 90 60 10| service@combit.com

designerObject Variables


(Guest) #1

I have created a designerObject that allows the user to select one of the variables and then formats it in a special way that fits my needs. The problem that I am running into is that List and Label does not know the variable is being used, so it does not pass the variables in during runtime. Is there a method to flag a variable as being used (isused) in the designer? I cannot seem to find one, Here is an example of the drawDesignerObject method (I’m using VB.NET):

Private Sub cFitToSizeLLObject_DrawDesignerObject(ByVal sender As Object, ByVal e As combit.ListLabel12.DrawDesignerObjectEventArgs) Handles Me.DrawDesignerObject
Dim desobj As combit.ListLabel12.DesignerObject = CType(sender, combit.ListLabel12.DesignerObject)

    If desobj.ObjectProperties.Contains("variableName") Then
        Try

            Dim variableName As String = desobj.ObjectProperties("variableName").ToString()

            Dim s As String = ll.Core.LlGetVariableContents(variableName)

            Dim tempFont As Font = getFont(desobj)
            ' list and label and .net do not have the same font size, so we convert here
            Dim font1 As New Font(tempFont.FontFamily, tempFont.SizeInPoints * 10.3, tempFont.Style, GraphicsUnit.Point)


            Dim g As Graphics = e.Graphics
            Dim br As SolidBrush

            Dim strFormat As New StringFormat

            If desobj.ObjectProperties.Contains("hAlign") Then
                Select Case desobj.ObjectProperties("hAlign").ToString()
                    Case "Centered"
                        strFormat.Alignment = StringAlignment.Center
                    Case "Right"
                        strFormat.Alignment = StringAlignment.Far
                    Case Else
                        strFormat.Alignment = StringAlignment.Near ' default and left alignment
                End Select
            End If
            If desobj.ObjectProperties.Contains("vAlign") Then
                Select Case desobj.ObjectProperties("vAlign").ToString()
                    Case "Bottom"
                        strFormat.LineAlignment = StringAlignment.Far
                    Case "Centered"
                        strFormat.LineAlignment = StringAlignment.Center
                    Case Else
                        strFormat.LineAlignment = StringAlignment.Near  ' default and top alignment
                End Select
            End If

            '  strFormat.Alignment = StringAlignment.Far
            ' strFormat.LineAlignment = StringAlignment.Far



            br = New SolidBrush(Color.Black)


            g.DrawString(s, font1, br, e.Graphics.ClipBounds, strFormat)


            br.Dispose()
        Catch ex As Exception
            MsgBox("Error printing Sigs: Error: " & Chr(13) & ex.Message, MsgBoxStyle.Critical)
        End Try

    End If
End Sub

(Guest) #2

“Jeremy Manchester” <jmanchester@libertycomputerservic…> schrieb im
Newsbeitrag news:2502912020091957@combit.net

I have created a designerObject that allows the user to select one of the
variables and then formats it in a special way that fits my needs. The
problem that I am running into is that List and Label does not know the
variable is being used, so it does not pass the variables in during
runtime. Is there a method to flag a variable as being used (isused) in
the designer? I cannot seem to find one, Here is an example of the
drawDesignerObject method

Jeremy,

I seem to remember having talked about the mechanism of used identifiers to
someone at combit a while ago. It has to do with “active” expressions which
are used somehow to determine if a field is used or not. Thus, something
like an internal list of ints holding your expressions

int hExpr = this.Core.LlExprParse();

should do. After closing the designer you should be free to then call
LlExprFree() on the contained expressions in order to avoid resource leaks.
Haven’t tested it, but might be a solution for you.

G.


(Guest) #3

Thanks for the reply Dr. G.

I have tried this line
ll.Core.LlExprParse(variableName, True)
however, the variable is still not marked as being used. I’m really confused as to whether there is a way to change the used variable at all.

To get around it I have used this, to print the variable:
Dim eval As New combit.ListLabel12.ExpressionEvaluator(ll.Variables)
Dim s As String = CType(eval.Evaluate(variableName), String)
Which prints the variable, although it is still not marked as used. Unless I am missing something simple…

“Jeremy Manchester” <jmanchester@libertycomputerservic…> schrieb im
Newsbeitrag news:2502912020091957@combit.net

I have created a designerObject that allows the user to select one of the
variables and then formats it in a special way that fits my needs. The
problem that I am running into is that List and Label does not know the
variable is being used, so it does not pass the variables in during
runtime. Is there a method to flag a variable as being used (isused) in
the designer? I cannot seem to find one, Here is an example of the
drawDesignerObject method

Jeremy,

I seem to remember having talked about the mechanism of used identifiers to
someone at combit a while ago. It has to do with “active” expressions which
are used somehow to determine if a field is used or not. Thus, something
like an internal list of ints holding your expressions

int hExpr = this.Core.LlExprParse();

should do. After closing the designer you should be free to then call
LlExprFree() on the contained expressions in order to avoid resource leaks.
Haven’t tested it, but might be a solution for you.

G.


(Guest) #4

I have tried this line
ll.Core.LlExprParse(variableName, True)
however, the variable is still not marked as being used. I’m really
confused as to whether there is a way to change the used variable at all.

Then your best bet will probably be to contact combit directly or
(beware…) to patch the project file by code. The used identifiers are
at the very bottom in plain ASCII and wait for your changes.

If you want to go the “official way” I’ve made good experiences with sending
simple samples - they usually get back to you quickly.

G.


(Guest) #5

I will give support an email. Thanks for your help.

I have tried this line
ll.Core.LlExprParse(variableName, True)
however, the variable is still not marked as being used. I’m really
confused as to whether there is a way to change the used variable at all.

Then your best bet will probably be to contact combit directly or
(beware…) to patch the project file by code. The used identifiers are
at the very bottom in plain ASCII and wait for your changes.

If you want to go the “official way” I’ve made good experiences with sending
simple samples - they usually get back to you quickly.

G.