Award-winning Commercial Components since 1996

 Home Products Support FAQ

 

 

Developer Bulletins

Archive of DBI Technologies monthly developer bulletins  
   
   
   
   
   
Keywords
 
Images|
Caveat|
Sort|
Schedule|
API|
Solid Colors|
Triangle|
Timeline|
TechTips|
Reload|
VB6|
FoxPro|
Sorting

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

July 2008

Tech Tip – ctSchedule column header clicks and VFP API’s

I’ve been working with sorting in ctSchedule items. In order to capture which column was clicked on, I had to think outside the box a bit, so I thought this might be handy for those that needed it. To begin with I created three columns and three colored triangle images using solid colors. This is important because I basically use an API to peek at the color under the mouse and use this information to determine the column. This was done in VFP because I wanted to try out API calls in FoxPro, VB6 is pretty straightforward so I thought we’d experiment a bit. To that end add three images to the ctSchedule… like so…




Then add the images by setting the ctSchedule.ColumnPicture property.

Here is the program portion, it includes the API function calls, as well as a function to parse the results.

DECLARE Integer GetDC IN WIN32API Integer hndle
DECLARE Integer GetPixel IN win32api AS GetPixColor Integer hdc, Integer nXPos, Integer nYPos
Declare Integer ReleaseDC IN WIN32API Integer hndle, integer hdc

_vfp.AutoYield=.F.

PUBLIC ColorArrow(3) as Integer
PUBLIC curX as Integer
PUBLIC curY as Integer

ColorArrow(1)=16711680 &&These are the colors of my triangles.
ColorArrow(2)=65280
ColorArrow(3)=8388736

SET PROCEDURE TO prgmain.prg

DO FORM form1 && Run the main form

FUNCTION CalcColumn(curColor as integer)

curCol=-1 && this is the default for ‘not found’ see Click event

FOR x = 1 TO 3
IF curColor = ColorArrow(x) then
curCol = x
ENDIF
NEXT

RETURN curCol
ENDFUNC

Then in the Click event of the schedule, I call my function and it will return the column used.



*** ActiveX Control Event ***

curHDC = GetDC(thisform.ctSched1.HWnd) &&Get the handle to the schedule
clickCOL = CalcColumn(GetPixColor(curHDC, curX, curY)) &&Call my function above using the x,y values set above.
IF clickCOL > -1 then
thisform.text1.Value = "Clicked Column " + STR(clickCOL)
ELSE
thisform.text1.Value = ""
ENDIF

ReleaseDC(thisform.ctSched1.hWnd,curHDC)

The curX and curY are set in the ctSched.MouseMove event



*** ActiveX Control Event ***
LPARAMETERS button, shift, x, y

&&Set the curX and curY for use in the Click event
curX = x
curY = y

After that, I can clear my schedule and reload the data with the new sort in place, and if I want to get fancy I can even flip my images. The only caveat (I know there is always a caveat with the techtips) is that you have to use solid colors for the triangles that aren’t used elsewhere in the schedule or you’ll get some sorts when you click on a timeline or other area with the same colors.

As always take care and have a great day!
DBI Support

Back To The Top

  Archives

July 2008

June 2008

May 2008

April 2008

March 2008

February 2008

January 2008

December 2007

November 2007

October 2007

September 2007

July 2007

May 2007

April 2007

March 2007

 

 

Ellipse|
Bind|
Methods/Events|
Lisbox|
Appointments|
Control|
Developers|
ComboBox|
New Users|
Internal Drag Drop/Methods|
Custom Tree|
ctMDay

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

June 2008

================================================================

Hello and welcome to this week’s DBI Tech Tips, since we are having a two-for promotion we thought we’d toss in a two-for tip…

For the COM developers out there, we have been asked how to trap the ellipse click in ctMday. By itself, the control just shows the ellipse to indicate that there are more all day appointments than are visible in the column. To that end, it was never intended to be clicked on, we always thought a whiteboard type approach with a listbox was within the domain of the developers. We’ve had some requests wherein people want to throw a dialog with a listbox or a custom tree view for that particular area when the ellipse is clicked.

So we put some ideas to the task and discovered that we can use the internal drag/drop methods/events to capture when the all day area has been clicked, but not on an appointment. Here is the code in vb6…

Dim booIsDragDrop As Boolean 'Used to indicate wether or not we are in true drag/drop mode.

Dim curX As Integer

Dim curY As Integer

Private Sub ctMDay1_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)

booIsDragDrop = False 'Set the booIsDragDrop to false, in case we are using actual drag/drop code

Me.ctMDay1.DragDrop x / Screen.TwipsPerPixelX, y / Screen.TwipsPerPixelY 'Fire the drag/drop event to get the current position in the control

End Sub

Private Sub ctMDay1_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)

'Use the mousemove to capture the current x/y of the mouse

'for use in the appoinmentat function in DropList

curX = x / Screen.TwipsPerPixelX

curY = y / Screen.TwipsPerPixelY

End Sub

Private Sub ctMDay1_DropList(ByVal nIndex As Integer, ByVal nTime As Integer, ByVal nColumn As Integer)

If booIsDragDrop = False Then

  Me.Label1.Caption = CStr(nIndex)

    If nIndex = -1 And Me.ctMDay1.AppointmentAt(curX, curY) = 0 Then

        'Enter code here to throw a listbox or custom dialog listing all the allday appts.

        MsgBox "This is an ellipse or a blank area of allday for col:" & CStr(nColumn)

    End If

Else

    'Do our actual drag/drop code

End If

booIsDragDrop = True 'Set the default in case an actual drag/drop fires.

End Sub

And for our .NET users we came across an interesting use of the enum class for setting default items in a combo box. Basically you use the gettype and getValues methods inherited by all enums to bind the enum to the combo box. So with two lines of code, we can bind our dbi.enumFillType to a combobox and set the enum on a control as the value in the combo box changes. Here is a quick sample…

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

        Me.comboFillType.DataSource = System.Enum.GetValues(GetType(Dbi.enumFillType))

    End Sub

    Private Sub comboFillType_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles comboFillType.SelectedIndexChanged

        Me.dbiLabel1.FillType = Me.comboFillType.SelectedValue

    End Sub

As always, take care and have a great day!

Back To The Top
 

 

 

dbiSchedule|
dbiDayView|
Appointment|
Timebar|
Hooking|
Schedule|
DayView|
Data Access|
Validation|
Start\End Times|
DragDrop|
Load|
AfterAppointment
Add Event|
Calendar Tools


 


 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

May 2008
================================================================

Tech Tip   –  Synchronizing dbiDayView to dbiSchedule

We often get questions here asking about the best way to synchronize a schedule to a dayview. In this edition of the techtip we’ll make a start by hooking together a couple of events in a dbiSchedule and dbiDayView. One item of note, before you can use Solutions::Schedule 2.0 of .NET you will need to update your Calendar Tools for .NET to 2.5. In the sample code below, by hooking the AfterAppointmentAdd event to the creation of timebars, we would eliminate the need to load the schedule and the dayview independently. By adding an item to the DayView, it gets added to the Schedule. You can take this example further by hooking in dragdrop and data access. Right now it’s pretty simple, if you have a dbiDayView and dbiSchedule on a form like so…

You can use the following code to do the following…

Add an appointment to the dbiDayView and it will add it to Office300 on the dbiSchedule

Change the start/end times of an appointment in the dbiDayView and it will be reflected in the dbiSchedule

Move and appointment in dbiDayView and it will move in dbiSchedule

Move a timebar in dbiSchedule and it will be reflected back to the appointment

Change the size of a timebar in dbiSchedule and it will change the appointment in dbiDayView

    Dim booleanTimeBarChanged As Boolean = False ' Used so we don't fire a change event when changing dayview via code

    Private Sub DbiDayView1_AfterAppointmentAdd(ByVal sender As Object, ByVal e As Dbi.WinControl.DayView.AfterAppointmentAddEventArgs) Handles DbiDayView1.AfterAppointmentAdd

        Dim newTimebar As New Dbi.WinControl.Schedule.dbiTimeBarItem

        e.Appointment.Data = 300 'Used for finding the classroom

        With e.Appointment

            newTimebar.Text = .Text

            newTimebar.Start = .Start

            newTimebar.End = .End

            newTimebar.EntryID = System.Guid.NewGuid.ToString 'This is for tracking the timebar in other events

            'Ordinarily this would be the database record ID

            newTimebar.Tag = e.Index 'Add the appointment index to the tag so we can manipulate it in other events

        End With

        Dim curItem As New Dbi.WinControl.Schedule.dbiScheduleItem

        curItem = FindItemInSched(e.Appointment.Data)

        If Not (curItem Is Nothing) Then

            curItem.TimeBars.Add(newTimebar)

            e.Appointment.Cargo = newTimebar.EntryID ' Add the timebar ID to the cargo so we can manipulate it in other events

        End If

        Me.DbiSchedule1.Invalidate()

    End Sub

    Private Sub DbiDayView1_AfterAppointmentChange(ByVal sender As Object, ByVal e As Dbi.WinControl.DayView.AfterAppointmentChangeEventArgs) Handles DbiDayView1.AfterAppointmentChange

        If Not (booleanTimeBarChanged) Then

            Dim curSchedItem As Dbi.WinControl.Schedule.dbiScheduleItem

            Dim curTimebar As Dbi.WinControl.Schedule.dbiTimeBarItem

            Dim foundTimebar As New Dbi.WinControl.Schedule.dbiTimeBarItem

            curSchedItem = FindItemInSched(e.Appointment.Data)

            For Each curTimebar In curSchedItem.TimeBars

                If curTimebar.EntryID = e.Appointment.Cargo Then

                    foundTimebar = curTimebar

                    Exit For

                End If

            Next

            foundTimebar.Start = e.Appointment.Start

            foundTimebar.End = e.Appointment.End

            foundTimebar.Text = e.Appointment.Text

            foundTimebar.Tag = e.Index

        Else

            booleanTimeBarChanged = False

        End If

        Me.DbiDayView1.Refresh()

    End Sub

    Private Sub DbiSchedule1_AfterTimeBarMoved(ByVal sender As Object, ByVal e As Dbi.WinControl.Schedule.AfterTimeBarMovedEventArgs) Handles DbiSchedule1.AfterTimeBarMoved

        Dim curAppt As Dbi.WinControl.DayView.dbiDayAppointmentItem = Me.DbiDayView1.Appointments(e.TimeBarItem.Tag)

        booleanTimeBarChanged = True

        curAppt.Start = e.TimeBarItem.Start

        curAppt.End = e.TimeBarItem.End

        curAppt.Text = e.TimeBarItem.Text

        booleanTimeBarChanged = False

        Me.DbiDayView1.Invalidate()

    End Sub

    Private Sub DbiSchedule1_AfterTimeBarSized(ByVal sender As Object, ByVal e As Dbi.WinControl.Schedule.AfterTimeBarSizedEventArgs) Handles DbiSchedule1.AfterTimeBarSized

        Dim curAppt As Dbi.WinControl.DayView.dbiDayAppointmentItem = Me.DbiDayView1.Appointments(e.TimeBarItem.Tag)

        booleanTimeBarChanged = True

        curAppt.Start = e.TimeBarItem.Start

        curAppt.End = e.TimeBarItem.End

        curAppt.Text = e.TimeBarItem.Text

        booleanTimeBarChanged = False

        Me.DbiDayView1.Invalidate()

    End Sub

    Private Sub DbiDayView1_AppointmentTextChange(ByVal sender As Object, ByVal e As Dbi.WinControl.DayView.AppointmentTextChangeEventArgs) Handles DbiDayView1.AppointmentTextChange

        If Not (booleanTimeBarChanged) Then

            Dim curSchedItem As Dbi.WinControl.Schedule.dbiScheduleItem

            Dim curTimebar As Dbi.WinControl.Schedule.dbiTimeBarItem

            Dim foundTimebar As New Dbi.WinControl.Schedule.dbiTimeBarItem

            curSchedItem = FindItemInSched(Me.DbiDayView1.Appointments(e.Index).Data)

            For Each curTimebar In curSchedItem.TimeBars

                If curTimebar.EntryID = Me.DbiDayView1.Appointments(e.Index).Cargo Then

                    foundTimebar = curTimebar

                    Exit For

                End If

            Next

            foundTimebar.Start = Me.DbiDayView1.Appointments(e.Index).Start

            foundTimebar.End = Me.DbiDayView1.Appointments(e.Index).End

            foundTimebar.Text = Me.DbiDayView1.Appointments(e.Index).Text

            foundTimebar.Tag = e.Index

        Else

            booleanTimeBarChanged = False

        End If

        Me.DbiDayView1.Refresh()

    End Sub

    Private Function FindItemInSched(ByVal intItemData As Integer) As Dbi.WinControl.Schedule.dbiScheduleItem

        'Function to find a dbiScheduleItem based on it's Data property.

        Dim findItem As Dbi.WinControl.Schedule.dbiScheduleItem

        Dim foundItem As New Dbi.WinControl.Schedule.dbiScheduleItem

        For Each findItem In Me.DbiSchedule1.Items

            If findItem.Data = intItemData Then

                foundItem = findItem

                Exit For

            End If

        Next

        Return foundItem

    End Function

This is just the beginning of what you can accomplish with a handful of properties and events. You can add validation, data access, and custom dialogs to create a truly integrated application.

Take care and have a great day!

Back To The Top

 

 

 

 

Control|
 Container| BackImage Properties| FadeFill Effect| WinForm| Tabpage| Gradient|
Dock|
dbiLabel|

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

April 2008
=================================================================

TechTip  -  Transparency Tips, Tricks and Traps:

In this space we usually try and focus on DBI controls or some non-standard ways to do specific things with our controls.  Yours truly has been doing some dev work lately on internal systems and I came across an interesting dilemma. So, today is going to be a bit different, we're going to focus on a particular issue common to most controls in a WinForm environment.

Here's where we begin - I wanted to add a fade-fill effect to my WinForm background. “Ok” says I, “I have the web, this should be no problem”. I did some research and came up with a few ways to add fade-fill effects (custom 2d pens, fills, backimage properties and onPaint overrides… yikes, my screen was jittering along like a June bug).  So I thought to myself, I’ll just toss a dbiLabel on my form, dock it to fill and set a gradient fill, presto… in no time I had a nice looking form. There's a trap though, any control that supports transparency will go transparent to the container (form, container, tabpage) but not other controls within the container.

Well that was something I thought a bit more about. What if I had a label that sits overtop of a textbox or an image.  I set the backcolor to transparent and instant grey box. What I needed was a little routine that would take two controls and set the backimage of the topmost to the image behind it. So I made this little function, it basically takes a copy of the display of one control and slaps it into the backimage of the topmost control. The only caveat (trick) is that the control being the topmost control has to support a backimage property. This can also be used at the form level as the form is a container control. Keep in mind there isn’t a lot of error checking, just something to toss out there for perusal.

    Private Sub FormLoad(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

        SetBackimage(Me, Me.Button1)

    End Sub

    Private Sub SetBackimage(ByRef ctrlColor As Control, ByRef ctrlTransparent As Control)

 Try

            Dim intX As Integer

            Dim intY As Integer

            intY = ctrlTransparent.Top - ctrlColor.Top

            intX = ctrlTransparent.Left - ctrlColor.Left
 

            If intY > 0 And intX > 0 Then

                Dim curImage As New Bitmap(ctrlColor.Width, ctrlColor.Height)

                ctrlColor.DrawToBitmap(curImage, New Rectangle(0, 0, ctrlColor.Width, ctrlColor.Height))

                ctrlTransparent.BackgroundImage = curImage.Clone(New _

                Rectangle(intX, intY, ctrlTransparent.Size.Width, ctrlTransparent.Size.Height), _

                Imaging.PixelFormat.Format24bppRgb)

            End If

        Catch ex As Exception

        End Try

    End Sub

Back To The Top

 

 

Lists|
Explorer Style| Multicolumn| dbiExplorerBar| SmartClient Demo|
Host|
Multiple Columns| Navigation Style| Multiple Layouts| Unique Features| Panels|

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

March 2008
=================================================================

TechTip  -  dbiExplorerBar  MultiColumn effects:

Hello all you developer types. Today’s topic is going to be about dbiExplorerBar and ways to achieve a multicolumn approach. One of the most unique features of the control is the multiple layouts available out of the box. The navigation style … which looks like so…

Can be used to house a default multicolumn view, which is configured by setting the dbiExplorerBar.ControlType = enumControlType.Navigation, the dbiExplorerBar.MultiColumn = True and the dbiExplorerBar.ColumnSize = width of column. With those settings you simply add items to the control and they get laid out in a nice table-type view.

Now to extend that even further, we often are asked how you can mix the types. For example say I want an explorer style with multiple columns. Well that is pretty easy as well, as the explorer type of the control allows for panels which can host other controls such as tables, lists and even images.  I used the image technique in the upcoming SmartClient demo (image on the right) to show that it is not only possible, but quite easy to manage…

On the right, I get the full benefits of the explorer style (note the multi-column list, the standard list, then the multicolumn image list at the bottom). This allows for a cleaner more customizable and attractive workspace (ok don’t beat me up on the color scheme, I am looking forward to the Expressions products so the marketing folks can take the heat for the look and feel, I’ll stick to the coding). Feel free to poke around the demo and see what you can do with dbiExplorerBar.

Smart Client Demo's

Back to the Top

 

   
Executables|
Registry| Deployment| OCX Files| Regsvr|
XML|
BIN|
App Path|
OLE View| GUIDS|
OLE Control| IDE|
Visual Studio| RegFree|
Type LIB| Controls| Manifest

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

February 2008
=================================================================
Tech Tip  – RegFree COM and DBI Components

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

Good afternoon loyal readers. We have noticed a pretty good trend here in our COM product sales, which has led to more questions on the deployment side of things. As such I thought I’d delve into an interesting but often overlooked method of deploying ActiveX controls with applications. It’s called RegFree COM. That’s right, as the name implies it removes the need to RegSvr COM .ocx files or register them during deployment. This allows greater flexibility in how you deploy your projects. This has an impact especially with the Vista UAC and registry lockdowns across networks. The process is pretty straightforward, you build a .manifest file for your application that contains all the information needed to call your .ocx files. Here is the breakdown… you will need an IDE that will compile down to an executable in order to attach the manifest. In our sample below we will simply use the method for including the .manifest file with the application.exe, but there are ways to build the manifest into the actual executable. For more information on that do a google on MT.exe and manifest.

 Basically you can point the executable you are running to the OLE control you want to use and specify the GUIDS for the TypeLib and Class in the manifest thus eliminating the need to check the registry (you can do a quick google on RegFree COM for more of the backstory) and I'll focus on how you can set one up to use some of our controls. As you are going to need both the typelib ID and class ID you may want to trackdown a copy of OLEVIEW. That little tool shipped back with VisualStudio 6 (I think it may actually go back to 4) but you can find a copy here...

 http://www.microsoft.com/downloads/details.aspx?familyid=5233b70d-d9b2-4cb5-aeb6-45664be858b6&displaylang=en

So basically let’s start a small sample app for testing purposes... we'll toss ctList on a form there and call our app ctListTest.exe

Add a couple of node items in the firstdraw and build your app. Now let’s copy our ctList.ocx to a folder in your app path called bin. We are then going to create a file called ctListTest.exe.manifest in the same folder as the executable. You can also check out some articles on building the manifests into the executables, there are a couple of command line utilities available from Microsoft that will handle this, but for our example we are going to use the "deploy with executable" method. The XML is going to look like so...

<?xml version="1.0" encoding="utf-8"?>

<assembly xsi:schemaLocation="urn:schemas-microsoft-com:asm.v1 assembly.adaptive.xsd" manifestVersion="1.0" xmlns:asmv1="urn:schemas-microsoft-com:asm.v1" xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:dsig="http://www.w3.org/2000/09/xmldsig#" xmlns="urn:schemas-microsoft-com:asm.v1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

  <assemblyIdentity name="ctDate.exe" version="1.0.0.0" type="win32" />

  <file name="bin\ctDate.ocx" asmv2:size="118784">

    <typelib tlbid="{F5A21BA6-2C08-11D5-A85D-0080C8DFC881}" version="5.0" helpdir="" resourceid="0" flags="HASDISKIMAGE"  />

    <comClass clsid="{F5A21BA6-2C08-11D5-A85D-0080C8DFC881}" threadingModel="Apartment" tlbid="{F5A21BA6-2C08-11D5-A85D-0080C8DFC881}" progid="ctDATE.ctDateCtrl.5" description="ctDate Control" />

  </file>

</assembly>

Now you can see we have a single <file> tag in our XML, you can have as many as you need to define for your app. Notice this one is for ctDate, we are going to mod it for use with ctList by changing the tag properties as follows...

This info is from the actual exe file properties...

-orig-<assemblyIdentity name="ctDate.exe" version="1.0.0.0" type="win32" />

-new-<assemblyIdentity name="ctListTest.exe" version="1.0.0.0" type="win32" />

Now for the OCX part...

-orig-

  <file name="bin\ctDate.ocx" asmv2:size="118784">

    <typelib tlbid="{F5A21BA6-2C08-11D5-A85D-0080C8DFC881}" version="5.0" helpdir="" resourceid="0" flags="HASDISKIMAGE"  />

    <comClass clsid="{F5A21BA6-2C08-11D5-A85D-0080C8DFC881}" threadingModel="Apartment" tlbid="{F5A21BA6-2C08-11D5-A85D-0080C8DFC881}" progid="ctDATE.ctDateCtrl.5" description="ctDate Control" />

  </file>

-new-

  <file name="bin\ctList.ocx" asmv2:size="471040">

    <typelib tlbid="{38EC7E50-6A01-4727-88E7-47788ABD54FE}" version="6.0" helpdir="" resourceid="0" flags="HASDISKIMAGE"  />

    <comClass clsid="{2B447B04-4CDC-4F52-915C-694DDCAD79F4}" threadingModel="Apartment" tlbid="{38EC7E50-6A01-4727-88E7-47788ABD54FE}" progid="ctLIST.ctListCtrl.6" description="ctList Control 6.0" />

  </file>

So your XML text for the ctList will be...

<?xml version="1.0" encoding="utf-8"?>

<assembly xsi:schemaLocation="urn:schemas-microsoft-com:asm.v1 assembly.adaptive.xsd" manifestVersion="1.0" xmlns:asmv1="urn:schemas-microsoft-com:asm.v1" xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:dsig="http://www.w3.org/2000/09/xmldsig#" xmlns="urn:schemas-microsoft-com:asm.v1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

<assemblyIdentity name="ctListTest.exe" version="1.0.0.0" type="win32" />

  <file name="bin\ctList.ocx" asmv2:size="471040">

    <typelib tlbid="{38EC7E50-6A01-4727-88E7-47788ABD54FE}" version="6.0" helpdir="" resourceid="0" flags="HASDISKIMAGE"  />

    <comClass clsid="{2B447B04-4CDC-4F52-915C-694DDCAD79F4}" threadingModel="Apartment" tlbid="{38EC7E50-6A01-4727-88E7-47788ABD54FE}" progid="ctLIST.ctListCtrl.6" description="ctList Control 6.0" />

  </file>

</assembly>

full view

If you wish to test this on your dev machine, you'll have to regsvr32/u ctList.ocx  (in your CT7 install folder) then if you did everything right your app should run as normal, rename the ctListTest.exe.manifest to something else and run it and you should get a class unregistered error.

As always from all of us here in support, take care and have a great day!

Back to the Top

 

 

   
Schedule| Designer|
XML Read|
XML Write| Productions Cycle|
Modal Form| .NET Framework| SmartClient Demo|

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

January 2008
=================================================================

Tech Tip #1   – Solutions::Schedule 2.0 for .NET – view new features quickly and easily with Smart Client

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

As you have no doubt heard by now SS.NET 2.0 has been released and we want you to be able to see some of the awesome new features available quickly and easily. To that end we have released 7 demos available as SmartClient demo applications. To download these, you will need .NET Framework 2.0 and MS – Internet Explorer 6  or later.  They will install in the download sandbox so you don’t have to worry about having Solutions::Schedule 1.0 for .NET or Solutions::Schedule 1.5 for .NET installed, you can run these applications just by clicking the links. Oh and the links can be found here…

http://www.dbi-tech.com/SmartClientSamples.asp

Also don’t forget our last tech tip (#2 below), the double clicking of the logo will still open the property pages so you can tweak away to your heart’s content

Tech Tip #2   – Solutions::Schedule 2.0 for .NET – Property Pages in Demo Run-times

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

Solutions::Schedule 2.0 for .NET is now in release. This is a huge step forward in both the presentation and organization of the Schedule. To help get you acquainted with some of the changes we have added, there is a new feature to all of our demo applications. You can now double click the Solutions for .NET image in runtime…

 

and you will open a modal form with the property pages for the Schedule in the demo. This way you can modify settings on the fly and see the results immediately. Just wanted to let people know about this as we used this feature a fair bit in the production cycle to test and adjust things without having to hardcode everything. Oh and the tip part – if you get the schedule setup just right, you can use the XMLWrite in the property page to “save” your work, then simply use the XMLRead in the designer to “load” your work into your own Schedule.

As always, take care and have a great day!

DBI Support

Back to the Top

 

   
Schedule|
Load|
Designer|
XML Read|
XML Write| Schedule Setup| Production Cycle|
Modal Form| .NET Image| Demo Applications|

 

 

 

 

 

 

 

 

 

 

 

December 2007
=================================================================

Tech Tip – Solutions::Schedule 2.0 for .NET – Property pages in demo runtimes

-----------------------------------------------------------------------------------
Well to start with, I’d like to wish everyone a happy holiday season and a very prosperous new year. As you will have noted if you read any of the above information, SolSched 2 for .NET is now in release. This is a huge step forward in both the presentation and organization of the Schedule. To help get you acquainted with some of the changes we have added a new feature to all of our demo applications. You can now double click the Solutions for .NET image in runtime…

and you will open a modal form with the property pages for the Schedule in the demo. This way you can modify settings on the fly and see the results immediately. Just wanted to let people know about this as we used this feature a fair bit in the production cycle to test and adjust things without having to hardcode everything. Oh and the tip part – if you get the schedule setup just right, you can use the XMLWrite in the property page to “save” your work, then simply use the XMLRead in the designer to “load” your work into your own Schedule.

As always, from the whole support department, take care and have a great day!

Paul Harden - Manager of Technical Support
phardenATdbi-tech.com
DBI Technologies Inc.

Back to the Top

 

 

   
Inheritance| dbiScheduleItem| Data Load| Child|
End-User| Declare| MyClass|
Back Color| Iterating|
Child Relationship|

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

November 2007
=================================================================

Tech Tip – Defaulting the List (in both dbiList and dbiSchedule.NET)

 One of the more frequent questions we get here in the support department regards manipulation of the list in dbiSchedule (as well as the new dbiList) and why does the developer have to do so much of the initialization work themselves. And the answer to that would be in the flexibility of the list itself. As it is a dynamic list/treeview control unto itself, there can be many permutations of headers, parent nodes, child nodes, graphics and formatting. One of the ways to set this is to define these properties in the data load, and that is perfectly legitimate, but there may be a better way. Once again we are going to hit on one of my best programming buddies – you faithful readers know what’s coming next – Inheritance. I was recently asked to put together a sample showing how to use a header / child relationship in a restaurant setting. As I began my coding I found myself defining the header dbiScheduleItem on the data load. I was iterating through my list and using a couple of case statements then setting up my items that way. I didn’t like that. I am a simplified kind of programmer. I like reusable code and I love my collections and inheritance. So I “thinked” a bit and decided what I wanted was more akin to a Microsoft Word type style. I wanted a Header type node where I could set up some fancy fill effects. But I wanted to make it easy to change the backcolor by department. Then I wanted my Standard list items which I wanted to pizzazz up a bit. So I put together my own partial classes that directly inherited the dbiScheduleItem then set the properties that I wanted. After that instead of coding each item as a new dbi.WinControl.Schedule.ScheduleItem or Dbi.WinControl.dbiNodeItem, I declare a new MyClass. Here is a bit of the code to achieve this…

 

      Partial Public Class ItemHeaderDefault

        Inherits Dbi.WinControl.Schedule.dbiScheduleItem ‘ Or Dbi.WinControl.dbiNodeItem

        Public Sub New(ByVal Text As String)

            Me.Text = Text

            Me.BackColor = Color.FromArgb(0, 102, 118)

            Me.BackColorTo = Color.FromArgb(0, 102, 118)

            Me.FillType = Dbi.enumFillType.Vertical

            Me.Font = New Font("Lucida Sans", 9, FontStyle.Bold)

            Me.ForeColor = Color.White

            Me.Header = True

        End Sub

End Class

Partial Public Class ItemDefault

        Inherits Dbi.WinControl.Schedule.dbiScheduleItem ‘ Or Dbi.WinControl.dbiNodeItem

        Public Sub New(ByVal Text As String)

            Me.Text = Text

            Me.BackColor = Color.FromArgb(235, 222, 132)

            Me.BackColorTo = Color.FromArgb(251,175,93)

            Me.FillType = Dbi.enumFillType.VerticalEdge

            Me.Font = New Font("Lucida Sans", 9, FontStyle.Regular)

            Me.ForeColor = Color.FromArgb(0, 102, 118)

        End Sub

      End Class

Now to utilize these I instance my own Classes then add those items to the Schedule…

       Dim Head1 As New ItemHeaderDefault("Kitchen")

        Head1.BackColor = Color.White

        Head1.BackColorTo = Color.LightGray

 

        Dim Head2 As New ItemHeaderDefault("Bar")

        Head2.BackColor = Color.White

        Head2.BackColorTo = Color.LightBlue

        Dim Head3 As New ItemHeaderDefault("WaitStaff")

        Head3.BackColor = Color.White

        Head3.BackColorTo = Color.PaleGreen

        Dim Kim As New ItemDefault("Kim")

        Dim David As New ItemDefault("David")

        Dim Jeff As New ItemDefault("Jeff")

        Dim Katlyn As New ItemDefault("Katlyn")

        Dim Shelly As New ItemDefault("Shelly")

        Dim Clark As New ItemDefault("Clark")

        Dim William As New ItemDefault("William")

        Dim Janine As New ItemDefault("Janine")

        Dim Paul As New ItemDefault("Paul")

        Head1.Items.Add(Kim)

        Head1.Items.Add(David)

        Head1.Items.Add(Jeff)

        Head2.Items.Add(Katlyn)

        Head2.Items.Add(Shelly)

        Head2.Items.Add(Clark)

        Head3.Items.Add(William)

        Head3.Items.Add(Janine)

        Head3.Items.Add(Paul)

        Me.DbiSchedule1.Items.Add(Head1) ‘ or Me.DbiList1.Items.Add(Head1)

        Me.DbiSchedule1.Items.Add(Head2) ‘ or Me.DbiList1.Items.Add(Head2)

        Me.DbiSchedule1.Items.Add(Head3) ‘ or Me.DbiList1.Items.Add(Head3)

        Head1.Expand()

        Head2.Expand()

        Head3.Expand()

As you can see the inheritance allows me to set those properties in one place and modifying the items is then pretty straightforward when the end-user comes back and doesn’t like that particular shade of yellow.

If you need any clarification don’t hesitate to drop us a line at support@dbi-tech.com or hit our webpage for some support at http://www.dbi-tech.com/Support/Default.aspx

As always,

Take care and have a great day!

Paul Harden - Manager of Technical Support
phardenATdbi-tech.com
DBI Technologies Inc.

Back to the Top

 

 

   
Schedule| Proxied Time| Time Bars|
Grid| Increment|
Time Frame| Plan Schedule| Timebars|
Grid Frequency| Ruler Divisions| Time Distance| Snap| Algorithm| Second Function| Database Updates| Utilize| Manipulate

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

October 2007

DBI Developer Bulletin October 2007
=================================================================
TECH TIP - Extend the Time Frame with Solutions::Schedule .NET

Howdy folks, today’s tip highlights how to manipulate the schedule to utilize an extended time frame (or conversely a smaller time frame, such as microseconds). The core of the work is processed by the two functions, we merely call each as needed to add/manipulate the schedule, then pull the information back to a data-aware state for database updates using the second function. We will be releasing this as a demo application with the Solutions::Schedule.NET V2.0

 5 year schedule plan proxied on a 5 day schedule!

 With this view the user will see a 5 year schedule.

 Smallest increment will be equal to one month.

 There will be 12 minor increments per year

 When using value point

 Schedule will be 5 days and the time type will be days

 Conversion =

 1 day schedule = 1 year actual

 2 hour schedule = 1 month actual

 To create the algorythm to get the desired results

 we used the following formula

   month     position of increment     Math calculation   hours

   Jan                1                   poi - 1 * 2 =      0    

   Feb                2                   poi - 1 * 2 =      2

   Mar                3                   poi - 1 * 2 =      4

   Apr                4                   poi - 1 * 2 =      6

   May                5                   poi - 1 * 2 =      8

 and so on

                     11  1

 1 2 3 4 5 6 7 8 9 10  12   Position of increment

 J F M A M J J A S O N D J

 |                       | These are the major time lines in the schedule

 |_|_|_|_|_|_|_|_|_|_|_|_| This is the minor time line in the schedule

 To achieve this I used the following

 RulerDivisions = 12;

 and

 GridFrequency = 10;

 and

 this.dbiSchedule1.TimeDistance = 120;

 and

 this.dbiSchedule1.SnapToGrid = true;

 Please note that using snap to grid requires that

 the above properties are set by a common factor

 by this we mean that the time distance can

 evenly be divided by ruler divisions and the grid frequency

 We used the following 2 functions to either turn the date

 of the schedule into our 5 year date selection

 or turn the 5 year selection into the actual time

         private DateTime Actual2Schedule(DateTime actualDate)  Actual2Schedule

         {

             DateTime schedDate;

             schedDate = SchedStart.AddDays(actualDate.Year - SchedStart.Year).AddHours((actualDate.Month - 1) * 2);

             return schedDate;

         }

         private DateTime Schedule2Actual(DateTime schedDateTime) Schedule2Actual

         {

             DateTime actDate;

             actDate = SchedStart.AddYears(schedDateTime.Day - 1).AddMonths(schedDateTime.Hour  2);

             return actDate;

         }

 When adding time bars to the schedule

 you need to convert them into the proxied time of the schedule

 We did this as follows

           Dbi.WinControl.Schedule.dbiTimeBarItem x;

           declaring the new item

           Dbi.WinControl.Schedule.dbiScheduleItem newItem = new Dbi.WinControl.Schedule.dbiScheduleItem();

            setting the item text in the list

           newItem.Text = "Test 1";

            declaring the new timebar item

           x = new Dbi.WinControl.Schedule.dbiTimeBarItem();

           x.Start = Actual2Schedule(System.DateTime.Parse("Jan 4 2007"));// setting the start time for the time bar              

           x.End = Actual2Schedule(System.DateTime.Parse("March 12 2008")) ;//setting the end time for the time bar

           x.Text = Schedule2Actual(x.Start).ToString("MMM yyyy") + " to " + Schedule2Actual(x.End).ToString("MMM yyyy");

           newItem.TimeBars.Add(x);adding the timebar to the item

           this.dbiSchedule1.Items.Add(newItem);// adding the complete item to the schedule

 When working with timebars, the schedule will think that you are working

 with current time schedule times and not the proxied time so you must

 remember to convert the time bars to that of the 5 year plan schedule or

 you will have issues

   private void dbiSchedule1_AfterTimeBarMoved(object sender, Dbi.WinControl.Schedule.AfterTimeBarMovedEventArgs e)

   {

       e.TimeBarItem.Text = Schedule2Actual(e.TimeBarItem.Start).ToShortDateString();

   }

A special thanks goes out to our support staff Jeff D. and Alan S. for this novel and powerful code snippet.

As always, take care and have a great day!

Paul Harden - Manager of Technical Support
phardenATdbi-tech.com

Back to the Top

 

   
Toolbox|
Help File| Install|
DBI|
Registry Key| Supporting| Toolbox Entries| EXE|
GAC|
Supporting Libraries|
Install Folder| dbiExplorerBar| Hierarchal Roadmaps| Filter