请教高手!!关于Code warrior里的问题!!

lj200404 2004-04-22 10:49:10
我现在用的是Code warrior 的开发工具,我现在想在我的form 里加入Repeating button的上下按纽,但现在我不知道怎样用他们,而且函数:
void FrmUpdateScrollers (FormType *formP, UInt16 upIndex, UInt16 downIndex, Boolean scrollableUp, Boolean scrollableDown)
在我的程序里不受Boolean的值控制,怎么办呀,这个问题花了我好长时间了请教高手指点一下,Repeating button 我想在form里显示上下箭头的样子,除了上面这个函数,还有什么其他的方法呀!!
...全文
89 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
Badistuta 2004-04-22
  • 打赏
  • 举报
回复
Most of the Palm Computing built-in applications make use of increment arrows, which appear as arrow-shaped buttons without frames. One good example is the pair of scroll arrows located in the lower-right corners of the To Do and Address Book applications.Increment arrows are simply regular button or repeating button resources that do not have frames. Instead of a normal text caption in the button, a single character from one of the Palm OS symbol fonts serves to make the button appear to be arrow-shaped. The symbol
fonts contain a variety of arrows, as well as many other small graphic elements used by the operating system, such as check boxes and Graffiti shift indicator icons.
To make an increment arrow, do the following:
1. Create a regular button or repeating button resource.
2. Uncheck the button’s Frame property in Constructor or use the NOFRAME
attribute in PilRC.
3. Set the button’s font to the symbol font containing the arrow character you want to use. The three symbol fonts are Symbol, Symbol 11, and Symbol 7, which you can identify in PilRC with the numbers 3, 4, and 5, respectively.
4. Set the button’s label text to the appropriate arrow character. In Constructor, check the Hex check box next to the Label property and enter the character’s number in hexadecimal. For a PilRC resource file, specify the button’s label as an octal number preceded by a backslash. For example, BUTTON “\001” sets the button’s label to be character 1 (decimal).
5. Resize the button to about the same size as the character in the button’s label.

The standard vertical scroll arrows in the built-in applications are repeating buttons using characters 1 and 2 (decimal) from the Symbol 7 font. The Palm OS provides the FrmUpdateScrollers function to gray out one or the other of the scroll arrows when at the top or bottom of the data a form can display.

One more thing is required to keep scrolling running smoothly in the Edit form: the repeating scroll buttons must be visually updated to reflect the current scroll state of the form. The Palm OS function FrmUpdateScrollers, given the right information,takes care of redrawing a pair of scroll arrows so they reflect a specific scroll status.Librarian contains an EditFormUpdateScrollers function that wraps FrmUpdateScrollers and gives it the information it needs:

static void EditFormUpdateScrollers(FormType *form,UInt16 bottomFieldIndex, Boolean lastItemClipped)
{
UInt16 upIndex;
UInt16 downIndex;
Boolean scrollableUp;
Boolean scrollableDown;
// If the first field displayed is not the first field in
// the record, enable the up scroller.
scrollableUp = gTopVisibleFieldIndex > 0;
// If the last field displayed is not the last field in the
// record, enable the down scroller.
scrollableDown = (lastItemClipped ||
(bottomFieldIndex < editLastFieldIndex));
// Update the scroll button.
upIndex = FrmGetObjectIndex(form, EditScrollUpRepeating);
downIndex = FrmGetObjectIndex(form,
EditScrollDownRepeating);
FrmUpdateScrollers(form, upIndex, downIndex, scrollableUp,
scrollableDown);
}

The FrmUpdateScrollers function takes five arguments: a pointer to a form, the
index of the scroll up button, the index of the scroll down button, a Boolean value indicating whether it is currently possible to scroll up, and another Boolean to indicate the possibility of scrolling down. Depending on the values of scrollableUp and scrollableDown, FrmUpdateScrollers will enable, disable, or redraw the scroll buttons according to the values.

The EditFormUpdateScrollers function knows that the table may be scrolled up
if the top visible field index is not the first field in the record. Likewise, if the last field displayed in the table is not the last field in the record, or if the bottom of the last displayed field is clipped, scrolling down is possible.

3,119

社区成员

发帖
与我相关
我的任务
社区描述
塞班系统(Symbian系统)是塞班公司为手机而设计的操作系统,它的前身是英国宝意昂公司的 EP ( Electronic Piece of cheese)操作系统。
社区管理员
  • Symbian社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧