Second Life source Analysis (90) Llscrolllistctrl Implementation list display
Source: Internet
Author: User
In the Second Life UI display, scrolling list also uses a lot of, because of the case of multiple list selection, using a scrolling list is often used to use the interface is more convenient and practical. As in the following login interface, there are controls that use the scrolling list: From the top right you can see a scrolling list to display different servers, which makes it easy for users to select different server logins. So how is this scrolling list implemented? Then we analyze the code for this class, and the inheritance of the class is as follows: #001 class llscrolllistctrl:public Lluictrl, public Lleditmenuhandler, #002 Public llctrllistinterface, public llctrlscrollinterface its display code is as follows: #001 void Llscrolllistctrl::d Raw () #002 { Determine if the control is visible and visible. #003 if (getvisible ()) #004 { To determine whether a sort is required. #005 //If user specifies sort, make sure it is maintained #006  &NB sp; if (needssorting () &&!issorted ()) #007 {#008 sortitems () #009 } #010 Whether scroll bars need to be displayed. #011 if (mneedsscroll) #012 &NBsp {#013 Scrolltoshowselected (); #014 mneedsscroll = FALSE; #015 } #016 llrect background ( 0, GetRect (), GetHeight (), GetRect (). GetWidth (), 0); Displays the background of the scrolling list. #017 //Draw background #018 if (mbackgroundvisible) #019 {#020 llglsnotexture no_texture; #021 GGL.COLOR4FV (getenabled)? MBgWriteableColor.mV:mBgReadOnlyColor.mV); #022 gl_rect_2d (background); #023 } #024 Update display column widths. #025 if (mcolumnsdirty) #026 { #027 updatecolumns (); #028 mcolumnsdirty = FALSE; #029 } #030 to begin displaying all list elements. #031 drawitems (); #032 Whether there is a border display, if it is displayed. #033 if (mborder) #034 {#035 Mborder->setkeyboardfocushighlight ( Gfocusmgr.getkeyboardfocus () = = this); #036 } #037 calls the display function of the base class. #038 Lluictrl::d Raw (); #039 } #040  } #041 through the above functions, you can see the list shown above, and next time to seeHow to add a list item and display the code for the list item in detail.
Second Life development package provided, the price of 198 yuan/set (including postage). includes the following contents:1."Second Life source Analysis" PDF document. 2.Second Life client source program. 3.2GUdisk, mainly used to copy source programs and related development tools. provide three months of technical services,provides quick compilation instructions, such as remote compile operations via QQ. provide a complete book reference. Contact Method:qq:9073204msn:caimouse1976@sina.com email: ccaimouse@gmail.com
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.