viewpoint-particle

Author Topic: Erratic Behavior with DC_ITEMBOXSELECT=6  (Read 3758 times)

richardh

  • Jr. Member
  • **
  • Posts: 54
Erratic Behavior with DC_ITEMBOXSELECT=6
« on: June 16, 2014, 12:15:33 pm »
I designed a GUI interface that synchronizes multiple windows and allows value edits....

I'm getting a lot of flashing due to lists and tree controls being updated... which I don't like but I can live with.

However, the issue that really bites is the fact that when I use

          DialogControlSet(Handle, "I_TreeView", 6, sSelection) ; set tree control to last user selection

it either stays static or jumps to the bottom of the window.

If I scroll the control to have sSelection in the middle of the window before using... 

          DialogControlSet(Handle, "I_TreeView", 6, sSelection) ; set tree control to last user selection

it either stays static or jumps to the top of the window.

If anyone has overcome this problem... I'd love to know how I can have the control behave in a consistent manner.

Thanks in advance,
RH

td

  • Tech Support
  • *****
  • Posts: 2595
    • WinBatch
Re: Irratic Behavior with DC_ITEMBOXSELECT=6
« Reply #1 on: June 16, 2014, 12:52:56 pm »
WIL dialogs do not natively support a 'tree' control.  Which WIL dialog control are you sending the DC_ITEMBOXSELECT to? Several control will accept that value.
"Success is a lousy teacher. It seduces smart people into thinking they can't lose."
  - Bill Gates


richardh

  • Jr. Member
  • **
  • Posts: 54
Re: Irratic Behavior with DC_ITEMBOXSELECT=6
« Reply #2 on: June 16, 2014, 01:38:12 pm »
An ItemBox

JTaylor

  • Pundit
  • *****
  • Posts: 919
    • Data & Stuff Inc.
Re: Irratic Behavior with DC_ITEMBOXSELECT=6
« Reply #3 on: June 16, 2014, 01:38:47 pm »
Make sure you are "Break"ing/"Return"ing out of the callback routine in the appropriate places rather than checking/refreshing "everything" with every loop of the CallBack. 

Jim

richardh

  • Jr. Member
  • **
  • Posts: 54
Re: Irratic Behavior with DC_ITEMBOXSELECT=6
« Reply #4 on: June 17, 2014, 05:44:07 am »
Thanks Jim... I'll take a second look at break points.


JTaylor

  • Pundit
  • *****
  • Posts: 919
    • Data & Stuff Inc.
Re: Irratic Behavior with DC_ITEMBOXSELECT=6
« Reply #5 on: June 17, 2014, 06:36:10 am »
Probably should have clarified my response earlier.   I sometimes have to use a Return -1 after some controls to avoid such behavior as the Breaks don't always do what I expect.   Not sure why or what causes the behavior as I don't even have code that is updating the control but will see that type of behavior where it seems to refresh everything so I get a bit of a blinking effect.

Jim

 Example:

Code: Winbatch
 
      Case DialogProcOptions(JTa_Handle,dpo_getnumber,"dl_JTa_extra1_x")
        extra1_x = DialogControlGet(JTa_Handle,"dl_JTa_extra1_x",dc_itemboxselect)
        Return -1
        Break
      Case DialogProcOptions(JTa_Handle,dpo_getnumber,"dl_JTa_extra2_x")
        extra2_x = DialogControlGet(JTa_Handle,"dl_JTa_extra2_x",dc_itemboxselect)
        Return -1
        Break
      Case DialogProcOptions(JTa_Handle,dpo_getnumber,"dl_JTa_extra3_x")
        extra3_x = DialogControlGet(JTa_Handle,"dl_JTa_extra3_x",dc_itemboxselect)
        Return -1
        Break
      Case DialogProcOptions(JTa_Handle,dpo_getnumber,"dl_JTa_extra4_x")
        extra4_x = DialogControlGet(JTa_Handle,"dl_JTa_extra4_x",dc_itemboxselect)
        Return -1
        Break

richardh

  • Jr. Member
  • **
  • Posts: 54
Re: Irratic Behavior with DC_ITEMBOXSELECT=6
« Reply #6 on: June 17, 2014, 06:58:15 am »
Thanks for the heads up Jim... I'll try it with

Case x
  'Code'
  Return -1 ; new line
 Break



richardh

  • Jr. Member
  • **
  • Posts: 54
Re: Erratic Behavior with DC_ITEMBOXSELECT=6
« Reply #7 on: June 17, 2014, 07:23:31 am »
I seem to recall reading a post at some point that mentioned suspending/pausing the dialog while background processing took place...

Have you had any luck with this reducing flashing Jim?

JTaylor

  • Pundit
  • *****
  • Posts: 919
    • Data & Stuff Inc.
Re: Erratic Behavior with DC_ITEMBOXSELECT=6
« Reply #8 on: June 17, 2014, 07:33:06 am »
If you have a process that takes a while to run it is best to disable the dialog using DialogProcOptions.    I mainly responded to the flashing behavior but since I'm not exactly sure  what all you are doing it is hard to respond with any definite answer.  After re-reading your original post I may have misunderstood.   The blinking I was talking about was occurring in the normal use of things.  If you have everything in a loop and are updating everything with every loop perhaps move the update part to at the end of whatever process gathers all the data.   Again, this may not be what you are doing so can't offer much more.   If the the DialogControlSet is jumping to an inappropriate place in the list that often means the value you are assigning isn't in the list.  May want to verify the value and list.

Jim