Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Command Bars
  New Posts New Posts RSS Feed - SOLVED: Rebuild old application
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

SOLVED: Rebuild old application

 Post Reply Post Reply
Author
Message
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post Topic: SOLVED: Rebuild old application
    Posted: 27 August 2008 at 4:55am
Hi,
 
I'm trying to rebuild an old VB application. I added SkinFrameWork, DockingPanes and CommandBars to it. I didn't want to change code just to have more visual effects
 
  1. First I added SkinFramework, well... I did get most of the controls skinned but the VB textboxes don't "listen" to what SF is telling them. (As I was writing this, I tried with another theme and saw that also VB Textboxes get skinned, so I think I need to look into the style itself )  One down and two to go...
  2. I thought why not use commandbars, VB menu is a little out of time, right? So added commandbars to every form. Now it began to look like a real application, well at least for the menu, let's not talk about the toolbars, you have to build them from scratch. The menu looks nice but controlling the menuitems is another thing. Because I said "A" I had to say "B" so added Update event for every menubar. I said I don't change any code so took the easy way... This way I don't have to think, I only had to run my app and look at the menu item captions. Controlling the menu items has been done already in entire application. So, I added for every item in menu (for example):
    • Case "Edit"
      • Control.Enabled = mnuEdit.Enabled (is ID of VB menu)
    • Case "View"
      • Control.checked = mnuView.Checked
    • And so on... Lots of work but at least it's working as before.
  3. My first intention to "upgrade" my old app was to use DockingPanes because I was using an older control for resizing and wasn't able to close or hide "panes". I used it in the main window with all kinds of (child)windows which can be used for several things. So, I added DockingPanes... Create panes, attach panes blah,blah,blah OK, that works also. Only adding code to accomplish what you want, still not changing any of the original code.
 

Testing the application, we don't want any bugs in it, right? I found issues which I can't solve.

    1. I have a few forms which can be shown on top of all windows(like Windows Task Manager) I use API call SetWindowPos to set the form to front and have no problems when selecting another form. If I show them now (with DockingPanes) I can't select another pane, menu or whatever in the main form. But now it looks like DockingPane is in control... I wanted to solve this to create a pane for this form as well but VB doesn't allow you to set the .BorderStyle = None when you have a VB menu.
    2. Popupmenu items don't fire click event (of original VB menu click event handler) Only after a menu item is selected once in the mainmenu (Commandbars) the popupmenu items will fire click events.
    3. Commandbars will convert VB menu automatically and sometimes you click on the caption icon (where normally the system menu would show) the VB menu shows. How to get rid of this ???

   

Maybe there are more... I don't know. PLEASE let me know if there are more problems to expect.

I hope I can solve this as well, I got this far and want it to finish it now...
 
Thank you
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 27 August 2008 at 5:51am
Hello,
 
1. Yes, it depends on style.
 
2. SkinFramework now doesn't support standard Menus. We working with this feature for 12.1 release. Please try beta when it will be available.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 27 August 2008 at 8:28am
Hi,
 
2, 3. I very recommend you create CommandBar in code to prevent such things. :-( Will I'm testing it but not sure how reproduce 3.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post Posted: 27 August 2008 at 8:38am
Hi Oleg,
 
I will show you how reproduce 2 & 3
 
I spent about a day to figure out what is going wrong but I found it. I don't know WHY it happens but you are the one who can / must solve this.
 
Here it is:
 
 
 
At this point I accept any workarounds or whatever you can think of to solve these problems.
 
btw what about issue 1. What style do I have to set?
 
 
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....
Back to Top
younicke View Drop Down
Senior Member
Senior Member
Avatar

Joined: 11 March 2005
Status: Offline
Points: 107
Post Options Post Options   Thanks (0) Thanks(0)   Quote younicke Quote  Post ReplyReply Direct Link To This Post Posted: 27 August 2008 at 11:59am
hi aaron,

yeah long time no see.

i have tried the attached sample and honestly i cant figure out why it is acting that way. i have never tried however using the native vb menu in conjunction with the cj commandbars. if it is not a lot of work for you then i would suggest you rewrite you whole menu using the cj commands. again, however, i dont think you would do that, would you? :)
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: 27 August 2008 at 2:05pm
Hi Aaron,

If you are desperate for a workaround for the issue in your sample, here's an ugly one:


Option Explicit

Private mblnMenusReady As Boolean

Private Sub Form_Activate()
   If Not mblnMenusReady Then
      Me.CommandBars.ActiveMenuBar.Controls(1).Execute
      Me.CommandBars.ActiveMenuBar.Controls(1).CommandBar.Controls(1).Execute
     
      mblnMenusReady = True
   End If
End Sub


The in your first menu item (the one that will be clicked when the form is activated), add this code at the start of the Click event sub:


   If Not mblnMenusReady Then
      Exit Sub
   End If


Basically, the code shows & clicks the first menu item (which gets ignored by the Click event the first time). Seems to work, but you will get an ugly flicker of the menu when the form first appears. While not a great solution, it could be useful as a (hopefully very) temporary workaround.

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

Language: Visual Basic 6.0 SP6

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

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post Posted: 27 August 2008 at 4:49pm
Originally posted by jpbro jpbro wrote:

Hi Aaron,

If you are desperate for a workaround for the issue in your sample, here's an ugly one:
 
[...]

 
Hi Jason,
 
Thanks for reply. I have tried to do that also but in some way this didn't work for me.
 
I just added it in my original project and it crashed. In the test project it works. I will check this again in the morning and maybe I can use this and in the meantime CJ can find a fix for this.
 
Thanks
  
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....
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: 27 August 2008 at 6:49pm
It's possible that the crash happens with 12.0.1 and not 12.0.2 (I forgot to update my signature after I upgraded to 12.0.2)...
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3

Language: Visual Basic 6.0 SP6

Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 28 August 2008 at 1:31am
Hi,
 
Aaron, just don't use such trick. Create menu and context menu with code.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post Posted: 15 September 2008 at 6:08am
Hi,
 
After several days of trying and a lot annoying things came to my attention, there's a light at the end of the tunnel  I'm glad it turned out OK for me. There are a few things that could be improved but what the heck, I have what I want and this time I only added new version of SkinFrameWork to my project. Let this be a lesson for all of us... communicate is best solution to all problems  
 
If someone wants the same forget all issues and just add V12.1.0 SkinFrameWork control
 
Thanks a lot CJ
 
 
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....
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.217 seconds.