Page 1 of 2

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

Posted: December 23rd, 2017, 12:09 am
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 !

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

Posted: December 23rd, 2017, 1:02 am
by khurshid.arshad
Dear
You can find information from the following link.

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

Best.
a.

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

Posted: December 23rd, 2017, 6:20 am
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.

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

Posted: December 23rd, 2017, 9:33 am
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.

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

Posted: December 23rd, 2017, 10:09 am
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 ?

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

Posted: December 23rd, 2017, 10:38 am
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.

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

Posted: December 23rd, 2017, 10:54 am
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

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

Posted: December 23rd, 2017, 12:52 pm
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);

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

Posted: December 26th, 2017, 2:38 pm
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));

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

Posted: December 27th, 2017, 2:31 am
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.