Codejock Forums Homepage
Forum Home Forum Home > General > XAML Snippets > Samples and Demo Applications
  New Posts New Posts RSS Feed - COM - VB - XAML Grid Demo
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

COM - VB - XAML Grid Demo

 Post Reply Post Reply
Author
Message
Krog View Drop Down
Groupie
Groupie


Joined: 06 February 2008
Status: Offline
Points: 100
Post Options Post Options   Thanks (0) Thanks(0)   Quote Krog Quote  Post ReplyReply Direct Link To This Post Topic: COM - VB - XAML Grid Demo
    Posted: 03 July 2009 at 7:43am
What do you think about stunning visual controls like the WPF ones but without the .NET framework nor that sloooowww WPF rendering?

The codejock XAML is really FAST!!! and running until in the old Windows 95! (for VB6)

Note: The developers that use the NET platform but are not happy with the WPF can also use the Codejock Markup feature instead of WPF :)

This is another simple demonstration of what we can do with the MarkupLabel control.

I like nice controls. I think that visual is important in screens. Now with the WPF there are comming a lot of 3rd party controls that are beautiful, but slow because they use the WPF technology. But we can make some of them using the codejock markup technology.

This is the XamlGrid control, showing that we can interact with the MarkupLabel.




You can download it here:

20090703_073458_XamlGrid_demo.zip


Limitations:
-The arrows keys (still) does not work with it (waiting the codejock team to solve this)
-Does not support horizontal scroll


This is for demonstrarion purposes only, to show some things we can make with the Markup Control. The control is not finalized. A lot of new properties are being implemented and I will post a new version soon, as well as new controls.


If YouHaveNewCodes Then
    PostThemHere()
ElseIf RelatedTo(MarkupLabel) Then
    GoTo MarkupLabelFeatures
End if
Product: Xtreme SuitePro (ActiveX) version 15.2.1
Platform: Windows XP SP2
Language: Visual Basic 6 SP6
Back to Top
jpbro View Drop Down
Senior Member
Senior Member
Avatar

Joined: 12 January 2007
Status: Offline
Points: 1355
Post Options Post Options   Thanks (0) Thanks(0)   Quote jpbro Quote  Post ReplyReply Direct Link To This Post Posted: 03 July 2009 at 3:15pm
Hey Krog, great demo! I especially like the fact that you got the edit window placement working.

I also have some good news - I had a thought that using the KeyBindings feature of the CommandBars control might work to get the Arrow keys working for the MarkupLabel control and it seems to work. Just add a CommandBars control (CommandBars1) to your UserControl and then add the following to the general section of the UserControl:


Private Const mc_KeyIndexOffset As Long = 1000


And then add this sub:


Private Sub CommandBars1_Execute(ByVal Control As XtremeCommandBars.ICommandBarControl)
   Select Case Control.Id
   Case mc_KeyIndexOffset + vbKeyUp
      UserControl_KeyDown vbKeyUp, 0
   Case mc_KeyIndexOffset + vbKeyLeft
      UserControl_KeyDown vbKeyLeft, 0
   Case mc_KeyIndexOffset + vbKeyRight
      UserControl_KeyDown vbKeyRight, 0
   Case mc_KeyIndexOffset + vbKeyDown
      UserControl_KeyDown vbKeyDown, 0
   End Select
End Sub


And add the following to your UserControl_Initialize event:


   With UserControl.CommandBars1
      .KeyBindings.Add 0, vbKeyUp, mc_KeyIndexOffset + vbKeyUp
      .KeyBindings.Add 0, vbKeyLeft, mc_KeyIndexOffset + vbKeyLeft
      .KeyBindings.Add 0, vbKeyRight, mc_KeyIndexOffset + vbKeyRight
      .KeyBindings.Add 0, vbKeyDown, mc_KeyIndexOffset + vbKeyDown
   End With


Great work, and thanks again!
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3

Language: Visual Basic 6.0 SP6

Back to Top
jpbro View Drop Down
Senior Member
Senior Member
Avatar

Joined: 12 January 2007
Status: Offline
Points: 1355
Post Options Post Options   Thanks (0) Thanks(0)   Quote jpbro Quote  Post ReplyReply Direct Link To This Post Posted: 03 July 2009 at 3:29pm
I just found a problem though - You can't use the arrow keys in the edit window with my code...I'll look for a fix.
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3

Language: Visual Basic 6.0 SP6

Back to Top
jpbro View Drop Down
Senior Member
Senior Member
Avatar

Joined: 12 January 2007
Status: Offline
Points: 1355
Post Options Post Options   Thanks (0) Thanks(0)   Quote jpbro Quote  Post ReplyReply Direct Link To This Post Posted: 03 July 2009 at 3:36pm
Okay, I found a fix. I had to add enough to the code that I thought I'd post the complete package:

uploads/20090703_153547_XamlGrid.zip

Basically, I add all the KeyBindings at startup or when the edit window loses focus, and delete the arrow keybindings in the StartEdit sub.
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3

Language: Visual Basic 6.0 SP6

Back to Top
Krog View Drop Down
Groupie
Groupie


Joined: 06 February 2008
Status: Offline
Points: 100
Post Options Post Options   Thanks (0) Thanks(0)   Quote Krog Quote  Post ReplyReply Direct Link To This Post Posted: 03 July 2009 at 4:47pm
Hi Jason!

Thanks!

Well, I got another simple way to do it without to use the CommandBars, and with less code.

The solution is to add a TextBox in the usercontrol that is out of the visible area but the Visible property is set to True, change the TabStop to False, and use the following line:

Private Sub MarkupLabel1_GotFocus()

txtFocus.SetFocus
End Sub

Indeed I did not post this solution before because I was intending to show to the codejock team that the MarkupLabel really does not support the Key* events and also "eat" the arrows key events if it has the focus.

I will post another sample with it and another things that I am finalizing.
Product: Xtreme SuitePro (ActiveX) version 15.2.1
Platform: Windows XP SP2
Language: Visual Basic 6 SP6
Back to Top
Krog View Drop Down
Groupie
Groupie


Joined: 06 February 2008
Status: Offline
Points: 100
Post Options Post Options   Thanks (0) Thanks(0)   Quote Krog Quote  Post ReplyReply Direct Link To This Post Posted: 04 July 2009 at 6:29am
Here is the version that supports the arrows keys:

20090707_190036_XamlGrid.zip

Now the control can be resized. I am working on the columns addition and new properties and adding events to make it usable.

The new version may be available soon.
Product: Xtreme SuitePro (ActiveX) version 15.2.1
Platform: Windows XP SP2
Language: Visual Basic 6 SP6
Back to Top
jpbro View Drop Down
Senior Member
Senior Member
Avatar

Joined: 12 January 2007
Status: Offline
Points: 1355
Post Options Post Options   Thanks (0) Thanks(0)   Quote jpbro Quote  Post ReplyReply Direct Link To This Post Posted: 07 July 2009 at 6:13pm
Hi Krog,

Great work on this demo, thanks again . A couple of things:

    1) There is a reference to WinSubHook 2 Interface 1.03 in the project that is missing (prevents running the demo until you clear it). It may confuse some who are trying it out, so it would be best if you cleared it since it does not seem to be required.
    2) When scrolling the grid with the edit window visible, the window doesn't scroll/disappear. I'm sure you are aware of this (and this is probably why you requested the Scroll event for the ScrollViewer), but I just thought I'd mention it in case you weren't aware. I don't have a good solution for it yet myself.
    3) Maybe you could also include a compiled EXE with your future ZIPs? It's just quicker to try out the new features of your releases that way (double-click from Zip app instead of extract/run VB6)
    4) I agree that both of our key handling methods are hacky, and that CJ implemented key events would be greatly preferable.

Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3

Language: Visual Basic 6.0 SP6

Back to Top
Krog View Drop Down
Groupie
Groupie


Joined: 06 February 2008
Status: Offline
Points: 100
Post Options Post Options   Thanks (0) Thanks(0)   Quote Krog Quote  Post ReplyReply Direct Link To This Post Posted: 07 July 2009 at 7:17pm
Hi Jason!

1) I removed the unused reference from the project. Thanks!

2) Sincerely, I did not test the scrolling while the edit is visible. Thanks to tell me.

One way to solve this would to be using a Timer while the edit is visible and checking if the ScrollViewer.VerticalOffset changed, and then to hide the edit.

Another simpler way would to be if there is a Click or MouseDown event only on the ScrollBar of the ScrollViewer, but I did not find one.

Well, I will put some solution on the next release.

The Scroll event was intended to be used to move elements that are not in the ScrollViewer area, i.e. to use it as a ScrollBar. This is one solution to put horizontal scrollbars on the grid. And simply to be informed when the content is scrolled.

3) I do not include an EXE in the zips because of virus spreading. Personally I do not open the exes that are in the zips, I only open the source.
Product: Xtreme SuitePro (ActiveX) version 15.2.1
Platform: Windows XP SP2
Language: Visual Basic 6 SP6
Back to Top
Krog View Drop Down
Groupie
Groupie


Joined: 06 February 2008
Status: Offline
Points: 100
Post Options Post Options   Thanks (0) Thanks(0)   Quote Krog Quote  Post ReplyReply Direct Link To This Post Posted: 09 July 2009 at 10:01pm
This is the XamlGrid version 0.1 beta



20090709_215905_XamlGrid_v0.1be.zip

It is for test purpose only, because it has still some bugs and not all features were tested. If you find some bug, please tell me.

One bug is known: Try to remove all the columns and then try to resize the form. It occurs inside the codejock code, because there is no ColumnDefinitions on the grid (I think). I will solve it not removing all the ColumnDefinitions, but it is not done in this version so the codejock team can test the code.

In the next version we will be able to change colors (including the use of transparency), shapes, margins and fonts. Using markup ;)
Product: Xtreme SuitePro (ActiveX) version 15.2.1
Platform: Windows XP SP2
Language: Visual Basic 6 SP6
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.125 seconds.