Jump to content


Photo
- - - - -

Emulating Tab Screens


6 replies to this topic

#1 Ross Bevin

Ross Bevin

    ProIV Guru

  • Members
  • PipPipPipPipPip
  • 226 posts
  • Gender:Male
  • Location:Manzanillo, Colima, Mexico

Posted 05 April 2014 - 04:36 PM

Hi everyone,

 

I'm about to embark on a project to write data entry screens for a Windows tablet. Because of screen size constraints I have decided to look at dividing the screen function up to emulate tab navigation. I have created a working model where I have 5 screens embedded one after the other in my primary screen. I have a row of 5 buttons that emulate tabs. I use FNKEYSTACK('END OF DATA') and flags to field jump over to the appropriate screen when a tab button is pressed. It seems to work quite well however I know I will encounter situations where something won't quite work right.

 

There must be quite a few of you out there who have been emulating tab navigation for years and have perfected the technique. If you can share your methodology I would really appreciate it.

 

Regards

Ross



#2 DARREN

DARREN

    ProIV Guru

  • Members
  • PipPipPipPipPip
  • 396 posts
  • Gender:Male
  • Location:Florida,USA

Posted 08 April 2014 - 02:37 PM

Ross
 
In my experience there is always a controlling loop that resides in an object outside of the tabs. This could be a dummy field that resides within a cycle that paints the main format.
 
The logic associated with the function keys (that is assigned to the tabs) sets the tab and can change the tab graphic. It also exits the cycle returning control back to the master loop. I have included some code examples for your review.

 

The following code is executed in the controlling loop (on a dummy field or any other event point outside the tab cycles)

 

//

// set up the default tab graphic. #TAB can be set dynamically via a variable as the user may be returing back to this screen after exiting.

//

CASE #TAB
      WHEN 1:
         ByUserBarTab.Graphic = 'barbuttonmouseover.png'
         #MASTER_TAB = #TAB
         CALL 1
      WHEN 2:
         ByGroupBarTab.Graphic = 'barbuttonmouseover.png'
         #MASTER_TAB = #TAB
         CALL 1
      WHEN 3:
         ByFilterBarTab.Graphic = 'barbuttonmouseover.png'
         #MASTER_TAB = #TAB
         CALL 1
ENDCASE
//
WHILE $EXIT = ''
   // 04/12/10 - JSO - TR7989 - Added group tab
   CASE #TAB
      WHEN 1:
         // Clear group type so that we don't filter out types on the user tab
         $GROUP_TYPE = ''
         LSCALL('UserCycle')
      WHEN 2:
         LSCALL('ByGroupCycle')
      WHEN 3:
         LSCALL('ByFilterCycle')
      WHEN 4:
         LSCALL('BatchReassignCycle')
      OTHERWISE:
         // Should never get here
         MSG(10,#TAB) // ERROR - Unknown Tab Number %1
         FNEXIT
   ENDCASE
ENDWHILE

 

The following logic is defined on the logic associated with the tab icon. We used the same logic on all tabs as we gave the tabs accending function keys with tab one (in this example) having function key 45 and tab 4 having function key 48.

 

IF #TAB # @FNKEY - 44 THEN
   // Set previous tab to inactive graphics
   CASE #TAB
      WHEN 1:
         ByUserBarTab.Graphic = 'barbutton.png'
      WHEN 2:
         ByGroupBarTab.Graphic = 'barbutton.png'
      WHEN 3:
         ByFilterBarTab.Graphic = 'barbutton.png'
      WHEN 4:
         BatchReassignBarTab.Graphic = 'barbutton.png'
   ENDCASE
   // Set selected tab to active graphics
   #TAB = @FNKEY - 44
   CASE #TAB
      WHEN 1:
         ByUserBarTab.Graphic = 'barbuttonmouseover.png'
         #MASTER_TAB = #TAB
         CALL 1
      WHEN 2:
         ByGroupBarTab.Graphic = 'barbuttonmouseover.png'
         #MASTER_TAB = #TAB
         CALL 1
      WHEN 3:
         ByFilterBarTab.Graphic = 'barbuttonmouseover.png'
         #MASTER_TAB = #TAB
         CALL 1
      WHEN 4:
         BatchReassignBarTab.Graphic = 'barbuttonmouseover.png'
         RescheduleIcon.Visible = FALSE
         AcceptRenewalIcon.Visible = FALSE
         TaskHistoryIcon.Visible = FALSE
         RefreshIcon.Visible = FALSE
         ChangeIcon.Visible = FALSE
         MessageIcon.Visible = FALSE
         CreateNewBatchReassnIcon.Label = '     Batch Reassign'
   ENDCASE
   PUTNCOM('CORPORATEDIARYTAB',#MASTER_TAB)
   //
   LSEXIT
ENDIF

 

The final point of interest is to clear the format of the tab cycle upon exit. We placed the following code in the exit logic of the tab cycle(s). Obviously the tag names differ depending on the cycle that we are in.

 

UserCycle.ClearFormat()


Things should be made as simple as possible, but not simpler

#3 Ross Bevin

Ross Bevin

    ProIV Guru

  • Members
  • PipPipPipPipPip
  • 226 posts
  • Gender:Male
  • Location:Manzanillo, Colima, Mexico

Posted 08 April 2014 - 03:58 PM

Hi Darren,

 

Thanks for the reply and example code. I see how calling the screens via an LSCALL can be cleaner.

 

I see that you have CALL 1 logic in your example. I don't see a :1 so what does it do?

 

What is your standard when say dealing with the reading of a primary file (ACDL) and splitting the field maintenance into 4 or 5 tabs cycles. Do you process the key entry and file read in the primary cycle outside of any tabs then LSCALL the tab cycles within the primary cycle?

 

Regards

Ross



#4 kapoof

kapoof

    Member

  • Members
  • PipPip
  • 21 posts
  • Gender:Male

Posted 11 April 2014 - 01:16 AM

Hi Ross,

 

Please see the attached vpx/out file. This contains both an example of local and global tabs functions. Hope this helps.

 

Best Regards,

 

Attached File  tabs.vpx   535.5KB   36 downloads

 

Attached File  tabs.out   390.23KB   33 downloads



#5 Ross Bevin

Ross Bevin

    ProIV Guru

  • Members
  • PipPipPipPipPip
  • 226 posts
  • Gender:Male
  • Location:Manzanillo, Colima, Mexico

Posted 11 April 2014 - 12:53 PM

Thanks for the examples Robert. I will download them later today and take a look.

 

Regards

Ross



#6 Ross Bevin

Ross Bevin

    ProIV Guru

  • Members
  • PipPipPipPipPip
  • 226 posts
  • Gender:Male
  • Location:Manzanillo, Colima, Mexico

Posted 18 April 2014 - 04:28 PM

Hi Robert,

 

Sorry for the late reply; I have been swamped and just got the chance to download and look at your tab functions. Very nice indeed! I had no idea that the tab graphics were bundled with ProIV. Thanks again for sharing your code and ideas. This will save us a lot of time in getting started. Wim Soutendijk also got back to me and showed me screen shots of what they had done. They have set up a control framework that drives their tab navigation and screen control. For now we don't have the luxury of time to do that we will start off based on your design.

 

Thanks again!

 

Regards

Ross



#7 kapoof

kapoof

    Member

  • Members
  • PipPip
  • 21 posts
  • Gender:Male

Posted 21 April 2014 - 05:04 AM

Hi Ross,

 

Anytime, glad that you found it useful. 

 

Best Regards,

 

Rob.





Reply to this topic



  


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users