cancel
Showing results for 
Search instead for 
Did you mean: 

Is there any way to get swipe container displaying page

??sah
Associate II

I am implementing a settings menu for my particular project I decided to use a common button for rising and descending the values of the parameters but I cant catch which page which is containing the parameter desiring to configure ,swiped

4 REPLIES 4
Martin KJELDSEN
Chief III

Hi @özcan sahsuvar​,,

Have you checked the SwipeContainer example from within the designer? It supports a page indicator at the bottom of the screen to show which element is in focus.

Hope that helps,

Best regards,

Martin

??sah
Associate II
void Screen3View::plusValue()
{
    if(swipeContainer1.pageIndicator.currentPage == 0x00)
		{VLabelling_Speed++;}
   if(swipeContainer1.pageIndicator.currentPage == 0x01)
		{VLabelOffset++;}
    if(swipeContainer1.pageIndicator.currentPage == 0x02)
		{VDelayAfterSee++;}	
		    
    Unicode::snprintf(SpeedTextBuffer, 5, "%d", VLabelling_Speed);
    SpeedText.invalidate();
 
    Unicode::snprintf(OffsetTextBuffer, 5, "%d", VLabelOffset);
    OffsetText.invalidate();
 
    Unicode::snprintf(DelayTextBuffer, 5, "%d", VDelayAfterSee);
    DelayText.invalidate();
		
}

thank you very much for your reply but I did something to get job done but I am not sure it obeyed the work flow. Page indicator class is a private object in the swipecontainer class I had to cut it from private area and paste under public: in the swipeContainer.hpp file in the code snap I am calling that function and it has to determine which page selected. If I did something wrong or something out of workflow please warn me.

Martin KJELDSEN
Chief III

Hi @özcan sahsuvar​,

It's true that the indicator is private. I suppose one could want to get the current page or even receive an event/callback when a page has been changed. You haven't changed any behavior, so you could keep doing it like that - or create your own custom OzcanSwipeContainer that simply defines an additional uint8_t getSelectedPage(). It's up to you.

Best regards,

Martin

??sah
Associate II

is there any example of custom swipecontainer I dont know where to start. Unfortunately pageIndicator.currentPage does not return me convenient value