Главная » Просмотр файлов » John.Wiley.and.Sons.Rapid.Mobile.Enterprise.Development.for.Symbian.OS.An.Introduction.to.OPL.Application.Design.and.Programming.May.2005.eBook-LinG

John.Wiley.and.Sons.Rapid.Mobile.Enterprise.Development.for.Symbian.OS.An.Introduction.to.OPL.Application.Design.and.Programming.May.2005.eBook-LinG (779881), страница 28

Файл №779881 John.Wiley.and.Sons.Rapid.Mobile.Enterprise.Development.for.Symbian.OS.An.Introduction.to.OPL.Application.Design.and.Programming.May.2005.eBook-LinG (Symbian Books) 28 страницаJohn.Wiley.and.Sons.Rapid.Mobile.Enterprise.Development.for.Symbian.OS.An.Introduction.to.OPL.Application.Design.and.Programming.May.2005.eBook-LinG2018-01-10СтудИзба
Просмтор этого файла доступен только зарегистрированным пользователям. Но у нас супер быстрая регистрация: достаточно только электронной почты!

Текст из файла (страница 28)

If you use the code for one of these keys, its name(e.g. Tab, or Enter) will be shown in the key.The following option flags can be applied to abutton by adding the appropriate constant to the shortcut’s keycode:KDButtonNoLabel%$100KDButtonPlainKey%$200button is displayed with no shortcutkey labelthe key by itself – without the Ctrlmodification – is used for theshortcut keyThere are also constants for some key values:KDButtonDel%KDButtonTab%KDButtonEnter%KDButtonEsc%KDButtonSpace%89132732DelTabEnterEscSpaceThese constants are supplied in Const.oph.If a k% argument is negative, then the key is a‘Cancel’ key.

The corresponding positive value is usedfor the key to display and the value for DIALOG toreturn, but if you do press this key to exit, the varvariables used in the commands like dEDIT, dTIME,etc. will not be set. You must negate the shortcuttogether with any added flags.The Esc key will always cancel a dialog box, withDIALOG returning 0. If you want to show the Esc keyas one of the exit keys, use −KDButtonEsc% as the k%argument so that the var variables will not be set if Escis pressed.There can be only one dBUTTONS item per dialog.The buttons take up two lines on the screen.

dBUTTONS may be used anywhere between dINIT andDIALOG; the position of its use does not affect theposition of the buttons in the dialog.This example presents a simple query, returning‘False’ for No, or ‘True’ for Yes, providing shortcut keysOPL COMMAND LIST153of N and Y, respectively and without labels beneaththe keys:PROC query:dINITdTEXT "","FORGET CHANGES",2dTEXT "","Sure?",$202dBUTTONS "No",-(%N OR $300),"Yes",%Y OR $300RETURN DIALOG=%yENDPSee also dINIT.dCHOICEDefines a choice listUsage:dCHOICE var choice%,p$,list$,matching%or:dCHOICE var choice%,p$,list1$+",..."dCHOICE var choice%,"",list2$+",..."...dCHOICE var choice%,"",listN$Defines a choice list to go in a dialog.p$ will be displayed on the left side of the line.list$ should contain the possible choices, separated bycommas – for example, "No,Yes".

One of these will bedisplayed on the right side of the line, and the left andright arrows can be used to move between the choices.choice% must be a LOCAL or a GLOBAL variable.It specifies which choice should initially be shown – 1for the first choice, 2 for the second, and so on. Whenyou finish using the dialog, choice% is given a valueindicating which choice was selected – again, 1 for thefirst choice, and so on.dCHOICE supports an unrestricted number of items(up to memory limits). To extend a dCHOICE list, adda comma after the last item on the line followed by "..."(three full stops), as shown in the usage above.

choice%must be the same on all the lines, otherwise an erroris raised. For example, the following specifies items i1,i2, i3, i4, i5, i6:154OPL COMMAND LISTdCHOICE ch%,prompt$,"i1,i2,..."dCHOICE ch%,"","i3,14,..."dCHOICE ch%,"","i5,i6"If matching% is set to true (KTrue% in Const.oph),incremental matching will be enabled on the choicelist. If matching% is set to anything else OR omittedentirely from the dCHOICE line, the choice list will beconstructed with incremental matching turned off.See also dINIT.dDATEDefines a date edit boxUsage: dDATE var lg&,p$,min&,max&Defines an edit box for a date, to go in a dialog.p$ will be displayed on the left side of the line.lg&, which must be a LOCAL or a GLOBAL variable, specifies the date to be shown initially.

Althoughit will appear on the screen like a normal date, forexample 15/03/92, lg& must be specified as "days since1/1/1900".min& and max& give the minimum and maximumvalues that are to be allowed. Again, these are in dayssince 1/1/1900. An error is raised if min& is higher thanmax&.When you finish using the dialog, the date youentered is returned in lg&, in days since 1/1/1900.The system setting determines whether years,months, or days are displayed first.See also DAYS, SECSTODATE, DAYSTODATE, dINIT.DECLARE EXTERNALForces error reporting if procedures are usedbefore they are declaredUsage: DECLARE EXTERNALCauses the translator to report an error if any variables or procedures are used before they aredeclared.

It should be used at the beginningof the module to which it applies, before thefirst procedure. It is useful for detecting ‘Undefined externals’ errors at translate time rather thanat runtime.For example, with DECLARE EXTERNAL commented out, the following translates and raises theOPL COMMAND LIST155error Undefined externals, i at runtime. Addingthe declaration causes the error to be detected attranslate time instead:REM DECLARE EXTERNALPROC main:LOCAL i%i%=10PRINT iGETENDPIf you use this declaration, you will need todeclare all subsequent variables and proceduresused in the module, using EXTERNAL.See also EXTERNAL.DECLARE OPXDeclares an OPX nameUsage:DECLARE OPX opxname,opxUid&,opxVersion&...END DECLAREDeclares an OPX.

opxname is the name of the OPX,opxUid& its UID, and opxVersion& its version number.Declarations of the OPX’s procedures should bemade inside this structure.dEDITDefines a string edit boxUsage:dEDIT var str$,p$,len%or:dEDIT var str$,p$Defines a string edit box, to go in a dialog.p$ will be displayed on the left side of the line.str$ is the string variable to edit.

Its initial contentswill appear in the dialog. The length used when str$was defined is the maximum length you can type in.156OPL COMMAND LISTlen%, if supplied, gives the width of the edit box(allowing for widest possible character in the font). Thestring will scroll inside the edit box, if necessary. Iflen% is not supplied, the edit box is made wide enoughfor the maximum width str$ could possibly be.See also dTEXT.dEDITMULTIDefines a multi-line edit boxUsage: dEDITMULTI var pData&,p$,widthInChars%,numLines%,maxLen%,readOnly%Defines a multi-line edit box to go into a dialog. Normally the resulting text would be used in a subsequentdialog, saved to file, or printed using the Printer OPX(see Printer.opx – Printer and text handling).

It is alsopossible to paste text into the buffer from other applications and vice versa, although any formatting orembedded objects contained in text pasted in willbe removed.pData& is the address of a buffer to take the editeddata. It could be the address of an array as returned byADDR, or of a heap cell as returned by ALLOC (seeADDR and ALLOC). The buffer may not be specifieddirectly as a string and may not be read as such. Insteadit should be peeked, byte by byte (see PEEK). Theleading 4 bytes at ptrData& contain the initial numberof bytes of data following.

These bytes are also setby dEDITMULTI to the actual number of bytes edited.For this reason it is convenient to use a long integerarray as the buffer, with at least 1+(maxLen%+3)/4elements. The first element of the array then specifiesthe initial length.If an allocated cell is used (probably because morethan 64K is required), the first 4 bytes of the cell mustbe set to the initial length of the data.

If this length isnot set then an error will be raised. For example, if acell of 100 000 bytes is allocated, you would need topoke a zero long integer in the start to specify that thereis initially no text in the cell. For example:p&=ALLOC(100000)POKEL p&,0REM Text starts at p&+4Special characters such as line breaks and tab characters may appear in the buffer:OPL COMMAND LISTKParagraphDelimiter%KLineBreak%KPageBreak%KTabCharacter%KNonBreakingTab%KNonBreakingHyphen%KPotentialHyphen%$06$07$08$09$0a$0b$0cKNonBreakingSpace%KPictureCharacter%KVisibleSpaceCharacter%$10$0e$0f157paragraph delimiterline breakpage breakhorizontal tabnon-breaking horizontal tabnon-breaking hyphenwords will break here with ahyphen at the end of the line,if necessarynon-breaking spacea picturevisible spaceThese constants are supplied in Const.oph.The prompt, p$ will be displayed on the left sideof the edit box.

widthInChars% specifies the width ofthe edit box within which the text is wrapped, using anotional average character width. The actual number ofcharacters that will fit depends on the character widths,with e.g. more ‘i’s fitting than ‘w’s. numLines% specifiesthe number of full lines displayed. Any more lines willbe scrolled. maxLen% specifies the length in bytes ofthe buffer provided (excluding the bytes used to storethe length). readOnly% is an optional argument – ifspecified and set to true (KTrue% in Const.oph), theedit box will be made read only.

If omitted or set toanother value, the edit box will not be read only.The Enter key is used by a multi-line edit box thathas the focus before being offered to any buttons. Thismeans that Enter can’t be used to exit the dialog, unlessanother item is provided that can take the focus withoutusing the Enter key. Normal practice is to provide abutton that does not use the Enter key to exit a dialogwhenever it contains a multi-line edit box.

Характеристики

Тип файла
PDF-файл
Размер
3,18 Mb
Материал
Тип материала
Высшее учебное заведение

Список файлов книги

Свежие статьи
Популярно сейчас
Как Вы думаете, сколько людей до Вас делали точно такое же задание? 99% студентов выполняют точно такие же задания, как и их предшественники год назад. Найдите нужный учебный материал на СтудИзбе!
Ответы на популярные вопросы
Да! Наши авторы собирают и выкладывают те работы, которые сдаются в Вашем учебном заведении ежегодно и уже проверены преподавателями.
Да! У нас любой человек может выложить любую учебную работу и зарабатывать на её продажах! Но каждый учебный материал публикуется только после тщательной проверки администрацией.
Вернём деньги! А если быть более точными, то автору даётся немного времени на исправление, а если не исправит или выйдет время, то вернём деньги в полном объёме!
Да! На равне с готовыми студенческими работами у нас продаются услуги. Цены на услуги видны сразу, то есть Вам нужно только указать параметры и сразу можно оплачивать.
Отзывы студентов
Ставлю 10/10
Все нравится, очень удобный сайт, помогает в учебе. Кроме этого, можно заработать самому, выставляя готовые учебные материалы на продажу здесь. Рейтинги и отзывы на преподавателей очень помогают сориентироваться в начале нового семестра. Спасибо за такую функцию. Ставлю максимальную оценку.
Лучшая платформа для успешной сдачи сессии
Познакомился со СтудИзбой благодаря своему другу, очень нравится интерфейс, количество доступных файлов, цена, в общем, все прекрасно. Даже сам продаю какие-то свои работы.
Студизба ван лав ❤
Очень офигенный сайт для студентов. Много полезных учебных материалов. Пользуюсь студизбой с октября 2021 года. Серьёзных нареканий нет. Хотелось бы, что бы ввели подписочную модель и сделали материалы дешевле 300 рублей в рамках подписки бесплатными.
Отличный сайт
Лично меня всё устраивает - и покупка, и продажа; и цены, и возможность предпросмотра куска файла, и обилие бесплатных файлов (в подборках по авторам, читай, ВУЗам и факультетам). Есть определённые баги, но всё решаемо, да и администраторы реагируют в течение суток.
Маленький отзыв о большом помощнике!
Студизба спасает в те моменты, когда сроки горят, а работ накопилось достаточно. Довольно удобный сайт с простой навигацией и огромным количеством материалов.
Студ. Изба как крупнейший сборник работ для студентов
Тут дофига бывает всего полезного. Печально, что бывают предметы по которым даже одного бесплатного решения нет, но это скорее вопрос к студентам. В остальном всё здорово.
Спасательный островок
Если уже не успеваешь разобраться или застрял на каком-то задание поможет тебе быстро и недорого решить твою проблему.
Всё и так отлично
Всё очень удобно. Особенно круто, что есть система бонусов и можно выводить остатки денег. Очень много качественных бесплатных файлов.
Отзыв о системе "Студизба"
Отличная платформа для распространения работ, востребованных студентами. Хорошо налаженная и качественная работа сайта, огромная база заданий и аудитория.
Отличный помощник
Отличный сайт с кучей полезных файлов, позволяющий найти много методичек / учебников / отзывов о вузах и преподователях.
Отлично помогает студентам в любой момент для решения трудных и незамедлительных задач
Хотелось бы больше конкретной информации о преподавателях. А так в принципе хороший сайт, всегда им пользуюсь и ни разу не было желания прекратить. Хороший сайт для помощи студентам, удобный и приятный интерфейс. Из недостатков можно выделить только отсутствия небольшого количества файлов.
Спасибо за шикарный сайт
Великолепный сайт на котором студент за не большие деньги может найти помощь с дз, проектами курсовыми, лабораторными, а также узнать отзывы на преподавателей и бесплатно скачать пособия.
Популярные преподаватели
Добавляйте материалы
и зарабатывайте!
Продажи идут автоматически
6367
Авторов
на СтудИзбе
310
Средний доход
с одного платного файла
Обучение Подробнее