note

一个基于nim_duilib仿wechat的IM。

主界面

样式



美工差了

布局

整体为水平布局,左边的深灰色区域(frame_left),右侧的light white区域(frame_right)。

右侧的区域(frame_right)分为垂直布局,其中,左侧红色用于显示好友列表,右侧绿色用于显示聊天对话框

global xml中定义

定义了一些控件的样式

    <!--左侧窗口控件-->
<Class name="left_btn_portrait" tooltiptext="头像" height="36" width="36" margin="10,20,10,10" bkcolor="color_light_white1" normalimage="file='../left_frame/portrait_32X32.png'" />
<Class name="left_opt_msg" tooltiptext="消息" text="消息" height="36" width="36" margin="10,20,10,10" bkcolor="color_light_white1"
selectednormalimage="file='../public/button/btn_global_red_80x30_normal.png'"
selecteddisabledimage="file='../public/button/btn_global_red_80x30_normal.png' fade='30'"/> <Class name="left_opt_contact" tooltiptext="联系人" text="联系人" height="36" width="36" margin="10,20,10,10" bkcolor="color_light_white1"
selectednormalimage="file='../public/button/btn_global_red_80x30_normal.png'"
selecteddisabledimage="file='../public/button/btn_global_red_80x30_normal.png' fade='30'"/> <Class name="left_opt_file" tooltiptext="文件" text="文件" height="36" width="36" margin="10,20,10,10" bkcolor="color_light_white1"
selectednormalimage="file='../public/button/btn_global_red_80x30_normal.png'"
selecteddisabledimage="file='../public/button/btn_global_red_80x30_normal.png' fade='30'"/> <Class name="left_btn_setting" tooltiptext="设置" height="36" width="36" margin="10,20,10,10" bkcolor="color_light_white1" normalimage="file='../left_frame/setting.png'" /> <!--中间窗体控件-->
<TextColor name="edit_tip" value="#ffa8a8a8"/>
<TextColor name="edit_bk_color" value="#ffd7d9d8"/>
<Class name="middle_rich_edit_search" bkcolor="edit_bk_color" font="system_14" multiline="false" promptmode="true" prompttext="搜索" promptcolor="edit_tip"/>
<Class name="middle_btn_add" font="system_16" bkcolor="color_light_white1"/>

frame_left

frame_left为垂直布局。 xml文件如下

    <!--左侧的frame-->
<VBox class="frame_left" height ="stretch" width="60" >
<!--头像-->
<Button class="left_btn_portrait" /> <!--消息-->
<Option class = "left_opt_msg" group = "left_frame" /> <!--通讯录-->
<Option class = "left_opt_contact" group = "left_frame" /> <!--文件-->
<Option class = "left_opt_file" group = "left_frame" /> <Control /> <!--设置-->
<Button class = "left_btn_setting" /> </VBox>

frame_right

xml内容

    <!--右侧的frame-->
<VBox class="frame_middle_vbox" height="stretch" width="stretch"> <!---->
<HBox width="stretch" height="55" >
<!--搜索-->
<HBox width="250" height="30" margin="0,20,0,20">
<Control name="search_icon" width="auto" height="auto" valign="center" margin="10,0,0,0" alpha="192"
bkimage="file='../frame_middle/icon_search_gray.png' "/> <RichEdit class="middle_rich_edit_search" name="search_edit" height="auto" margin="8,0,10,0" valign="center" font="system_12" />
<Button class="middle_btn_top_del" name="clear_input" visible="false" valign="center" margin="0,0,10,0" />
<Button class="middle_btn_top_add" text="+" height="25" width="30" margin="0,0,10,10"/>
</HBox> <!--标题-->
<Label text="1234567890abcdefghijklmpqrstuvwxyz" font="system_16" margin="10,20,0,0"/> <Control />
<!--右上角3个按钮-->
<Button class="btn_wnd_min" name="minbtn" margin="4,6,0,0" />
<Box width="21" margin="4,6,0,0">
<Button class="btn_wnd_max" name="maxbtn" />
<Button class="btn_wnd_restore" name="restorebtn" visible="false"/>
</Box>
<Button class="btn_wnd_close" name="closebtn" margin="4,6,8,0"/>
</HBox> <!--右侧:联系人列表和聊天框-->
<HBox>
<!--联系人列表-->
<VBox bkcolor="red" width="250" height="stretch"> </VBox>
<!--聊天对话框-->
<VBox bkcolor="green" width="stretch" height="stretch"> </VBox>
</HBox>
</VBox>

xml完整

<?xml version="1.0" encoding="UTF-8"?>
<Window mininfo="700, 500" size="700,500" caption="0,0,0,500" shadowattached="true" sizebox="4,5,5,5" > <HBox bkcolor="color_light_white1" height="stretch" width="stretch"> <!--左侧的frame-->
<VBox class="frame_left_vbox" height ="stretch" width="60" >
<!--头像-->
<Button class="left_btn_portrait" />
<!--消息-->
<Option class="left_opt_msg" group = "left_frame" />
<!--通讯录-->
<Option class="left_opt_contact" group = "left_frame" />
<!--文件-->
<Option class="left_opt_file" group = "left_frame" />
<Control />
<!--设置-->
<Button class="left_btn_setting" />
</VBox> <!--右侧的frame-->
<VBox class="frame_middle_vbox" height="stretch" width="stretch"> <!---->
<HBox width="stretch" height="55" >
<!--搜索-->
<HBox width="250" height="30" margin="0,20,0,20">
<Control name="search_icon" width="auto" height="auto" valign="center" margin="10,0,0,0" alpha="192"
bkimage="file='../frame_middle/icon_search_gray.png' "/> <RichEdit class="middle_rich_edit_search" name="search_edit" height="auto" margin="8,0,10,0" valign="center" font="system_12" />
<Button class="middle_btn_top_del" name="clear_input" visible="false" valign="center" margin="0,0,10,0" />
<Button class="middle_btn_top_add" text="+" height="25" width="30" margin="0,0,10,10"/>
</HBox> <!--标题-->
<Label text="1234567890abcdefghijklmpqrstuvwxyz" font="system_16" margin="10,20,0,0"/> <Control />
<!--右上角3个按钮-->
<Button class="btn_wnd_min" name="minbtn" margin="4,6,0,0" />
<Box width="21" margin="4,6,0,0">
<Button class="btn_wnd_max" name="maxbtn" />
<Button class="btn_wnd_restore" name="restorebtn" visible="false"/>
</Box>
<Button class="btn_wnd_close" name="closebtn" margin="4,6,8,0"/>
</HBox> <!--右侧:联系人列表和聊天框-->
<HBox>
<!--联系人列表-->
<VBox bkcolor="red" width="250" height="stretch"> </VBox>
<!--聊天对话框-->
<VBox bkcolor="green" width="stretch" height="stretch"> </VBox>
</HBox>
</VBox> </HBox> </Window>

nim_duilib(20)之即刻(1)的更多相关文章

  1. IntelliJ IDEA 的 20 个代码自动完成的特性

    http://www.oschina.net/question/12_70799 在这篇文章中,我想向您展示 IntelliJ IDEA 中最棒的 20 个代码自动完成的特性,可让 Java 编码变得 ...

  2. 总结swift语言常见的20个问题和回答

    1.假设我是个刚入门的iOS开发人员,选swift学习呢,还是选objective-c学习,还是两个都学? 这个能够依据两种情况来决定:1.我想进入公司担任iOS开发的职位    2.我仅仅想做个独立 ...

  3. 【IDEA&&Eclipse】3、IntelliJ IDEA 的 20 个代码自动完成的特性

    在这篇文章中,我想向您展示 IntelliJ IDEA 中最棒的 20 个代码自动完成的特性,可让 Java 编码变得更加高效.对任何集成开发环境来说,代码的自动完成都是最最重要的一项功能,它根据你输 ...

  4. 20个实用的javascript技巧及实践(一)

    在本篇文章中,我们将会向大家分享JavaScript开发中的小技巧.最佳实践和实用内容,不管你是前端开发者还是服务端开发者,都应该来看看这些编程的技巧总结,绝对会让你受益匪浅的. 文中所提供的代码片段 ...

  5. 仿即刻app"猜你喜欢"切换控件

    最近在即刻里看到即刻的"猜你喜欢"的板块,觉得效果很赞. 当点击"换一换"时,上面三个条目程序切换效果,并且三个条目的切换以不同的速度进行. 于是开始想办法撸出 ...

  6. C++代码优化之nim_duilib控件关联

    前言 使用nim_duilib关联控件,优化后.的确减少了代码量,那么,执行效率呢? 时间执行的长短与硬件.软件有关,以下内容仅为参考. 测试代码 下面的代码,分为两部分, 循环使用for,非循环则直 ...

  7. nim_duilib(13)之添加fmt库

    introduction 习惯使用fmt库做字符串的格式化操作.尽管nim_duilib提供了类似的函数. 故项目demo_xml引入了外部库fmt framework.h中添加下面的以便使用fmt库 ...

  8. nim_duilib(1)之第一个dui executable(including configure setting in vs2017)

    before starting clone nim_duilib: https://github.com/netease-im/NIM_Duilib_Framework 迁出github的源码即可. ...

  9. CSharpGL(20)用unProject和Project实现鼠标拖拽图元

    CSharpGL(20)用unProject和Project实现鼠标拖拽图元 效果图 例如,你可以把Big Dipper这个模型拽成下面这个样子. 配合旋转,还可以继续拖拽成这样. 当然,能拖拽的不只 ...

随机推荐

  1. Codeforces 258E - Little Elephant and Tree(根号暴力/线段树+标记永久化/主席树+标记永久化/普通线段树/可撤销线段树,hot tea)

    Codeforces 题目传送门 & 洛谷题目传送门 yyq:"hot tea 不常有,做过了就不能再错过了" 似乎这是半年前某场 hb 模拟赛的 T2?当时 ycx.ym ...

  2. Codeforces 193D - Two Segments(线段树)

    Codeforces 题目传送门 & 洛谷题目传送门 感觉这个 *2900 并不难啊,为什么我没想出来呢 awa 顺便膜拜 ycx 一眼秒掉此题 %%% 首先碰到这类题有两种思路,一是枚举两个 ...

  3. Matlab指针

    Matlab指针 第一印象貌似是Matlab中不存在指针,所有变量与函数的赋值都是按值传递的,不会对参数进行修改.其实Matlab提供了handle类作为指针代替品.只要我们利用handle子类,就可 ...

  4. halt

    halt命令用来关闭正在运行的Linux操作系统.halt命令会先检测系统的runlevel,若runlevel为0或6,则关闭系统,否则即调用shutdown来关闭系统. 语法 halt(选项) 选 ...

  5. 22-reverseString-Leetcode

    思路:so easy class Solution { public: string reverseString(string s) { int n = s.size(); for(int i=0;i ...

  6. 云原生PaaS平台通过插件整合SkyWalking,实现APM即插即用

    一. 简介 SkyWalking 是一个开源可观察性平台,用于收集.分析.聚合和可视化来自服务和云原生基础设施的数据.支持分布式追踪.性能指标分析.应用和服务依赖分析等:它是一种现代 APM,专为云原 ...

  7. Siebel调用WebService

    Siebel可以调用外部系统的接口,通过WebService的接入方式实现,所在的项目都是通过ESB,其他系统的接口都要经过ESB,由ESB提供WSDL文档,通过Siebel调用. 一.修改Tools ...

  8. Initialization of data members

    In C++, class variables are initialized in the same order as they appear in the class declaration. C ...

  9. 什么是javaScript闭包

    闭包是与函数有着紧密的关系,它是函数的代码在运行过程中的一个动态环境,是一个运行期的概念. 所谓闭包,是指词法表示包括不必计算的变量的函数.也就是说,该函数能够使用函数外定义的变量. 在程序语言中,所 ...

  10. Spring Batch(8) -- Listeners

    September 29, 2020 by Ayoosh Sharma In this article, we will take a deep dive into different types o ...