How to add a userbar on android to insert automatically a line in a roster.

Discussions about creating CAPI applications to run on Android devices
Forum rules
New release: CSPro 8.0
thierryt
Posts: 47
Joined: April 26th, 2017, 12:17 pm

How to add a userbar on android to insert automatically a line in a roster.

Post by thierryt »

Hi all,
Please, i want to add a button who allow the user to insert a line on csentry android .
On windows i have do("InsertGroupOcc"), but it does not work on android.
how can i do it on android ?
Thanks !
khurshid.arshad
Posts: 571
Joined: July 9th, 2012, 11:32 am
Location: Islamabad, Pakistan

Re: How to add a userbar on android to insert automatically a line in a roster.

Post by khurshid.arshad »

Dear
You can find information from the following link.

http://www.csprousers.org/forum/viewtop ... =10&t=1649

Best.
a.
thierryt
Posts: 47
Joined: April 26th, 2017, 12:17 pm

Re: How to add a userbar on android to insert automatically a line in a roster.

Post by thierryt »

hi khurshid,
thanks for your answer.
What you propose allow user to insert a line manually .

Now i want to know if it is possible to do it automatically like on windows.
On windows i write :
userbar(add button, "INSERT A LINE", do("InsertGroupOcc"));

but when i run it on android the button do not appear.
Thanks.
khurshid.arshad
Posts: 571
Joined: July 9th, 2012, 11:32 am
Location: Islamabad, Pakistan

Re: How to add a userbar on android to insert automatically a line in a roster.

Post by khurshid.arshad »

Dear

Please use userbar(show) in the end and after that, you can see a button on your android. I don't think so this code will work on Android for insert case. Example
set attributes ($) hidden works on desktop but not on Android.


userbar(clear);
userbar(add button, "INSERT A LINE", do("InsertGroupOcc"));
userbar(show);

Best.
a.
thierryt
Posts: 47
Joined: April 26th, 2017, 12:17 pm

Re: How to add a userbar on android to insert automatically a line in a roster.

Post by thierryt »

when i write
userbar(clear);
userbar(add button, "INSERT A LINE", do("InsertGroupOcc"));
userbar(show);

the button appear on windows but not on android.
What can i write to do this in android ?
Gregory Martin
Posts: 1777
Joined: December 5th, 2011, 11:27 pm
Location: Washington, DC

Re: How to add a userbar on android to insert automatically a line in a roster.

Post by Gregory Martin »

The userbar buttons don't appear on Android as they do on Windows. Look at this image:

http://www.csprousers.org/help/CSPro/an ... ements.png

The userbar button will appear by the note icon (#3). Once you click on it, it will show you the options.
thierryt
Posts: 47
Joined: April 26th, 2017, 12:17 pm

Re: How to add a userbar on android to insert automatically a line in a roster.

Post by thierryt »

Hi Greg,
i know that the userbar buttons don't appear on Android as they do on Windows.
my problem is especially that when i write
userbar(clear);
userbar(add button, "INSERT A LINE", do("InsertGroupOcc"));
userbar(show);
on android when i click on the note icon (#3), nothing appear.
i don't know what is the problem with do("InsertGroupOcc") on android.
Thanks
khurshid.arshad
Posts: 571
Joined: July 9th, 2012, 11:32 am
Location: Islamabad, Pakistan

Re: How to add a userbar on android to insert automatically a line in a roster.

Post by khurshid.arshad »

Dear Greg;

I have tried alpha-expression within the do command in CSPro 6.3, 7.0 and 7.1, but it is not working on Android. It shows only Close option.
Thanks.
Arshad

Code: Select all

PROC GLOBAL

Function Quit();
	stop(1);
end;

PROC R1_PID

Preproc
	userbar(clear);
	userbar(add button, "Close", Quit());
	userbar(add button, "Insert Row After", do("InsertGroupOccAfter"));
	userbar(show);
Gregory Martin
Posts: 1777
Joined: December 5th, 2011, 11:27 pm
Location: Washington, DC

Re: How to add a userbar on android to insert automatically a line in a roster.

Post by Gregory Martin »

I see. I didn't pay enough attention to the code. The "do" options are not implemented on Android. They replicate CSEntry (Windows) menu options. You will have to implement the function using logic, something like:
insert(RECORD_NAME(curocc(RECORD_NAME) + 1));
khurshid.arshad
Posts: 571
Joined: July 9th, 2012, 11:32 am
Location: Islamabad, Pakistan

Re: How to add a userbar on android to insert automatically a line in a roster.

Post by khurshid.arshad »

DearGregory;

Merry Christmas.



Thanks for your reply and it is working now.

I need one clarification. When i am using Record name ROSTER instead of form name "ROSTER_FORM", it gives error message. But, if we read error message it shows that we can use name any of them.

ERROR: Record, group or multiple item name expected near line 8 in GLOBAL procedure

Code: Select all


PROC GLOBAL
Function Quit();
	stop(1);
end;

Function Addocc()

insert(ROSTER_FORM(curocc(ROSTER_FORM) + 1));

end;


PROC PID
Preproc

	userbar(clear);
	userbar(add button, "Close", Quit());
	userbar(add button, "InsertGroupOccAfter", Addocc());
	userbar(show);


Best.
a.
Post Reply