Qizhen's profileLabVIEWPhotosBlogListsMore Tools Help

Blog


    Caption 和 Label 的书写规范

        LabVIEW控件的 Caption 和 Label 的特性和用途很相似,都是给了控件一个有意义的名字。因此,在很多场合没有必要刻意区分他们。
         Caption 和 Label 的最主要区别在于,Caption 可以在程序运行的时候改变;而 Label 则不可以,一旦程序运行,就固定不变了。鉴于这一点,Caption 和 Label 的用途也略有区别。Label 应该是给程序自己用的,比如在程序中需要根据控件的名字找到它,那就得跟据  Label 来找,而不能用Caption来找;Caption 是为了给用户看的,有时控件的名字在运行到不同状态下需要发生改变,此时显示在界面上的就应该是 Caption。
     
        推荐大家按照下面的规范使用  Caption 和 Label。
     
        先给 VI 分一下类:
        1. 底层 VI:用户不会直接使用到的 VI,作为 subVI 随程序一起发布。
        2. 用户界面 VI:VI 前面板是给用户看的程序界面的一部分。
        3. 程序接口 VI:VI 是提供给用户,在他们编程时,当作 API 被调用。
     
        对于  Caption 和 Label 一个共同的书写规范是:使用有意义的文字,在使用英语短语命名时,单词之间用空格分隔,不应该有重名。
        不同点列于下表:
    Label Caption
    底层 VI 显示出来 使用 LabVIEW 的默认状态,即 Caption 为空。
    用户界面 VI 隐藏
    多语言版本中,只使用英语
    显示
    多语言版本中,使用本地化语言
    程序接口 VI 隐藏
    多语言版本中,只使用英语
    不用标注控件的默认值
    显示
    多语言版本中,使用本地化语言
    在后面加一括号,括号内标注控件的默认值和数据单位

     
     
     

    Comments (2)

    Please wait...
    Sorry, the comment you entered is too long. Please shorten it.
    You didn't enter anything. Please try again.
    Sorry, we can't add your comment right now. Please try again later.
    To add a comment, you need permission from your parent. Ask for permission
    Your parent has turned off comments.
    Sorry, we can't delete your comment right now. Please try again later.
    You've exceeded the maximum number of comments that can be left in one day. Please try again in 24 hours.
    Your account has had the ability to leave comments disabled because our systems indicate that you may be spamming other users. If you believe that your account has been disabled in error please contact Windows Live support.
    Complete the security check below to finish leaving your comment.
    The characters you type in the security check must match the characters in the picture or audio.

    To add a comment, sign in with your Windows Live ID (if you use Hotmail, Messenger, or Xbox LIVE, you have a Windows Live ID). Sign in


    Don't have a Windows Live ID? Sign up

    Qizhen Ruanwrote:
    VB 已经记不清了,应该是差不多的。
    July 28
    Yongqing Yewrote:
    看了半天,好像还是不太明白。。。
    应该就跟vb里面的caption/name差不多吧?
    July 28

    Trackbacks

    The trackback URL for this entry is:
    http://ruanqizhen.spaces.live.com/blog/cns!5852D4F797C53FB6!1506.trak
    Weblogs that reference this entry
    • None