文档章节

aauto一个电话本的完整代码

废柴大叔
 废柴大叔
发布于 2014/01/27 14:02
字数 12636
阅读 843
收藏 5

下载地址:http://pan.baidu.com/s/1sj4NrFf

代码:

import win.ui;
import gdip
import fsys
import com.excel;
import process;

//此程序有CHARLIE 陈江独立开发完成,请勿用于商业用途。
var x,y=win.getScreen()
dirpath=fsys.getCurDir()

if y>768 and y<1000 {
fsys.copy(dirpath+"\SYSTEMCOLOR\387X848\MAIN-BLACK.bmp",dirpath+"\SYSTEMCOLOR\BLACK\MAIN.bmp")
fsys.copy(dirpath+"\SYSTEMCOLOR\387X848\MAIN-BLUE.bmp",dirpath+"\SYSTEMCOLOR\BLUE\MAIN.bmp")
fsys.copy(dirpath+"\SYSTEMCOLOR\387X848\MAIN-GOLD.bmp",dirpath+"\SYSTEMCOLOR\GOLD\MAIN.bmp")
fsys.copy(dirpath+"\SYSTEMCOLOR\387X848\MAIN-GREEN.bmp",dirpath+"\SYSTEMCOLOR\GREEN\MAIN.bmp")
fsys.copy(dirpath+"\SYSTEMCOLOR\387X848\MAIN-PURPLE.bmp",dirpath+"\SYSTEMCOLOR\PURPLE\MAIN.bmp")
fsys.copy(dirpath+"\SYSTEMCOLOR\387X848\MAIN-RED.bmp",dirpath+"\SYSTEMCOLOR\RED\MAIN.bmp")
fsys.copy(dirpath+"\SYSTEMCOLOR\387X848\MAIN-STEEL.bmp",dirpath+"\SYSTEMCOLOR\STEEL\MAIN.bmp")
/*DSG{{*/
mainForm = ..win.form(text="E-PHONEBOOK";right=387;bottom=848;bgcolor=2501148;border="none";parent=...;sysmenu=false;topmost=1)
mainForm.add(
combobox={cls="combobox";text="Relative";left=70;top=336;right=329;bottom=356;edge=1;font=LOGFONT( h=-13 );items={};mode="dropdown";z=23};
combobox10={cls="combobox";left=69;top=342;right=328;bottom=362;edge=1;font=LOGFONT( h=-17;weight=700 );items={};mode="dropdown";z=48};
combobox2={cls="combobox";text="combobox2";left=70;top=362;right=328;bottom=382;edge=1;font=LOGFONT( h=-13 );items={};mode="dropdown";z=29};
combobox3={cls="combobox";text="combobox3";left=90;top=520;right=310;bottom=546;edge=1;font=LOGFONT( h=-17;weight=700 );items={"Don't need password";"Use password"};mode="dropdown";z=30};
combobox4={cls="combobox";left=69;top=393;right=328;bottom=413;edge=1;font=LOGFONT( h=-17;weight=700 );items={"Set Group";"Color Skin"};mode="dropdown";z=32};
combobox5={cls="combobox";left=174;top=487;right=328;bottom=507;edge=1;font=LOGFONT( h=-17;weight=700 );items={};mode="dropdown";z=35};
combobox6={cls="combobox";text="Black Gold";left=175;top=549;right=329;bottom=569;edge=1;font=LOGFONT( h=-17;weight=700 );items={};mode="dropdown";z=37};
combobox7={cls="combobox";text="combobox7";left=175;top=609;right=329;bottom=629;edge=1;font=LOGFONT( h=-17;weight=700 );items={};mode="dropdown";z=39};
combobox8={cls="combobox";left=69;top=488;right=326;bottom=508;edge=1;font=LOGFONT( h=-17;weight=700 );items={};mode="dropdown";z=42};
combobox9={cls="combobox";left=70;top=285;right=329;bottom=305;edge=1;font=LOGFONT( h=-17;weight=700 );items={"INPORT EXCEL";"INPORT E-PHONE";"EXPORT TO EXCEL";"EXPORT TO E-PHONE"};mode="dropdown";z=45};
edit={cls="edit";left=70;top=715;right=330;bottom=735;edge=1;font=LOGFONT( h=-13 );z=11};
edit2={cls="edit";left=90;top=556;right=310;bottom=582;edge=1;font=LOGFONT( h=-17;weight=700 );multiline=1;num=1;z=31};
edit3={cls="edit";left=71;top=553;right=326;bottom=579;edge=1;font=LOGFONT( h=-17;weight=700 );z=44};
groupbox={cls="groupbox";left=70;top=376;right=327;bottom=707;acceptfiles=1;edge=1;z=46};
listview1={cls="listview";left=71;top=394;right=329;bottom=710;ah=1;aw=1;bgcolor=16711680;border=1;edge=1;frame=1;fullRow=1;gridLines=1;hscroll=1;msel=false;vscroll=1;z=5};
listview2={cls="listview";left=71;top=393;right=329;bottom=709;ah=1;aw=1;bgcolor=16711680;border=1;edge=1;frame=1;fullRow=1;gridLines=1;hscroll=1;msel=false;vscroll=1;z=6};
picturebox={cls="picturebox";left=84;top=154;right=162;bottom=258;acceptfiles=1;border=1;edge=1;z=1};
picturebox10={cls="picturebox";left=75;top=309;right=98;bottom=332;notify=1;z=19};
picturebox11={cls="picturebox";left=228;top=801;right=278;bottom=823;notify=1;z=20};
picturebox12={cls="picturebox";left=288;top=801;right=338;bottom=823;notify=1;z=21};
picturebox13={cls="picturebox";left=221;top=745;right=311;bottom=767;notify=1;z=22};
picturebox14={cls="picturebox";left=221;top=719;right=311;bottom=741;notify=1;z=12};
picturebox15={cls="picturebox";left=77;top=719;right=119;bottom=767;notify=1;z=25};
picturebox16={cls="picturebox";left=124;top=719;right=166;bottom=767;notify=1;z=26};
picturebox17={cls="picturebox";left=171;top=719;right=213;bottom=767;notify=1;z=27};
picturebox18={cls="picturebox";left=71;top=457;right=170;bottom=638;z=34};
picturebox19={cls="picturebox";left=96;top=541;right=148;bottom=593;border=1;z=40};
picturebox2={cls="picturebox";left=91;top=320;right=186;bottom=429;notify=1;z=9};
picturebox3={cls="picturebox";left=208;top=320;right=303;bottom=429;notify=1;z=13};
picturebox4={cls="picturebox";left=91;top=443;right=186;bottom=552;notify=1;z=14};
picturebox5={cls="picturebox";left=208;top=443;right=303;bottom=552;notify=1;z=15};
picturebox6={cls="picturebox";left=91;top=566;right=186;bottom=675;notify=1;z=16};
picturebox7={cls="picturebox";left=208;top=566;right=303;bottom=675;notify=1;z=17};
picturebox8={cls="picturebox";left=92;top=745;right=182;bottom=767;notify=1;z=28};
picturebox9={cls="picturebox";left=75;top=283;right=98;bottom=306;z=18};
static={cls="static";left=87;top=115;right=327;bottom=140;align="center";center=1;color=16777215;font=LOGFONT( h=-15 );transparent=1;z=24};
static1={cls="static";text="static1";left=170;top=193;right=316;bottom=212;center=1;color=16777215;font=LOGFONT( h=-17;weight=700 );transparent=1;z=2};
static10={cls="static";text="Button color:";left=176;top=582;right=326;bottom=607;center=1;color=16777215;font=LOGFONT( h=-20;weight=700 );transparent=1;z=38};
static11={cls="static";text="Rroup Name:";left=71;top=458;right=221;bottom=483;center=1;color=16777215;font=LOGFONT( h=-20;weight=700 );transparent=1;z=41};
static12={cls="static";text="New group name:";left=71;top=519;right=289;bottom=544;center=1;color=16777215;font=LOGFONT( h=-20;weight=700 );transparent=1;z=43};
static13={cls="static";left=80;top=397;right=323;bottom=708;color=16777215;font=LOGFONT( h=-17;weight=700 );transparent=1;z=47};
static15={cls="static";text="Group name:";left=69;top=316;right=255;bottom=341;center=1;color=16777215;font=LOGFONT( h=-20;weight=700 );transparent=1;z=49};
static2={cls="static";text="static2";left=171;top=216;right=332;bottom=235;center=1;color=16777215;font=LOGFONT( h=-17;weight=700 );transparent=1;z=3};
static3={cls="static";text="static3";left=171;top=239;right=316;bottom=258;center=1;color=16777215;font=LOGFONT( h=-17;weight=700 );transparent=1;z=4};
static4={cls="static";text="static4";left=80;top=262;right=333;bottom=281;center=1;color=16777215;font=LOGFONT( h=-15;weight=700 );transparent=1;z=7};
static5={cls="static";text="static5";left=100;top=283;right=327;bottom=308;center=1;color=16777215;font=LOGFONT( h=-20;weight=700 );transparent=1;z=8};
static6={cls="static";text="static6";left=99;top=310;right=326;bottom=335;center=1;color=16777215;font=LOGFONT( h=-20;weight=700 );transparent=1;z=10};
static8={cls="static";text="Color Item:";left=176;top=461;right=326;bottom=486;center=1;color=16777215;font=LOGFONT( h=-20;weight=700 );transparent=1;z=33};
static9={cls="static";text="Mainboard:";left=176;top=523;right=326;bottom=548;center=1;color=16777215;font=LOGFONT( h=-20;weight=700 );transparent=1;z=36}
)
/*}}*/

}
if y<769 {
fsys.copy(dirpath+"\SYSTEMCOLOR\370X740\MAIN-BLACK.bmp",dirpath+"\SYSTEMCOLOR\BLACK\MAIN.bmp")
fsys.copy(dirpath+"\SYSTEMCOLOR\370X740\MAIN-BLUE.bmp",dirpath+"\SYSTEMCOLOR\BLUE\MAIN.bmp")
fsys.copy(dirpath+"\SYSTEMCOLOR\370X740\MAIN-GOLD.bmp",dirpath+"\SYSTEMCOLOR\GOLD\MAIN.bmp")
fsys.copy(dirpath+"\SYSTEMCOLOR\370X740\MAIN-GREEN.bmp",dirpath+"\SYSTEMCOLOR\GREEN\MAIN.bmp")
fsys.copy(dirpath+"\SYSTEMCOLOR\370X740\MAIN-PURPLE.bmp",dirpath+"\SYSTEMCOLOR\PURPLE\MAIN.bmp")
fsys.copy(dirpath+"\SYSTEMCOLOR\370X740\MAIN-RED.bmp",dirpath+"\SYSTEMCOLOR\RED\MAIN.bmp")
fsys.copy(dirpath+"\SYSTEMCOLOR\370X740\MAIN-STEEL.bmp",dirpath+"\SYSTEMCOLOR\STEEL\MAIN.bmp")
/*DSG{{*/
mainForm = ..win.form( bgcolor=2501148;bottom=740;parent=...;right=370;border="none";text="AAuto Form" )
mainForm.add( 
picturebox10={ bottom=303;right=85;left=62;top=280;z=19;notify=1;cls="picturebox" };
picturebox2={ bottom=377;right=175;left=80;top=268;z=9;notify=1;cls="picturebox" };
static4={ bottom=255;color=16777215;right=320;left=67;top=236;font=LOGFONT( h=-13;weight=700 );center=1;transparent=1;text="static4";z=7;cls="static" };
static3={ bottom=235;color=16777215;right=318;left=158;top=216;font=LOGFONT( h=-15;weight=700 );center=1;transparent=1;text="static3";z=4;cls="static" };
picturebox16={ bottom=674;right=157;left=115;top=626;z=26;notify=1;cls="picturebox" };
groupbox={ bottom=622;right=310;left=61;top=354;acceptfiles=1;z=46;edge=1;cls="groupbox" };
picturebox12={ bottom=722;right=317;left=267;top=700;z=21;notify=1;cls="picturebox" };
edit={ bottom=647;color=0;right=317;left=60;top=627;font=LOGFONT( h=-13 );z=11;edge=1;cls="edit" };
static9={ bottom=459;color=16777215;right=313;left=163;top=434;font=LOGFONT( h=-18;weight=700 );center=1;transparent=1;text="Mainboard:";z=36;cls="static" };
static={ bottom=120;align="center";right=311;left=71;top=95;font=LOGFONT( h=-15 );center=1;transparent=1;color=16777215;z=24;cls="static" };
picturebox4={ bottom=500;right=175;left=80;top=391;z=14;notify=1;cls="picturebox" };
static10={ bottom=518;color=16777215;right=313;left=163;top=493;font=LOGFONT( h=-18;weight=700 );center=1;transparent=1;text="Button color:";z=38;cls="static" };
picturebox8={ bottom=674;right=169;left=79;top=652;z=28;notify=1;cls="picturebox" };
combobox4={ bottom=355;color=0;right=317;left=58;top=335;font=LOGFONT( h=-17;weight=700 );z=32;
items={ "Set Group";"Color Skin" };mode="dropdown";edge=1;cls="combobox" };
static13={ bottom=616;color=16777215;right=304;left=67;top=365;font=LOGFONT( h=-17;weight=700 );z=47;transparent=1;cls="static" };
static12={ notify=1;color=16777215;right=276;left=58;top=430;font=LOGFONT( h=-18;weight=700 );center=1;z=43;transparent=1;bottom=455;text="New group name:";cls="static" };
combobox9={ bottom=276;color=0;right=317;left=60;top=256;font=LOGFONT( h=-15;weight=700 );z=45;
items={ "INPORT EXCEL";"INPORT E-PHONE";"EXPORT TO EXCEL";"EXPORT TO E-PHONE" };mode="dropdown";edge=1;cls="combobox" };
combobox7={ bottom=540;color=0;text="combobox7";left=162;top=520;font=LOGFONT( h=-17;weight=700 );right=316;z=39;
items={  };mode="dropdown";edge=1;cls="combobox" };
combobox3={ bottom=457;color=0;text="combobox3";left=77;top=431;font=LOGFONT( h=-17;weight=700 );right=297;z=30;
items={ "Don't need password";"Use password" };mode="dropdown";edge=1;cls="combobox" };
static11={ bottom=394;color=16777215;right=208;left=58;top=369;font=LOGFONT( h=-18;weight=700 );center=1;transparent=1;text="Group Name:";z=41;cls="static" };
static6={ bottom=306;color=16777215;right=313;left=86;top=281;font=LOGFONT( h=-18;weight=700 );center=1;transparent=1;text="static6";z=10;cls="static" };
picturebox17={ bottom=674;right=204;left=162;top=626;z=27;notify=1;cls="picturebox" };
combobox8={ bottom=419;color=0;right=315;left=58;top=399;font=LOGFONT( h=-17;weight=700 );z=42;
items={  };mode="dropdown";edge=1;cls="combobox" };
combobox10={ bottom=350;color=0;right=316;left=57;top=330;font=LOGFONT( h=-15;weight=700 );z=48;
items={  };mode="dropdown";edge=1;cls="combobox" };
combobox5={ bottom=418;color=0;right=315;left=161;top=398;font=LOGFONT( h=-17;weight=700 );z=35;
items={  };mode="dropdown";edge=1;cls="combobox" };
combobox2={ bottom=353;color=0;text="combobox2";left=59;top=333;font=LOGFONT( h=-13 );right=317;z=29;
items={  };mode="dropdown";edge=1;cls="combobox" };
picturebox6={ bottom=623;right=175;left=80;top=514;z=16;notify=1;cls="picturebox" };
picturebox18={ bottom=549;right=157;left=58;top=368;z=34;notify=1;cls="picturebox" };
edit3={ bottom=490;color=0;right=313;left=58;top=464;font=LOGFONT( h=-17;weight=700 );z=44;edge=1;cls="edit" };
combobox6={ bottom=480;color=0;text="Black Gold";left=162;top=460;font=LOGFONT( h=-17;weight=700 );right=316;z=37;
items={  };mode="dropdown";edge=1;cls="combobox" };
static15={ bottom=330;color=16777215;right=245;left=59;top=305;font=LOGFONT( h=-18;weight=700 );center=1;transparent=1;text="Group name:";z=49;cls="static" };
static2={ bottom=212;color=16777215;right=319;left=158;top=193;font=LOGFONT( h=-15;weight=700 );center=1;transparent=1;text="static2";z=3;cls="static" };
picturebox19={ bottom=504;right=135;border=1;top=452;z=40;left=83;cls="picturebox" };
static1={ bottom=190;color=16777215;right=313;left=157;top=171;font=LOGFONT( h=-15;weight=700 );center=1;transparent=1;text="static1";z=2;cls="static" };
picturebox13={ bottom=674;right=305;left=215;top=652;z=22;notify=1;cls="picturebox" };
picturebox={ bottom=234;right=146;border=1;top=134;acceptfiles=1;z=1;left=71;edge=1;cls="picturebox" };
combobox={ bottom=325;color=0;text="Relative";left=59;top=305;font=LOGFONT( h=-13 );right=317;z=23;
items={  };mode="dropdown";edge=1;cls="combobox" };
static8={ bottom=397;color=16777215;right=313;left=163;top=372;font=LOGFONT( h=-18;weight=700 );center=1;transparent=1;text="Color Item:";z=33;cls="static" };
static5={ bottom=280;color=16777215;right=314;left=87;top=255;font=LOGFONT( h=-18;weight=700 );center=1;transparent=1;text="static5";z=8;cls="static" };
picturebox11={ bottom=722;right=259;left=209;top=700;z=20;notify=1;cls="picturebox" };
picturebox9={ top=255;z=18;bottom=278;right=85;left=62;cls="picturebox" };
listview2={ ah=1;bgcolor=16711680;vscroll=1;right=316;border=1;frame=1;cls="listview";bottom=621;left=61;aw=1;top=332;msel=false;z=6;gridLines=1;hscroll=1;edge=1;fullRow=1 };
listview1={ ah=1;bgcolor=16711680;vscroll=1;right=316;border=1;frame=1;cls="listview";bottom=621;left=61;aw=1;top=332;msel=false;z=5;gridLines=1;hscroll=1;edge=1;fullRow=1 };
picturebox15={ bottom=674;right=110;left=68;top=626;z=25;notify=1;cls="picturebox" };
picturebox14={ bottom=648;right=305;left=215;top=626;z=12;notify=1;cls="picturebox" };
picturebox7={ bottom=623;right=292;left=197;top=514;z=17;notify=1;cls="picturebox" };
edit2={ num=1;bottom=493;color=0;right=297;left=77;multiline=1;top=467;font=LOGFONT( h=-17;weight=700 );z=31;edge=1;cls="edit" };
picturebox5={ bottom=500;right=292;left=197;top=391;z=15;notify=1;cls="picturebox" };
picturebox3={ bottom=377;right=292;left=197;top=268;z=13;notify=1;cls="picturebox" }
)
/*}}*/
}
if y>1000{
fsys.copy(dirpath+"\SYSTEMCOLOR\380X950\MAIN-BLACK.bmp",dirpath+"\SYSTEMCOLOR\BLACK\MAIN.bmp")
fsys.copy(dirpath+"\SYSTEMCOLOR\380X950\MAIN-BLUE.bmp",dirpath+"\SYSTEMCOLOR\BLUE\MAIN.bmp")
fsys.copy(dirpath+"\SYSTEMCOLOR\380X950\MAIN-GOLD.bmp",dirpath+"\SYSTEMCOLOR\GOLD\MAIN.bmp")
fsys.copy(dirpath+"\SYSTEMCOLOR\380X950\MAIN-GREEN.bmp",dirpath+"\SYSTEMCOLOR\GREEN\MAIN.bmp")
fsys.copy(dirpath+"\SYSTEMCOLOR\380X950\MAIN-PURPLE.bmp",dirpath+"\SYSTEMCOLOR\PURPLE\MAIN.bmp")
fsys.copy(dirpath+"\SYSTEMCOLOR\380X950\MAIN-RED.bmp",dirpath+"\SYSTEMCOLOR\RED\MAIN.bmp")
fsys.copy(dirpath+"\SYSTEMCOLOR\380X950\MAIN-STEEL.bmp",dirpath+"\SYSTEMCOLOR\STEEL\MAIN.bmp")
/*DSG{{*/
mainForm = ..win.form( bgcolor=2501148;bottom=950;parent=...;right=380;border="none";text="AAuto Form" )
mainForm.add( 
picturebox10={ notify=1;right=90;left=67;top=317;z=19;bottom=340;cls="picturebox" };
picturebox2={ notify=1;right=180;left=85;top=421;z=9;bottom=530;cls="picturebox" };
listview1={ ah=1;bgcolor=16711680;vscroll=1;right=321;left=66;frame=1;fullRow=1;bottom=812;z=5;cls="listview";top=369;msel=false;aw=1;gridLines=1;hscroll=1;edge=1;border=1 };
static3={ bottom=272;color=16777215;text="static3";left=163;top=253;font=LOGFONT( h=-15;weight=700 );center=1;z=4;right=323;transparent=1;cls="static" };
picturebox={ bottom=271;right=151;border=1;top=171;acceptfiles=1;z=1;left=76;edge=1;cls="picturebox" };
groupbox={ bottom=812;right=319;left=70;top=457;acceptfiles=1;z=46;edge=1;cls="groupbox" };
picturebox12={ notify=1;right=327;left=277;top=896;z=21;bottom=918;cls="picturebox" };
edit={ bottom=839;right=322;left=65;top=819;font=LOGFONT( h=-13 );z=11;edge=1;cls="edit" };
static9={ bottom=508;color=16777215;text="Mainboard:";left=168;top=483;font=LOGFONT( h=-18;weight=700 );center=1;z=36;right=318;transparent=1;cls="static" };
static={ bottom=150;color=16777215;right=312;left=72;top=125;font=LOGFONT( h=-15 );center=1;z=24;align="center";transparent=1;cls="static" };
picturebox4={ notify=1;right=180;left=85;top=553;z=14;bottom=662;cls="picturebox" };
static10={ bottom=571;color=16777215;text="Button color:";left=168;top=546;font=LOGFONT( h=-18;weight=700 );center=1;z=38;right=318;transparent=1;cls="static" };
picturebox8={ notify=1;right=174;left=84;top=844;z=28;bottom=866;cls="picturebox" };
combobox4={ bottom=392;right=322;left=63;
items={ "Set Group";"Color Skin" };font=LOGFONT( h=-17;weight=700 );z=32;top=372;mode="dropdown";edge=1;cls="combobox" };
static13={ bottom=806;color=16777215;right=314;left=77;top=468;font=LOGFONT( h=-17;weight=700 );z=47;transparent=1;cls="static" };
static12={ notify=1;color=16777215;text="New group name:";left=63;top=467;font=LOGFONT( h=-18;weight=700 );center=1;z=43;transparent=1;bottom=492;right=281;cls="static" };
combobox9={ bottom=313;right=322;left=65;
items={ "INPORT EXCEL";"INPORT E-PHONE";"EXPORT TO EXCEL";"EXPORT TO E-PHONE" };font=LOGFONT( h=-15;weight=700 );z=45;top=293;mode="dropdown";edge=1;cls="combobox" };
combobox2={ bottom=390;text="combobox2";left=64;top=370;font=LOGFONT( h=-13 );right=322;z=29;
items={  };mode="dropdown";edge=1;cls="combobox" };
combobox3={ bottom=494;text="combobox3";left=82;top=468;font=LOGFONT( h=-17;weight=700 );right=302;z=30;
items={ "Don't need password";"Use password" };mode="dropdown";edge=1;cls="combobox" };
static11={ bottom=431;color=16777215;text="Group Name:";left=63;top=406;font=LOGFONT( h=-18;weight=700 );center=1;z=41;right=213;transparent=1;cls="static" };
static6={ bottom=343;color=16777215;text="static6";left=91;top=318;font=LOGFONT( h=-18;weight=700 );center=1;z=10;right=318;transparent=1;cls="static" };
picturebox17={ notify=1;right=209;left=167;top=818;z=27;bottom=866;cls="picturebox" };
combobox6={ bottom=529;text="Black Gold";left=167;top=509;font=LOGFONT( h=-17;weight=700 );right=321;z=37;
items={  };mode="dropdown";edge=1;cls="combobox" };
combobox8={ bottom=457;right=320;left=63;
items={  };font=LOGFONT( h=-17;weight=700 );z=42;top=437;mode="dropdown";edge=1;cls="combobox" };
combobox5={ bottom=458;right=320;left=166;
items={  };font=LOGFONT( h=-17;weight=700 );z=35;top=438;mode="dropdown";edge=1;cls="combobox" };
edit2={ num=1;bottom=530;right=302;left=82;multiline=1;top=504;font=LOGFONT( h=-17;weight=700 );z=31;edge=1;cls="edit" };
static1={ bottom=227;color=16777215;text="static1";left=162;top=208;font=LOGFONT( h=-15;weight=700 );center=1;z=2;right=318;transparent=1;cls="static" };
picturebox18={ notify=1;right=162;left=63;top=421;z=34;bottom=602;cls="picturebox" };
edit3={ bottom=527;right=318;left=63;top=501;font=LOGFONT( h=-17;weight=700 );z=44;edge=1;cls="edit" };
picturebox11={ notify=1;right=269;left=219;top=896;z=20;bottom=918;cls="picturebox" };
picturebox13={ notify=1;right=310;left=220;top=844;z=22;bottom=866;cls="picturebox" };
combobox={ bottom=362;text="Relative";left=64;top=342;font=LOGFONT( h=-13 );right=322;z=23;
items={  };mode="dropdown";edge=1;cls="combobox" };
picturebox19={ bottom=557;right=140;left=88;top=505;z=40;border=1;cls="picturebox" };
combobox10={ bottom=387;right=322;left=62;
items={  };font=LOGFONT( h=-15;weight=700 );z=48;top=367;mode="dropdown";edge=1;cls="combobox" };
picturebox15={ notify=1;right=115;left=73;top=818;z=25;bottom=866;cls="picturebox" };
picturebox16={ notify=1;right=162;left=120;top=818;z=26;bottom=866;cls="picturebox" };
static4={ bottom=292;color=16777215;text="static4";left=72;top=273;font=LOGFONT( h=-13;weight=700 );center=1;z=7;right=325;transparent=1;cls="static" };
static8={ bottom=437;color=16777215;text="Color Item:";left=168;top=412;font=LOGFONT( h=-18;weight=700 );center=1;z=33;right=318;transparent=1;cls="static" };
picturebox5={ notify=1;right=297;left=202;top=553;z=15;bottom=662;cls="picturebox" };
picturebox6={ notify=1;right=180;left=85;top=689;z=16;bottom=798;cls="picturebox" };
picturebox9={ top=292;bottom=315;z=18;right=90;left=67;cls="picturebox" };
listview2={ ah=1;bgcolor=16711680;vscroll=1;right=321;left=66;frame=1;fullRow=1;bottom=812;z=6;cls="listview";top=369;msel=false;aw=1;gridLines=1;hscroll=1;edge=1;border=1 };
static15={ bottom=367;color=16777215;text="Group name:";left=64;top=342;font=LOGFONT( h=-18;weight=700 );center=1;z=49;right=250;transparent=1;cls="static" };
static5={ bottom=317;color=16777215;text="static5";left=92;top=292;font=LOGFONT( h=-18;weight=700 );center=1;z=8;right=319;transparent=1;cls="static" };
picturebox14={ notify=1;right=310;left=220;top=818;z=12;bottom=840;cls="picturebox" };
picturebox7={ notify=1;right=297;left=202;top=689;z=17;bottom=798;cls="picturebox" };
static2={ bottom=249;color=16777215;text="static2";left=163;top=230;font=LOGFONT( h=-15;weight=700 );center=1;z=3;right=324;transparent=1;cls="static" };
combobox7={ bottom=593;text="combobox7";left=167;top=573;font=LOGFONT( h=-17;weight=700 );right=321;z=39;
items={  };mode="dropdown";edge=1;cls="combobox" };
picturebox3={ notify=1;right=297;left=202;top=421;z=13;bottom=530;cls="picturebox" }
)
/*}}*/
}

mainForm.wndproc = function(hwnd,message,wparam,lparam){
	select(message) {//?D?????¢ààDí
	  	case 0x201/*_WM_LBUTTONDOWN êó±ê°′??*/{
		   	mainForm.hitCaption(); //ê1????′°ì??éò?í??ˉ
	  	} 
	}
}

var popbuttom=function(qicture){// 按键跳动效果
	  sleep(50)
	  qicture.left=qicture.left+5
	  qicture.right=qicture.right-5
	  qicture.top=qicture.top+5
	  qicture.bottom=qicture.bottom-5
	  qicture.redraw()
	  sleep(50)
	  qicture.left=qicture.left-5
	  qicture.right=qicture.right+5
	  qicture.top=qicture.top-5
	  qicture.bottom=qicture.bottom+5
	  qicture.redraw()
}
var clearmanu=function(){// 主面板初始设置
	      mainForm.picturebox.image=dirpath+"\SYSTEMCOLOR\Nopic.jpg"
	      mainForm.combobox.hide=1
	      mainForm.combobox2.hide=1
	      for i=2;7;1{mainForm["picturebox"+i].hide=0}
	      for i=1;6;1{mainForm["static"+i].text=""}
	      for i=13;17;1{mainForm["picturebox"+i].hide=1}
	      mainForm.listview1.hide=1	 
	      mainForm.listview2.hide=1 
	      mainForm.picturebox9.hide=1
	      mainForm.picturebox10.hide=1
	      mainForm.picturebox8.hide=1
	      mainForm.edit.hide=1 
     	  mainForm.combobox3.hide=1
	      mainForm.edit2.hide=1
}
var hidesetup=function(){// 隐藏SETUP面板
	  for i=4;8;1{mainForm["combobox"+i].hide=1}
	  for i=8;12;1{mainForm["static"+i].hide=1}
	  mainForm.picturebox18.hide=1
	  mainForm.picturebox19.hide=1
	  mainForm.edit3.hide=1
	  for i=15;17;1{mainForm["picturebox"+i].hide=1}
}
var hideinout=function(t2){// 隐藏INOUT 面板
	  mainForm.combobox9.hide=t2
      mainForm.combobox10.hide=t2
      mainForm.groupbox.hide=t2
      mainForm.static13.hide=t2
      mainForm.static15.hide=t2
      mainForm.picturebox8.hide=t2
      mainForm.picturebox13.hide=t2
      mainForm.static13.text=""
}


var setlist1=function(){//初始LIST1的表头设置
       mainForm.listview1.clear()//清楚原表的内容
	   for i=1;mainForm.listview1.columnCount;1{mainForm.listview1.delColumn(1)}//删除原有表头
	   mainForm.listview1.insertColumn("备注",80,1)
	   mainForm.listview1.insertColumn("家庭地址",80,1)
	   mainForm.listview1.insertColumn("公司地址",80,1)
	   mainForm.listview1.insertColumn("邮箱",60,1)
	   mainForm.listview1.insertColumn("性别",60,1)
	   mainForm.listview1.insertColumn("职务",60,1)
	   mainForm.listview1.insertColumn("座机号码",60,1)
	   mainForm.listview1.insertColumn("手机号码",60,1)
	   mainForm.listview1.insertColumn("公司名称",60,1)
	   mainForm.listview1.insertColumn("英文名称",60,1)
	   mainForm.listview1.insertColumn("中文名称",60,1)
}
var setlist2=function(){//初始LIST2的表头设置   新建项目
         mainForm.listview2.clear()//清楚原表的内容
	     for i=1;mainForm.listview2.columnCount;1{mainForm.listview2.delColumn(1)}//删除原有表头
	     mainForm.listview2.insertColumn("Detail",200,1)
	     mainForm.listview2.insertColumn("Item",60,1)
         mainForm.listview2.addItem({"中文名称";""})
         mainForm.listview2.addItem({"英文名称";""})
         mainForm.listview2.addItem({"公司名称";""})
         mainForm.listview2.addItem({"手机号码";""})
         mainForm.listview2.addItem({"座机号码";""})
         mainForm.listview2.addItem({"职务";""})
         mainForm.listview2.addItem({"性别";""})
         mainForm.listview2.addItem({"邮箱";""})
         mainForm.listview2.addItem({"公司地址";""})
         mainForm.listview2.addItem({"家庭住址";""})
         mainForm.listview2.addItem({"备注";""})
}
var showlist1=function(){
    mainForm.listview1.clear()//清楚原表的内容
    for i=1;6;1{mainForm["static"+i].text=""}
    mainForm.picturebox.image=dirpath+"\SYSTEMCOLOR\Nopic.jpg"
    lnumber=1
    photable=null
    photable={}
	for picnum,fgroup,cname,ename,comname,mnumber,tnumber,post,sex,email,coaddress,faddress,remark in sqlConnection.each( "select * from [phonedata]" ){
	     if fgroup=mainForm.combobox.selText{//find the group menber
	          photable[lnumber]={}
	          photable[lnumber][0]=picnum
	          photable[lnumber][1]=dirpath+"\Photo\"+picnum+".jpg"
	          if cname=null{photable[lnumber][2]=""}else{photable[lnumber][2]=cname}
	          if ename=null{photable[lnumber][3]=""}else{photable[lnumber][3]=ename}
	          if sex=null{photable[lnumber][4]=""}else{photable[lnumber][4]=sex}
	          if comname=null{photable[lnumber][5]=""}else{photable[lnumber][5]=comname}
	          if mnumber=null{photable[lnumber][6]=""}else{photable[lnumber][6]=mnumber}
	          if tnumber=null{photable[lnumber][7]=""}else{photable[lnumber][7]=tnumber}
	          if post=null{photable[lnumber][8]=""}else{photable[lnumber][8]=post}
	          if email=null{photable[lnumber][9]=""}else{photable[lnumber][9]=email}
	          if coaddress=null{photable[lnumber][10]=""}else{photable[lnumber][10]=coaddress}
	          if faddress=null{photable[lnumber][11]=""}else{photable[lnumber][11]=faddress}
	          if remark=null{photable[lnumber][12]=""}else{photable[lnumber][12]=remark}
	          photable[lnumber][13]=fgroup
	          mainForm.listview1.addItem({
	                 photable[lnumber][2];photable[lnumber][3];photable[lnumber][5];
	                 photable[lnumber][6];photable[lnumber][7];photable[lnumber][8];
	                 photable[lnumber][4];photable[lnumber][9];photable[lnumber][10];
	                 photable[lnumber][11];photable[lnumber][12];
	                 })
	          lnumber=lnumber+1
	          }
	     phonecount=lnumber-1
	     }		
}
var drawuseful=function(){
    mainForm.listview1.clear()
	ukey=0//USEFUL成员数目的计数器
	usemenber=null
	usemenber={}
	for usepoint,unum in sqlConnection.each( "select * from [phoneuseful]" ){//将USEFUL里面的所有成员赋值给TABLE
	     ukey=ukey+1;
	     usemenber[ukey]=unum
	     }
	usetable=null;
	usetable={};
	for i=1;ukey;1{
	     for picnum,fgroup,cname,ename,comname,mnumber,tnumber,post,sex,email,coaddress,faddress,remark in sqlConnection.each( "select * from [phonedata]" ){
	     	  if usemenber[i]=picnum{
	     	        usetable[i]={}
	     	        usetable[i][0]=picnum
	                usetable[i][1]=dirpath+"\Photo\"+picnum+".jpg"
	                if cname=null{usetable[i][2]=""}else{usetable[i][2]=cname}
	                if ename=null{usetable[i][3]=""}else{usetable[i][3]=ename}
	                if sex=null{usetable[i][4]=""}else{usetable[i][4]=sex}
	                if comname=null{usetable[i][5]=""}else{usetable[i][5]=comname}
	                if mnumber=null{usetable[i][6]=""}else{usetable[i][6]=mnumber}
	                if tnumber=null{usetable[i][7]=""}else{usetable[i][7]=tnumber}
	                if post=null{usetable[i][8]=""}else{usetable[i][8]=post}
	                if email=null{usetable[i][9]=""}else{usetable[i][9]=email}
	                if coaddress=null{usetable[i][10]=""}else{usetable[i][10]=coaddress}
	                if faddress=null{usetable[i][11]=""}else{usetable[i][11]=faddress}
	                if remark=null{usetable[i][12]=""}else{usetable[i][12]=remark}
	                usetable[i][13]=fgroup
	                mainForm.listview1.addItem({
	                       usetable[i][2];usetable[i][3];usetable[i][5];
	                       usetable[i][6];usetable[i][7];usetable[i][8];
	                       usetable[i][4];usetable[i][9];usetable[i][10];
	                       usetable[i][11];usetable[i][12];
	                       })	  
	     	        }        
	          }
	     }	
}

clearmanu(0)
hidesetup(0)
currentline=0                 
judge="no"

	    import sqlite    
        sqlConnection = sqlite( "\res\fdata.db" )    
        if( not sqlConnection.existsTable( "phonedata" ) ){  
           sqlConnection.exec( "create table phonedata(picnum,fgroup,cname,ename,comname,mnumber,tnumber,post,sex,email,coaddress,faddress,remark);" )  
           sqlConnection.exec( "create table phoneuseful(usepoint,unum);" )//存放常用电话单
           sqlConnection.exec( "create table phonegroup(grouppoint,groupname);" )//存放组名称
           sqlConnection.exec( "create table password(passnum,status,pword);" )//存放密码和颜色
           temple1="1"//定义初始密码
           temple2="CLOSE"
           temple3=""
           sqlConnection.exec( "insert into password values ('"++temple1++"','"++temple2++"','"++temple3++"');")
           temple1="2"//定义初始颜色
           temple2="BLACK"
           temple3="BLACK"
           sqlConnection.exec( "insert into password values ('"++temple1++"','"++temple2++"','"++temple3++"');")
           }
//初始颜色加载

for passnum,status,pword in sqlConnection.each( "select * from [password]" ){
    if passnum="2"{mainpic=status}
    }
fsys.copy(dirpath+"\SYSTEMCOLOR\"+mainpic+"\MAIN.bmp",dirpath+"\SYSTEMCOLOR\MAIN.bmp")

if mainpic="STEEL"{maincolor=10053171;mainForm.bgcolor=10053171}else{maincolor=8355711;mainForm.bgcolor=8355711}
mainForm.transparent(,maincolor)//设置隐藏的颜色



mainForm.image=dirpath+"\SYSTEMCOLOR\MAIN.bmp"  
mainForm.picturebox9.image=dirpath+"\SYSTEMCOLOR\MOBAIL.jpg" 
mainForm.picturebox10.image=dirpath+"\SYSTEMCOLOR\TEL.jpg" 
mainForm.picturebox2.image=dirpath+"\SYSTEMCOLOR\BOOK.jpg" 
mainForm.picturebox3.image=dirpath+"\SYSTEMCOLOR\SETUP.jpg" 
mainForm.picturebox4.image=dirpath+"\SYSTEMCOLOR\SEARCH.jpg" 
mainForm.picturebox5.image=dirpath+"\SYSTEMCOLOR\INOUT.jpg"   
mainForm.picturebox6.image=dirpath+"\SYSTEMCOLOR\USEFUL.jpg" 
mainForm.picturebox7.image=dirpath+"\SYSTEMCOLOR\PASSWORD.jpg" 
mainForm.picturebox8.image=dirpath+"\SYSTEMCOLOR\ENTER.jpg" 
mainForm.picturebox14.image=dirpath+"\SYSTEMCOLOR\ENTER.jpg" 
mainForm.picturebox15.image=dirpath+"\SYSTEMCOLOR\NEW.jpg" 
mainForm.picturebox16.image=dirpath+"\SYSTEMCOLOR\REVISE.jpg"                   
mainForm.picturebox17.image=dirpath+"\SYSTEMCOLOR\DELETE.JPG"  
mainForm.picturebox11.image=dirpath+"\SYSTEMCOLOR\SMALL.jpg" 
mainForm.picturebox12.image=dirpath+"\SYSTEMCOLOR\CLOSE.jpg" 
mainForm.picturebox13.image=dirpath+"\SYSTEMCOLOR\BACK.jpg" 
mainForm.picturebox.image=dirpath+"\SYSTEMCOLOR\Nopic.jpg" 
       
mainForm.combobox.clear();         
for grouppoint,groupname in sqlConnection.each( "select * from [phonegroup]" ){//赋值给组的下拉菜单
        mainForm.combobox.add(groupname)}
mainForm.combobox8.items=mainForm.combobox.items
mainForm.combobox10.items= mainForm.combobox8.items
mainForm.combobox10.add("ALL")
passkey=""
for passnum,status,pword in sqlConnection.each( "select * from [password]" ){
        if status="CLOSE"{passstatus=0;}//无密码
        if status="ON"{passstatus=1;passkey=pword;}//有密码
        }
hideinout(1)
if passstatus=1{//如果有设置密码,就显示密码,隐藏主菜单
       mainForm.edit2.hide=0;
       for i=2;7;1{mainForm["picturebox"+i].hide=1}
       mainForm.picturebox8.hide=0
       mainForm.static.text="请输入密码打开电话簿!"
       }else{mainForm.static.text="欢迎体验 E-Phonebook!"}



// 查出最大的编号
pnum=0
for picnum,fgroup,cname,ename,comname,mnumber,tnumber,post,sex,email,coaddress,faddress,remark in sqlConnection.each( "select * from [phonedata]" ){if tonumber(picnum)>pnum{pnum=tonumber(picnum)}}

mainForm.combobox.oncommand = function(id,event){
	if judge!="new" and judge!="search" and judge!="revise"{
	     if ( event == 0x1/*_CBN_SELCHANGE*/ ){
	          showlist1(0)
	          currentline=0
	          }
	     }		
}
mainForm.combobox4.oncommand = function(id,event){//设置主菜单
	if ( event == 0x1/*_CBN_SELCHANGE*/ ){
	     if mainForm.combobox4.selText="Color Skin"{//选择设置颜色
	           judge="setcolor"
	           hidesetup(0)
	           mainForm.static8.hide=0
	           mainForm.combobox4.hide=0
	           mainForm.combobox5.hide=0//color set
	           mainForm.picturebox18.hide=0
	           mainForm.picturebox19.hide=0
	           mainForm.static.text="请选择肌肤颜色!"
	           mainForm.combobox5.items={"Stainless Steel";"Black Gold";"Blue Lake";"Custom"}
	           } 
	     if mainForm.combobox4.selText="Set Group"{//选择修改群组
	           judge="setgroup"
	           hidesetup(0)
	           mainForm.combobox4.hide=0
	           mainForm.static.text="请选择一个组进行修改!"
	           for i=15;17;1{mainForm["picturebox"+i].hide=0}
	           }
	     }
}
mainForm.combobox5.oncommand = function(id,event){//选择系统颜色
	 if ( event == 0x1/*_CBN_SELCHANGE*/ ){
	      mainForm.static.text=""
	      mainForm.picturebox8.hide=0
	      if mainForm.combobox5.selText="Custom"{
	           mainForm.combobox6.hide=0
	           mainForm.combobox7.hide=0
	           mainForm.static9.hide=0
	           mainForm.static10.hide=0
	           mainForm.combobox6.items={"BLACK";"STEEL";"GREEN";"BLUE";"GOLD";"PURPLE";"RED";}
	           mainForm.combobox7.items={"BLACK";"STEEL";"GREEN";"BLUE";"GOLD";"PURPLE";"RED";}
	           mainForm.combobox6.selText="BLACK"
	           mainForm.combobox7.selText="BLACK"
	           mainForm.picturebox18.image=dirpath+"\SYSTEMCOLOR\BLACK\MAIN.bmp"
	           }else{ 
	              	 mainForm.combobox6.hide=1
	              	 mainForm.combobox7.hide=1
	              	 mainForm.static9.hide=1
	              	 mainForm.static10.hide=1
	               	 if mainForm.combobox5.selText="Stainless Steel"{mainForm.picturebox18.image=dirpath+"\SYSTEMCOLOR\STEEL\MAIN.bmp";mainForm.picturebox19.image=dirpath+"\SYSTEMCOLOR\STEEL\BOOK.jpg"}
	              	 if mainForm.combobox5.selText="Black Gold"{mainForm.picturebox18.image=dirpath+"\SYSTEMCOLOR\BLACK\MAIN.bmp";mainForm.picturebox19.image=dirpath+"\SYSTEMCOLOR\BLACK\BOOK.jpg"}
	               	 if mainForm.combobox5.selText="Blue Lake"{mainForm.picturebox18.image=dirpath+"\SYSTEMCOLOR\BLUE\MAIN.bmp";mainForm.picturebox19.image=dirpath+"\SYSTEMCOLOR\BLUE\BOOK.jpg"}
	                 }
	      }	
}
mainForm.combobox7.oncommand = function(id,event){//button color
	if ( event == 0x1/*_CBN_SELCHANGE*/ ){
	      mainForm.picturebox19.image=dirpath+"\SYSTEMCOLOR\"+mainForm.combobox7.selText+"\BOOK.jpg"
	      }	
}
mainForm.combobox6.oncommand = function(id,event){//show mainboard
	  if ( event == 0x1/*_CBN_SELCHANGE*/ ){
	      mainForm.picturebox18.image=dirpath+"\SYSTEMCOLOR\"+mainForm.combobox6.selText+"\MAIN.bmp"
	      }	
}
mainForm.picturebox4.oncommand = function(id,event){//SEARCH
	popbuttom(mainForm.picturebox4)
	mainForm.static.text="请输入需要搜索的文字!"
	mainForm.edit.hide=0//show edit
	mainForm.edit.text=""
	for i=2;7;1{mainForm["picturebox"+i].hide=1}//隐藏主菜单
	mainForm.listview1.hide=0
	mainForm.listview2.hide=1
	mainForm.listview1.clear()
	mainForm.combobox.hide=0
	mainForm.picturebox9.hide=0
	mainForm.picturebox10.hide=0 
   if y>768 and y<951{mainForm.listview1.top=390}
   if y<768{mainForm.listview1.top=359;}
   if y>950{mainForm.listview1.top=398;} 
	mainForm.combobox2.hide=0//指定搜索的字段
	mainForm.combobox2.items={"ALL";"ChineseName";"EnglishName";"CompanyName";"Mobile";"TEL";"Post";"Sex";"Mail";"CompanyAdd";"HomeAdd";"Remark";}
	mainForm.combobox2.selText="ALL"
	judge="search"
	//mainForm.static.text="Please type in the word to search."
	mainForm.picturebox8.hide=0//search enter 
	mainForm.picturebox13.hide=0//back
	mainForm.combobox.add("ALL")
	mainForm.combobox.selText="ALL"
	setlist1(0)
}
mainForm.picturebox15.oncommand = function(id,event){//NEW BOOK
	popbuttom(mainForm.picturebox15)
	if judge="book"{
	     mainForm.static.text="请输入新联系人资料。"	
	     mainForm.picturebox14.hide=0//enter
	     mainForm.listview1.hide=1
	     mainForm.listview2.hide=0
	     setlist2(0)	
	     judge="new"
	     for i=1;6;1{mainForm["static"+i].text=""}
	     mainForm.picturebox.image=dirpath+"\SYSTEMCOLOR\Nopic.jpg"
	     mainForm.picturebox16.hide=1
	     mainForm.picturebox17.hide=1
	     currentline=0//防止误修改和删除
	     }
	if  judge="setgroup"{
	     mainForm.static.text="请输入新组的名称!"
	     judge="newgroup"
	     mainForm.static12.hide=0
	     mainForm.edit3.hide=0
	     mainForm.picturebox16.hide=1//revise
	     mainForm.picturebox17.hide=1//delete
	     mainForm.picturebox14.hide=0//enter
	     
	     }

}
mainForm.picturebox16.oncommand = function(id,event){//REVISE
	popbuttom(mainForm.picturebox16)
	if judge="book"{
	        mainForm.static.text="请修改联系人信息。"
	     	setlist2(0)
	     	mainForm.picturebox14.hide=0
	     	if currentline!=0{
	              judge="revise"
	              mainForm.listview1.hide=1
	              mainForm.listview2.hide=0
	              mainForm.listview2.clear();
                  mainForm.listview2.addItem({"ChineseName";photable[currentline][2]})
                  mainForm.listview2.addItem({"EnglishName";photable[currentline][3]})
                  mainForm.listview2.addItem({"CompanyName";photable[currentline][5]})
                  mainForm.listview2.addItem({"Mobile";photable[currentline][6]})
                  mainForm.listview2.addItem({"TEL";photable[currentline][7]})
                  mainForm.listview2.addItem({"Post";photable[currentline][8]})
                  mainForm.listview2.addItem({"Sex";photable[currentline][4]})
                  mainForm.listview2.addItem({"Mail";photable[currentline][9]})
                  mainForm.listview2.addItem({"CompanyAdd";photable[currentline][10]})
                  mainForm.listview2.addItem({"HomeAdd";photable[currentline][11]})
                  mainForm.listview2.addItem({"Remark";photable[currentline][12]})
                  mainForm.picturebox15.hide=1
                  mainForm.picturebox17.hide=1
                  if mainForm.editlable{mainForm.editlable.text=mainForm.listview2.getItemText(pos.iItem+1,pos.iSubItem+1);}
	              }else{mainForm.static.text="请先选择一个需要修改的成员!"}
	        }
    if judge="setgroup"{
            mainForm.static.text="请选择一个组进行修改!"
            judge="revisegroup"
            mainForm.static11.hide=0
            mainForm.combobox8.hide=0
            mainForm.static12.hide=0
	        mainForm.edit3.hide=0
	        mainForm.picturebox15.hide=1//new
	        mainForm.picturebox17.hide=1//delete
	        mainForm.picturebox14.hide=0//enter
            }
}
mainForm.picturebox17.oncommand = function(id,event){//DELETE
	popbuttom(mainForm.picturebox17)
	if currentline!=0 and judge="book" {
	     mainForm.static.text=""
	     judge="delete"
	     mainForm.static.text="您确定要删除这个联系人吗?"
	     mainForm.picturebox14.hide=0
	     }else{mainForm.static.text="请选择需要删除的联系人!"}
	if judge="useful" and currentline!=0{//删除USEFUL里的成员
	     sqlConnection.exec( "DELETE FROM phoneuseful WHERE unum='"++usetable[currentline][0]++"' ")
         drawuseful(0)
         mainForm.static.text="已经从常用表中删除该联系人!"
	     }
	if judge="setgroup"{
	     mainForm.static11.hide=0
         mainForm.combobox8.hide=0
         mainForm.static.text="请选择要删除的组."
	     //mainForm.static.text="Please select a group to delete."
	     mainForm.picturebox15.hide=1//new
	     mainForm.picturebox16.hide=1//revise
	     mainForm.picturebox14.hide=0//enter
	     mainForm.edit3.hide=1
	     mainForm.static12.hide=1
	     judge="deletegroup"
	     }
}
mainForm.picturebox3.oncommand = function(id,event){//setup
	popbuttom(mainForm.picturebox3)
	judge="setup"
	mainForm.combobox4.hide=0
	mainForm.picturebox13.hide=0
	mainForm.picturebox14.hide=1
	for i=2;7;1{mainForm["picturebox"+i].hide=1}
	mainForm.static.text="请选择组或者肌肤进行设置。"
}


mainForm.picturebox2.oncommand = function(id,event){//BOOK
	popbuttom(mainForm.picturebox2)
	mainForm.listview2.hide=1
	mainForm.listview1.hide=0
	mainForm.picturebox9.hide=0
	mainForm.picturebox10.hide=0
	judge="book"
   if y>768 and y<951{mainForm.listview1.bottom=710;mainForm.listview1.top=365}
   if y<768{mainForm.listview1.top=332;mainForm.listview1.bottom=621}
   if y>950{mainForm.listview1.top=369;mainForm.listview1.bottom=812}  
		for i=2;7;1{
	    mainForm["picturebox"+i].hide=1
	    }
	mainForm.combobox.hide=0
	mainForm.picturebox13.hide=0
	//set the listview1
    setlist1(0)
	//show the first fgroup menber
	mainForm.combobox.selIndex=1
	showlist1(0)
	for i=15;17;1{mainForm["picturebox"+i].hide=0}
	mainForm.static.text="可以选择不同组查看所有成员。"
}
mainForm.picturebox7.oncommand = function(id,event){//password
	popbuttom(mainForm.picturebox7)
	judge="password"
	mainForm.combobox3.hide=0
	mainForm.picturebox13.hide=0//BACK
    mainForm.picturebox8.hide=0//ENTER
    for i=2;7;1{mainForm["picturebox"+i].hide=1}
    if passstatus=1{mainForm.combobox3.selText="Use password";mainForm.edit2.hide=0;mainForm.edit2.text=passkey} else{mainForm.combobox3.selText="Don't need password";mainForm.edit2.hide=1}     
    mainForm.static.text="请设置密码!"
}
mainForm.picturebox10.oncommand = function(id,event){// 将选中的人员加入到USEFUL列表 
	if judge="book"{
	      popbuttom(mainForm.picturebox10);
	      if currentline!=0{//选择到电话表中的某个成员
	            ukey=1
	            temple2=0
	            for usepoint,unum in sqlConnection.each( "select * from [phoneuseful]" ){//在常用库中查询是否有重复项目
	                  if photable[currentline][0]=unum{ukey=0;mainForm.static.text="请勿重复添加该联系人!"}//如果重复
	                  temple2=usepoint
	                  }
	            if ukey=1{//如果没有重复
	                  temple2=temple2+1
	                  sqlConnection.exec( "insert into phoneuseful values ('"++temple2++"','"++photable[currentline][0]++"');");
	                  mainForm.static.text="成功添加该联系人到常用表."
	                  }
	            }else{mainForm.static.text="请先选择一个联系人进行添加!"}
	      }
	if judge="search"{
	      popbuttom(mainForm.picturebox10);
	      if currentline!=0{//选择到电话表中的某个成员
	            ukey=1
	            temple2=0
	            for usepoint,unum in sqlConnection.each( "select * from [phoneuseful]" ){//在常用库中查询是否有重复项目
	                  if searchtable[currentline][0]=unum{ukey=0;mainForm.static.text="请勿重复添加该联系人!"}//如果重复
	                  temple2=usepoint
	                  }
	            if ukey=1{//如果没有重复
	                  temple2=temple2+1
	                  sqlConnection.exec( "insert into phoneuseful values ('"++temple2++"','"++searchtable[currentline][0]++"');");
	                  mainForm.static.text="成功添加该联系人到常用表!"
	                  }
	            }else{mainForm.static.text="请先选择一个联系人进行添加!"}	      
	      }	
}
mainForm.picturebox6.oncommand = function(id,event){//USEFUL
	popbuttom(mainForm.picturebox6)
	mainForm.listview2.hide=1
	mainForm.listview1.hide=0
   if y>768 and y<951{mainForm.listview1.top=335}
   if y<768{mainForm.listview1.top=359;}
   if y>950{mainForm.listview1.top=345;}
	mainForm.listview1.clear()
	mainForm.picturebox17.hide=0// delete
	mainForm.picturebox13.hide=0//show BACK
	mainForm.picturebox9.hide=0
	mainForm.picturebox10.hide=0
	for i=2;7;1{mainForm["picturebox"+i].hide=1}//隐藏6个主键
	judge="useful"
	setlist1(0)
    drawuseful(0)
    mainForm.static.text="常用成员入列表。"
}


mainForm.picturebox5.oncommand = function(id,event){//in out
	popbuttom(mainForm.picturebox5)
	judge="inout"
	for i=2;7;1{mainForm["picturebox"+i].hide=1}
    hideinout(0)
    mainForm.static15.hide=1
    mainForm.combobox10.hide=1
    mainForm.static.text="请选择输入或输出功能。"
}

mainForm.picturebox14.oncommand = function(id,event){//ENTER
	popbuttom(mainForm.picturebox14)
	if judge="new" and mainForm.combobox.text!=""{
	     //check the new rule
	     newrule="yes"
	     if mainForm.listview2.getItemText(1,2,50)="" and mainForm.listview2.getItemText(2,2,50)=""{newrule="no";mainForm.static.text="请输入新成员名称!"}
	     if mainForm.listview2.getItemText(4,2,50)="" and mainForm.listview2.getItemText(5,2,50)=""{newrule="no";mainForm.static.text="请输入新成员联系方式!"}
	     if newrule="yes"{//输入新的成员
	           pnum=pnum+1;
	          var command = sqlConnection.prepare( "insert into phonedata(picnum,fgroup,cname,ename,comname,mnumber,tnumber,post,sex,email,coaddress,faddress,remark) values(@picnum,@fgroup,@cname,@ename,@comname,@mnumber,@tnumber,@post,@sex,@email,@coaddress,@faddress,@remark);" )  
                    command.bind.parameterByNamesAt( 
                         picnum=tostring(pnum);
                         fsys.copy(dirpath+"\SYSTEMCOLOR\temple.jpg",dirpath+"\Photo\"+tostring(pnum)+".jpg");
                         fgroup=mainForm.combobox.selText;
                         cname=mainForm.listview2.getItemText(1,2,50);
                         ename=mainForm.listview2.getItemText(2,2,50);
                         comname=mainForm.listview2.getItemText(3,2,50);
                         mnumber=mainForm.listview2.getItemText(4,2,50);
                         tnumber=mainForm.listview2.getItemText(5,2,50);
                         post=mainForm.listview2.getItemText(6,2,50);
                         sex=mainForm.listview2.getItemText(7,2,50);
                         email=mainForm.listview2.getItemText(8,2,50);
                         coaddress=mainForm.listview2.getItemText(9,2,50);
                         faddress=mainForm.listview2.getItemText(10,2,50);
                         remark=mainForm.listview2.getItemText(11,2,100) 
                         ).step();  
                    command.finalize() 
                    mainForm.picturebox.image=dirpath+"\SYSTEMCOLOR\Nopic.jpg"
                    fsys.copy(dirpath+"\SYSTEMCOLOR\Nopic.jpg",dirpath+"\SYSTEMCOLOR\temple.jpg")
	            }
	     if newrule="yes"{mainForm.static.text="成功添加新联系人!";setlist2(0);}
	     }
	if judge="revise"{
	     //check the revise rule
	     reviserule="yes"
	     if mainForm.listview2.getItemText(1,2,50)="" and mainForm.listview2.getItemText(2,2,50)=""{reviserule="no";mainForm.static.text="请输入新成员的名称!"}
	     if mainForm.listview2.getItemText(4,2,50)="" and mainForm.listview2.getItemText(5,2,50)=""{reviserule="no";mainForm.static.text="请输入新成员的联系方式!"}
	     if reviserule="yes"{//更新数据
	           mainForm.listview2.setItemText(mainForm.editlable.text,mainForm.listview2.prepos.iItem+1,mainForm.listview2.prepos.iSubItem+1);
	           fsys.copy(currentpic,photable[currentline][1]);
	           sqlConnection.exec("UPDATE phonedata SET 
	                fgroup='"++mainForm.combobox.selText++"',cname='"++mainForm.listview2.getItemText(1,2,50)++"',
	                ename='"++mainForm.listview2.getItemText(2,2,50)++"',comname='"++mainForm.listview2.getItemText(3,2,50)++"',
	                mnumber='"++mainForm.listview2.getItemText(4,2,50)++"',tnumber='"++mainForm.listview2.getItemText(5,2,50)++"',
	                post='"++mainForm.listview2.getItemText(6,2,50)++"',sex='"++mainForm.listview2.getItemText(7,2,50)++"',
	                email='"++mainForm.listview2.getItemText(8,2,50)++"',coaddress='"++mainForm.listview2.getItemText(9,2,50)++"',
	                faddress='"++mainForm.listview2.getItemText(10,2,50)++"',remark=='"++mainForm.listview2.getItemText(11,2,50)++"' WHERE picnum = '"++photable[currentline][0]++"' ");
                    mainForm.picturebox.image=dirpath+"\SYSTEMCOLOR\Nopic.jpg";
                    fsys.copy(dirpath+"\SYSTEMCOLOR\Nopic.jpg",dirpath+"\SYSTEMCOLOR\temple.jpg")  
	            }
	     if reviserule="yes"{//更新数据后,返回到LIST1
	            mainForm.static.text="成功更新数据!";
	            mainForm.listview2.hide=1;
	            mainForm.listview1.hide=0;
	            showlist1(0);
	            judge="book";
	            mainForm.picturebox15.hide=0;
	            mainForm.picturebox16.hide=0;
	            mainForm.picturebox17.hide=0;
	            mainForm.editlable.text=""
	            }	     
	     }
	if judge="delete"{
	     sqlConnection.exec( "DELETE FROM phonedata WHERE picnum = '"++photable[currentline][0]++"' ")
	     mainForm.static.text="成功删除该联系人!";
	     showlist1(0);
	     judge="book";
	     mainForm.picturebox15.hide=0;
	     mainForm.picturebox16.hide=0;
	     mainForm.picturebox17.hide=0;
	     mainForm.picturebox14.hide=1;//隐藏ENTER键
	     }	
	currentline=0;
	if judge="newgroup"{//新建组
	     if mainForm.edit3.text=""{mainForm.static.text="请输入新组名称!"}
	     if mainForm.edit3.text!=""{  //phonegroup(groupname)
	           temple2="yes"
	           temple3=0
	           for grouppoint,groupname in sqlConnection.each( "select * from [phonegroup]" ){//检查是否有重复的GROUP
	                if mainForm.edit3.text=groupname or string.lower(mainForm.edit3.text)=string.lower(groupname){temple2="no"}
	                temple3=grouppoint
	                }
	           if temple2="yes"{//写入新的GROUP
	                temple3=temple3+1
	                sqlConnection.exec( "insert into phonegroup values ('"++temple3++"','"++mainForm.edit3.text++"');")
	                mainForm.static.text="新组已经生成."
	                mainForm.edit3.text=""
	                mainForm.combobox.clear();         
                    for grouppoint,groupname in sqlConnection.each( "select * from [phonegroup]" ){mainForm.combobox.add(groupname)}
	                mainForm.combobox8.items=mainForm.combobox.items
	                mainForm.combobox8.selIndex=0
	                mainForm.combobox10.items= mainForm.combobox8.items
                    mainForm.combobox10.add("ALL")
	                }
	           }
	     }
	if judge="revisegroup"{//修改组
	     if mainForm.edit3.text=""{mainForm.static.text="请输入新的组名!"}
	     if mainForm.edit3.text!=""{ 
	           temple2="yes"//
	           for grouppoint,groupname in sqlConnection.each( "select * from [phonegroup]" ){//检查是否有重复的GROUP
	                if mainForm.edit3.text=groupname or string.lower(mainForm.edit3.text)=string.lower(groupname){temple2="no";mainForm.static.text="组名重复,请更换!"}
	                if mainForm.combobox8.selText=groupname{temple3=grouppoint}//找到当前修改GROUP的位置点
	                }
	           if temple2="yes"{//写入新的GROUP
	               // 需要先将PHONE表格和USEFUL里的名称改过来
	                temtable=null
	                temtable={}
                    temnum=1
	                for picnum,fgroup,cname,ename,comname,mnumber,tnumber,post,sex,email,coaddress,faddress,remark in sqlConnection.each( "select * from [phonedata]" ){
	                      if fgroup=mainForm.combobox8.selText{
	                            temtable[temnum]=picnum
	                            temnum=temnum+1
	                            }
	                      }
	                if temnum!=1{//找到需要修改的人员
	                      for i=1;temnum-1;1{
	                           sqlConnection.exec("UPDATE phonedata SET fgroup='"++mainForm.edit3.text++"' WHERE picnum = '"++temtable[i]++"' ");
	                           }
	                      }
                    sqlConnection.exec("UPDATE phonegroup SET groupname='"++mainForm.edit3.text++"' WHERE grouppoint= '"++temple3++"' ");
	                mainForm.static.text="成功更新组名称。"
	                mainForm.edit3.text=""
	                mainForm.combobox.clear();         
                    for grouppoint,groupname in sqlConnection.each( "select * from [phonegroup]" ){mainForm.combobox.add(groupname)}
	                mainForm.combobox8.items=mainForm.combobox.items
	                mainForm.combobox8.selIndex=0
	                mainForm.combobox10.items= mainForm.combobox8.items
                    mainForm.combobox10.add("ALL")
	                }
	           }
	     }
	if judge="deletegroup"{//delete group
	     if win.msgbox("Are you sure that delete whole group:"+mainForm.combobox8.selText+" !","DELETE GROUP",1)=true{
	            sqlConnection.exec( "DELETE FROM phonedata WHERE fgroup = '"++mainForm.combobox8.selText++"' ")
	            sqlConnection.exec( "DELETE FROM phonegroup WHERE groupname = '"++mainForm.combobox8.selText++"' ")
	            mainForm.static.text="成功删除组:"+mainForm.combobox8.selText+"."
	            mainForm.combobox.clear();         
                for grouppoint,groupname in sqlConnection.each( "select * from [phonegroup]" ){mainForm.combobox.add(groupname)}
	            mainForm.combobox8.items=mainForm.combobox.items
	            mainForm.combobox8.selIndex=0
	            mainForm.combobox10.items= mainForm.combobox8.items
                mainForm.combobox10.add("ALL")
	            }
	     }
}

mainForm.combobox2.oncommand = function(id,event){//选择搜索的项目
	if ( event == 0x1/*_CBN_SELCHANGE*/ ){
	     mainForm.listview1.clear()
	     mainForm.static.text="请定义搜索的范围!"
	     }	
}


mainForm.picturebox8.oncommand = function(id,event){//enter  search
popbuttom(mainForm.picturebox8)
	if judge="search"{
	     mainForm.listview1.clear()
	     if mainForm.edit.text=""{mainForm.static.text="请输入搜索文字!"}
	     if mainForm.edit.text!=""{
	           if mainForm.combobox.selText="ALL" and mainForm.combobox2.selText="ALL"{//2?·?×é???÷
	                 searchtable=null//???÷?á1??ˉo?
	                 searchtable={}
	                 searchnum=1//???÷??êy?÷
	                 mainForm.static.text="正在查找,请等待!"
	                 for picnum,fgroup,cname,ename,comname,mnumber,tnumber,post,sex,email,coaddress,faddress,remark in sqlConnection.each( "select * from [phonedata]" ){
	                      find=0
	                      if cname!=null{if string.match(string.lower(cname),string.lower(mainForm.edit.text))=string.lower(mainForm.edit.text){find=1}}
	                      if find=0 and ename!=null{if string.match(string.lower(ename),mainForm.edit.text)=string.lower(mainForm.edit.text){find=1}}
	                      if find=0 and comname!=null{if string.match(string.lower(comname),mainForm.edit.text)=string.lower(mainForm.edit.text){find=1}}
	                      if find=0 and mnumber!=null{if string.match(mnumber,mainForm.edit.text)=mainForm.edit.text{find=1}}
	                      if find=0 and tnumber!=null{if string.match(tnumber,mainForm.edit.text)=mainForm.edit.text{find=1}} 
	                      if find=0 and post!=null{if string.match(post,mainForm.edit.text)=mainForm.edit.text{find=1}}
	                      if find=0 and sex!=null{if string.match(sex,mainForm.edit.text)=mainForm.edit.text{find=1}}
	                      if find=0 and email!=null{if string.match(email,mainForm.edit.text)=mainForm.edit.text{find=1}}
	                      if find=0 and coaddress!=null{if string.match(coaddress,mainForm.edit.text)=mainForm.edit.text{find=1}}
	                      if find=0 and faddress!=null{if string.match(faddress,mainForm.edit.text)=mainForm.edit.text{find=1}}
	                      if find=0 and remark!=null{if string.match(remark,mainForm.edit.text)=mainForm.edit.text{find=1}}
	                      if find=1{//?òμ??¥??????,???ùóD2?êy?3?μ?????÷?á1??ˉo?
	                           searchtable[searchnum]={}
	                           searchtable[searchnum][0]=picnum
	                           searchtable[searchnum][1]=dirpath+"\Photo\"+picnum+".jpg"
	                           if cname=null{searchtable[searchnum][2]=""}else{searchtable[searchnum][2]=cname}
	                           if ename=null{searchtable[searchnum][3]=""}else{searchtable[searchnum][3]=ename}
	                           if sex=null{searchtable[searchnum][4]=""}else{searchtable[searchnum][4]=sex}
	                           if comname=null{searchtable[searchnum][5]=""}else{searchtable[searchnum][5]=comname}
	                           if mnumber=null{searchtable[searchnum][6]=""}else{searchtable[searchnum][6]=mnumber}
	                           if tnumber=null{searchtable[searchnum][7]=""}else{searchtable[searchnum][7]=tnumber}
	                           if post=null{searchtable[searchnum][8]=""}else{searchtable[searchnum][8]=post}
	                           if email=null{searchtable[searchnum][9]=""}else{searchtable[searchnum][9]=email}
	                           if coaddress=null{searchtable[searchnum][10]=""}else{searchtable[searchnum][10]=coaddress}
	                           if faddress=null{searchtable[searchnum][11]=""}else{searchtable[searchnum][11]=faddress}
	                           if remark=null{searchtable[searchnum][12]=""}else{searchtable[searchnum][12]=remark}
	                           searchtable[searchnum][13]=fgroup 
	                           mainForm.listview1.addItem({
	                                 searchtable[searchnum][2];searchtable[searchnum][3];searchtable[searchnum][5];
	                                 searchtable[searchnum][6];searchtable[searchnum][7];searchtable[searchnum][8];
	                                 searchtable[searchnum][4];searchtable[searchnum][9];searchtable[searchnum][10];
	                                 searchtable[searchnum][11];searchtable[searchnum][12];
	                                 })	
	                           searchnum=searchnum+1
	                           }
	                      }
	                 }
	           if mainForm.combobox.selText="ALL" and mainForm.combobox2.selText!="ALL"{//2?·?×é£?μ?ê?·????????÷
	                 searchtable=null//???÷?á1??ˉo?
	                 searchtable={}
	                 searchnum=1//???÷??êy?÷   
	                 for picnum,fgroup,cname,ename,comname,mnumber,tnumber,post,sex,email,coaddress,faddress,remark in sqlConnection.each( "select * from [phonedata]" ){
	                      find=0
	                      if cname!=null and mainForm.combobox2.selText="ChineseName"{if string.match(string.lower(cname),string.lower(mainForm.edit.text))=string.lower(mainForm.edit.text){find=1}}
	                      if find=0 and ename!=null and mainForm.combobox2.selText="EnglishName"{if string.match(ename,mainForm.edit.text)=mainForm.edit.text{find=1}}
	                      if find=0 and comname!=null and mainForm.combobox2.selText="CompanyName"{if string.match(comname,mainForm.edit.text)=mainForm.edit.text{find=1}}
	                      if find=0 and mnumber!=null and mainForm.combobox2.selText="Mobile"{if string.match(mnumber,mainForm.edit.text)=mainForm.edit.text{find=1}}
	                      if find=0 and tnumber!=null and mainForm.combobox2.selText="TEL"{if string.match(tnumber,mainForm.edit.text)=mainForm.edit.text{find=1}} 
	                      if find=0 and post!=null and mainForm.combobox2.selText="Post"{if string.match(post,mainForm.edit.text)=mainForm.edit.text{find=1}}
	                      if find=0 and sex!=null and mainForm.combobox2.selText="Sex"{if string.match(sex,mainForm.edit.text)=mainForm.edit.text{find=1}}
	                      if find=0 and email!=null and mainForm.combobox2.selText="Mail"{if string.match(email,mainForm.edit.text)=mainForm.edit.text{find=1}}
	                      if find=0 and coaddress!=null and mainForm.combobox2.selText="CompanyName"{if string.match(coaddress,mainForm.edit.text)=mainForm.edit.text{find=1}}
	                      if find=0 and faddress!=null and mainForm.combobox2.selText="HomeAdd"{if string.match(faddress,mainForm.edit.text)=mainForm.edit.text{find=1}}
	                      if find=0 and remark!=null and mainForm.combobox2.selText="Remark"{if string.match(remark,mainForm.edit.text)=mainForm.edit.text{find=1}}
	                      if find=1{//?òμ??¥??????,???ùóD2?êy?3?μ?????÷?á1??ˉo?
	                           searchtable[searchnum]={}
	                           searchtable[searchnum][0]=picnum
	                           searchtable[searchnum][1]=dirpath+"\Photo\"+picnum+".jpg"
	                           if cname=null{searchtable[searchnum][2]=""}else{searchtable[searchnum][2]=cname}
	                           if ename=null{searchtable[searchnum][3]=""}else{searchtable[searchnum][3]=ename}
	                           if sex=null{searchtable[searchnum][4]=""}else{searchtable[searchnum][4]=sex}
	                           if comname=null{searchtable[searchnum][5]=""}else{searchtable[searchnum][5]=comname}
	                           if mnumber=null{searchtable[searchnum][6]=""}else{searchtable[searchnum][6]=mnumber}
	                           if tnumber=null{searchtable[searchnum][7]=""}else{searchtable[searchnum][7]=tnumber}
	                           if post=null{searchtable[searchnum][8]=""}else{searchtable[searchnum][8]=post}
	                           if email=null{searchtable[searchnum][9]=""}else{searchtable[searchnum][9]=email}
	                           if coaddress=null{searchtable[searchnum][10]=""}else{searchtable[searchnum][10]=coaddress}
	                           if faddress=null{searchtable[searchnum][11]=""}else{searchtable[searchnum][11]=faddress}
	                           if remark=null{searchtable[searchnum][12]=""}else{searchtable[searchnum][12]=remark}
	                           searchtable[searchnum][13]=fgroup 
	                           mainForm.listview1.addItem({
	                                 searchtable[searchnum][2];searchtable[searchnum][3];searchtable[searchnum][5];
	                                 searchtable[searchnum][6];searchtable[searchnum][7];searchtable[searchnum][8];
	                                 searchtable[searchnum][4];searchtable[searchnum][9];searchtable[searchnum][10];
	                                 searchtable[searchnum][11];searchtable[searchnum][12];
	                                 })	
	                           searchnum=searchnum+1
	                           }
	                      }
	                 }
	           if mainForm.combobox.selText!="ALL" and mainForm.combobox2.selText="ALL"{
	                 searchtable=null//???÷?á1??ˉo?
	                 searchtable={}
	                 searchnum=1//???÷??êy?÷   
	                 for picnum,fgroup,cname,ename,comname,mnumber,tnumber,post,sex,email,coaddress,faddress,remark in sqlConnection.each( "select * from [phonedata]" ){
	                      find=0
	                      if cname!=null and mainForm.combobox.selText=fgroup{if string.match(string.lower(cname),string.lower(mainForm.edit.text))=string.lower(mainForm.edit.text){find=1}}
	                      if find=0 and ename!=null and mainForm.combobox.selText=fgroup{if string.match(ename,mainForm.edit.text)=mainForm.edit.text{find=1}}
	                      if find=0 and comname!=null and mainForm.combobox.selText=fgroup{if string.match(comname,mainForm.edit.text)=mainForm.edit.text{find=1}}
	                      if find=0 and mnumber!=null and mainForm.combobox.selText=fgroup{if string.match(mnumber,mainForm.edit.text)=mainForm.edit.text{find=1}}
	                      if find=0 and tnumber!=null and mainForm.combobox.selText=fgroup{if string.match(tnumber,mainForm.edit.text)=mainForm.edit.text{find=1}} 
	                      if find=0 and post!=null and mainForm.combobox.selText=fgroup{if string.match(post,mainForm.edit.text)=mainForm.edit.text{find=1}}
	                      if find=0 and sex!=null and mainForm.combobox.selText=fgroup{if string.match(sex,mainForm.edit.text)=mainForm.edit.text{find=1}}
	                      if find=0 and email!=null and mainForm.combobox.selText=fgroup{if string.match(email,mainForm.edit.text)=mainForm.edit.text{find=1}}
	                      if find=0 and coaddress!=null and mainForm.combobox.selText=fgroup{if string.match(coaddress,mainForm.edit.text)=mainForm.edit.text{find=1}}
	                      if find=0 and faddress!=null and mainForm.combobox.selText=fgroup{if string.match(faddress,mainForm.edit.text)=mainForm.edit.text{find=1}}
	                      if find=0 and remark!=null and mainForm.combobox.selText=fgroup{if string.match(remark,mainForm.edit.text)=mainForm.edit.text{find=1}}
	                      if find=1{//?òμ??¥??????,???ùóD2?êy?3?μ?????÷?á1??ˉo?
	                           searchtable[searchnum]={}
	                           searchtable[searchnum][0]=picnum
	                           searchtable[searchnum][1]=dirpath+"\Photo\"+picnum+".jpg"
	                           if cname=null{searchtable[searchnum][2]=""}else{searchtable[searchnum][2]=cname}
	                           if ename=null{searchtable[searchnum][3]=""}else{searchtable[searchnum][3]=ename}
	                           if sex=null{searchtable[searchnum][4]=""}else{searchtable[searchnum][4]=sex}
	                           if comname=null{searchtable[searchnum][5]=""}else{searchtable[searchnum][5]=comname}
	                           if mnumber=null{searchtable[searchnum][6]=""}else{searchtable[searchnum][6]=mnumber}
	                           if tnumber=null{searchtable[searchnum][7]=""}else{searchtable[searchnum][7]=tnumber}
	                           if post=null{searchtable[searchnum][8]=""}else{searchtable[searchnum][8]=post}
	                           if email=null{searchtable[searchnum][9]=""}else{searchtable[searchnum][9]=email}
	                           if coaddress=null{searchtable[searchnum][10]=""}else{searchtable[searchnum][10]=coaddress}
	                           if faddress=null{searchtable[searchnum][11]=""}else{searchtable[searchnum][11]=faddress}
	                           if remark=null{searchtable[searchnum][12]=""}else{searchtable[searchnum][12]=remark}
	                           searchtable[searchnum][13]=fgroup 
	                           mainForm.listview1.addItem({
	                                 searchtable[searchnum][2];searchtable[searchnum][3];searchtable[searchnum][5];
	                                 searchtable[searchnum][6];searchtable[searchnum][7];searchtable[searchnum][8];
	                                 searchtable[searchnum][4];searchtable[searchnum][9];searchtable[searchnum][10];
	                                 searchtable[searchnum][11];searchtable[searchnum][12];
	                                 })	
	                           searchnum=searchnum+1
	                           }
	                      }
	                 }
	           if mainForm.combobox.selText!="ALL" and mainForm.combobox2.selText!="ALL"{
	                 searchtable=null//???÷?á1??ˉo?
	                 searchtable={}
	                 searchnum=1//???÷??êy?÷   
	                 for picnum,fgroup,cname,ename,comname,mnumber,tnumber,post,sex,email,coaddress,faddress,remark in sqlConnection.each( "select * from [phonedata]" ){
	                      find=0
	                      if cname!=null and mainForm.combobox2.selText="ChineseName" and mainForm.combobox.selText=fgroup{if string.match(cname,mainForm.edit.text)=mainForm.edit.text{find=1}}
	                      if find=0 and ename!=null and mainForm.combobox2.selText="EnglishName" and mainForm.combobox.selText=fgroup{if string.match(ename,mainForm.edit.text)=mainForm.edit.text{find=1}}
	                      if find=0 and comname!=null and mainForm.combobox2.selText="CompanyName" and mainForm.combobox.selText=fgroup{if string.match(comname,mainForm.edit.text)=mainForm.edit.text{find=1}}
	                      if find=0 and mnumber!=null and mainForm.combobox2.selText="Mobile" and mainForm.combobox.selText=fgroup{if string.match(mnumber,mainForm.edit.text)=mainForm.edit.text{find=1}}
	                      if find=0 and tnumber!=null and mainForm.combobox2.selText="TEL" and mainForm.combobox.selText=fgroup{if string.match(tnumber,mainForm.edit.text)=mainForm.edit.text{find=1}} 
	                      if find=0 and post!=null and mainForm.combobox2.selText="Post" and mainForm.combobox.selText=fgroup{if string.match(post,mainForm.edit.text)=mainForm.edit.text{find=1}}
	                      if find=0 and sex!=null and mainForm.combobox2.selText="Sex" and mainForm.combobox.selText=fgroup{if string.match(sex,mainForm.edit.text)=mainForm.edit.text{find=1}}
	                      if find=0 and email!=null and mainForm.combobox2.selText="Mail" and mainForm.combobox.selText=fgroup{if string.match(email,mainForm.edit.text)=mainForm.edit.text{find=1}}
	                      if find=0 and coaddress!=null and mainForm.combobox2.selText="CompanyAdd" and mainForm.combobox.selText=fgroup{if string.match(coaddress,mainForm.edit.text)=mainForm.edit.text{find=1}}
	                      if find=0 and faddress!=null and mainForm.combobox2.selText="HomeAdd" and mainForm.combobox.selText=fgroup{if string.match(faddress,mainForm.edit.text)=mainForm.edit.text{find=1}}
	                      if find=0 and remark!=null and mainForm.combobox2.selText="Remark" and mainForm.combobox.selText=fgroup{if string.match(remark,mainForm.edit.text)=mainForm.edit.text{find=1}}
	                      if find=1{//?òμ??¥??????,???ùóD2?êy?3?μ?????÷?á1??ˉo?
	                           searchtable[searchnum]={}
	                           searchtable[searchnum][0]=picnum
	                           searchtable[searchnum][1]=dirpath+"\Photo\"+picnum+".jpg"
	                           if cname=null{searchtable[searchnum][2]=""}else{searchtable[searchnum][2]=cname}
	                           if ename=null{searchtable[searchnum][3]=""}else{searchtable[searchnum][3]=ename}
	                           if sex=null{searchtable[searchnum][4]=""}else{searchtable[searchnum][4]=sex}
	                           if comname=null{searchtable[searchnum][5]=""}else{searchtable[searchnum][5]=comname}
	                           if mnumber=null{searchtable[searchnum][6]=""}else{searchtable[searchnum][6]=mnumber}
	                           if tnumber=null{searchtable[searchnum][7]=""}else{searchtable[searchnum][7]=tnumber}
	                           if post=null{searchtable[searchnum][8]=""}else{searchtable[searchnum][8]=post}
	                           if email=null{searchtable[searchnum][9]=""}else{searchtable[searchnum][9]=email}
	                           if coaddress=null{searchtable[searchnum][10]=""}else{searchtable[searchnum][10]=coaddress}
	                           if faddress=null{searchtable[searchnum][11]=""}else{searchtable[searchnum][11]=faddress}
	                           if remark=null{searchtable[searchnum][12]=""}else{searchtable[searchnum][12]=remark}
	                           searchtable[searchnum][13]=fgroup 
	                           mainForm.listview1.addItem({
	                                 searchtable[searchnum][2];searchtable[searchnum][3];searchtable[searchnum][5];
	                                 searchtable[searchnum][6];searchtable[searchnum][7];searchtable[searchnum][8];
	                                 searchtable[searchnum][4];searchtable[searchnum][9];searchtable[searchnum][10];
	                                 searchtable[searchnum][11];searchtable[searchnum][12];
	                                 })	
	                           searchnum=searchnum+1
	                           }
	                      }
	                 }
	           mainForm.static.text="完成搜索任务。"
	           }
	     }
	if judge="password"{// ê?·??ó?ü   Don't need password;Use password;Revise password
	     if mainForm.combobox3.selText="Don't need password"{temple1="1";temple2="CLOSE";temple3="*";sqlConnection.exec("UPDATE password SET status = '"++temple2++"',pword = '"++temple3++"' WHERE passnum = '"++temple1++"' ");mainForm.static.text="取消密码设置.";passstatus=0;mainForm.static.text="密码设置生效!"}
	     if mainForm.combobox3.selText="Use password"{
	           if mainForm.edit2.text=""{mainForm.static.text="密码不能为空!"}else{temple1="1";temple2="ON";temple3=mainForm.edit2.text;sqlConnection.exec("UPDATE password SET status = '"++temple2++"',pword = '"++temple3++"' WHERE passnum = '"++temple1++"' ");passstatus=1;passkey=temple3;mainForm.static.text="完成密码设置。"}
	           }
	     //sqlConnection.exec("UPDATE password SET status = '"++temple2++"',pword = '"++temple3++"' WHERE passnum = '"++temple1++"' ")
	     }	
	if judge="no" and mainForm.edit2.text=passkey{
	      mainForm.edit2.hide=1;mainForm.picturebox8.hide=1;
	      for i=2;7;1{mainForm["picturebox"+i].hide=0}
	      mainForm.static.text="欢迎体验E-phonebook!"}
    if judge="setcolor"{
          if mainForm.combobox5.selText="Custom"{
                temple1="2"
                temple2=mainForm.combobox6.selText
                temple3=mainForm.combobox7.selText
                sqlConnection.exec("UPDATE password SET status = '"++temple2++"',pword = '"++temple3++"' WHERE passnum = '"++temple1++"' ")
                fsys.copy(dirpath+"\SYSTEMCOLOR\"+mainForm.combobox6.selText+"\MAIN.bmp",dirpath+"\SYSTEMCOLOR\MAIN.bmp")//dirpath+"\SYSTEMCOLOR\ENTER.jpg"
                fsys.copy(dirpath+"\SYSTEMCOLOR\"+mainForm.combobox7.selText+"\BOOK.jpg",dirpath+"\SYSTEMCOLOR\BOOK.jpg")
                fsys.copy(dirpath+"\SYSTEMCOLOR\"+mainForm.combobox7.selText+"\SEARCH.jpg",dirpath+"\SYSTEMCOLOR\SEARCH.jpg")
                fsys.copy(dirpath+"\SYSTEMCOLOR\"+mainForm.combobox7.selText+"\USEFUL.jpg",dirpath+"\SYSTEMCOLOR\USEFUL.jpg")
                fsys.copy(dirpath+"\SYSTEMCOLOR\"+mainForm.combobox7.selText+"\SETUP.jpg",dirpath+"\SYSTEMCOLOR\SETUP.jpg")
                fsys.copy(dirpath+"\SYSTEMCOLOR\"+mainForm.combobox7.selText+"\INOUT.jpg",dirpath+"\SYSTEMCOLOR\INOUT.jpg")
                fsys.copy(dirpath+"\SYSTEMCOLOR\"+mainForm.combobox7.selText+"\PASSWORD.jpg",dirpath+"\SYSTEMCOLOR\PASSWORD.jpg")
                fsys.copy(dirpath+"\SYSTEMCOLOR\"+mainForm.combobox7.selText+"\NEW.jpg",dirpath+"\SYSTEMCOLOR\NEW.jpg")
                fsys.copy(dirpath+"\SYSTEMCOLOR\"+mainForm.combobox7.selText+"\REVISE.jpg",dirpath+"\SYSTEMCOLOR\REVISE.jpg")
                fsys.copy(dirpath+"\SYSTEMCOLOR\"+mainForm.combobox7.selText+"\DELETE.jpg",dirpath+"\SYSTEMCOLOR\DELETE.jpg")
                fsys.copy(dirpath+"\SYSTEMCOLOR\"+mainForm.combobox7.selText+"\ENTER.jpg",dirpath+"\SYSTEMCOLOR\ENTER.jpg")
                fsys.copy(dirpath+"\SYSTEMCOLOR\"+mainForm.combobox7.selText+"\CLOSE.jpg",dirpath+"\SYSTEMCOLOR\CLOSE.jpg")
                fsys.copy(dirpath+"\SYSTEMCOLOR\"+mainForm.combobox7.selText+"\MOBAIL.jpg",dirpath+"\SYSTEMCOLOR\MOBAIL.jpg")
                fsys.copy(dirpath+"\SYSTEMCOLOR\"+mainForm.combobox7.selText+"\TEL.jpg",dirpath+"\SYSTEMCOLOR\TEL.jpg")
                fsys.copy(dirpath+"\SYSTEMCOLOR\"+mainForm.combobox7.selText+"\BACK.jpg",dirpath+"\SYSTEMCOLOR\BACK.jpg")
                fsys.copy(dirpath+"\SYSTEMCOLOR\"+mainForm.combobox7.selText+"\SMALL.jpg",dirpath+"\SYSTEMCOLOR\SMALL.jpg")
                mainForm.static.text="完成肌肤设置。"
                judge="setup"
                }
          if mainForm.combobox5.selText!="Custom"{
                if mainForm.combobox5.selText="Stainless Steel"{temple2="STEEL"}
                if mainForm.combobox5.selText="Black Gold"{temple2="BLACK"}
                if mainForm.combobox5.selText="Blue Lake"{temple2="BLUE"}
                temple1="2"
                temple3=temple2
                sqlConnection.exec("UPDATE password SET status = '"++temple2++"',pword = '"++temple3++"' WHERE passnum = '"++temple1++"' ")
                fsys.copy(dirpath+"\SYSTEMCOLOR\"+temple2+"\MAIN.bmp",dirpath+"\SYSTEMCOLOR\MAIN.bmp")
                fsys.copy(dirpath+"\SYSTEMCOLOR\"+temple2+"\BOOK.jpg",dirpath+"\SYSTEMCOLOR\BOOK.jpg")
                fsys.copy(dirpath+"\SYSTEMCOLOR\"+temple2+"\SEARCH.jpg",dirpath+"\SYSTEMCOLOR\SEARCH.jpg")
                fsys.copy(dirpath+"\SYSTEMCOLOR\"+temple2+"\USEFUL.jpg",dirpath+"\SYSTEMCOLOR\USEFUL.jpg")
                fsys.copy(dirpath+"\SYSTEMCOLOR\"+temple2+"\SETUP.jpg",dirpath+"\SYSTEMCOLOR\SETUP.jpg")
                fsys.copy(dirpath+"\SYSTEMCOLOR\"+temple2+"\INOUT.jpg",dirpath+"\SYSTEMCOLOR\INOUT.jpg")
                fsys.copy(dirpath+"\SYSTEMCOLOR\"+temple2+"\PASSWORD.jpg",dirpath+"\SYSTEMCOLOR\PASSWORD.jpg")
                fsys.copy(dirpath+"\SYSTEMCOLOR\"+temple2+"\NEW.jpg",dirpath+"\SYSTEMCOLOR\NEW.jpg")
                fsys.copy(dirpath+"\SYSTEMCOLOR\"+temple2+"\REVISE.jpg",dirpath+"\SYSTEMCOLOR\REVISE.jpg")
                fsys.copy(dirpath+"\SYSTEMCOLOR\"+temple2+"\DELETE.jpg",dirpath+"\SYSTEMCOLOR\DELETE.jpg")
                fsys.copy(dirpath+"\SYSTEMCOLOR\"+temple2+"\ENTER.jpg",dirpath+"\SYSTEMCOLOR\ENTER.jpg")
                fsys.copy(dirpath+"\SYSTEMCOLOR\"+temple2+"\CLOSE.jpg",dirpath+"\SYSTEMCOLOR\CLOSE.jpg")
                fsys.copy(dirpath+"\SYSTEMCOLOR\"+temple2+"\MOBAIL.jpg",dirpath+"\SYSTEMCOLOR\MOBAIL.jpg")
                fsys.copy(dirpath+"\SYSTEMCOLOR\"+temple2+"\TEL.jpg",dirpath+"\SYSTEMCOLOR\TEL.jpg")
                fsys.copy(dirpath+"\SYSTEMCOLOR\"+temple2+"\BACK.jpg",dirpath+"\SYSTEMCOLOR\BACK.jpg")
                fsys.copy(dirpath+"\SYSTEMCOLOR\"+temple2+"\SMALL.jpg",dirpath+"\SYSTEMCOLOR\SMALL.jpg")
                mainForm.static.text="完成肌肤设置。"
                }
                mainForm.image=dirpath+"\SYSTEMCOLOR\MAIN.bmp"  
                mainForm.picturebox9.image=dirpath+"\SYSTEMCOLOR\MOBAIL.jpg" 
                mainForm.picturebox10.image=dirpath+"\SYSTEMCOLOR\TEL.jpg" 
                mainForm.picturebox2.image=dirpath+"\SYSTEMCOLOR\BOOK.jpg" 
                mainForm.picturebox3.image=dirpath+"\SYSTEMCOLOR\SETUP.jpg" 
                mainForm.picturebox4.image=dirpath+"\SYSTEMCOLOR\SEARCH.jpg" 
                mainForm.picturebox5.image=dirpath+"\SYSTEMCOLOR\INOUT.jpg"   
                mainForm.picturebox6.image=dirpath+"\SYSTEMCOLOR\USEFUL.jpg" 
                mainForm.picturebox7.image=dirpath+"\SYSTEMCOLOR\PASSWORD.jpg" 
                mainForm.picturebox8.image=dirpath+"\SYSTEMCOLOR\ENTER.jpg" 
                mainForm.picturebox14.image=dirpath+"\SYSTEMCOLOR\ENTER.jpg" 
                mainForm.picturebox15.image=dirpath+"\SYSTEMCOLOR\NEW.jpg" 
                mainForm.picturebox16.image=dirpath+"\SYSTEMCOLOR\REVISE.jpg"                   
                mainForm.picturebox17.image=dirpath+"\SYSTEMCOLOR\DELETE.JPG"  
                mainForm.picturebox11.image=dirpath+"\SYSTEMCOLOR\SMALL.jpg" 
                mainForm.picturebox12.image=dirpath+"\SYSTEMCOLOR\CLOSE.jpg" 
                mainForm.picturebox13.image=dirpath+"\SYSTEMCOLOR\BACK.jpg" 
                mainForm.picturebox.image=dirpath+"\SYSTEMCOLOR\Nopic.jpg" 
                if temple2="STEEL"{maincolor=10053171;mainForm.bgcolor=10053171}else{maincolor=8355711;mainForm.bgcolor=8355711}
                    mainForm.transparent(,maincolor)
                mainForm.redraw()
          }
    if judge="out"{
          if mainForm.combobox9.selText="EXPORT TO EXCEL"{
                mainForm.static13.text="正在导出数据,请勿进行其他操作!"
                     var excel = com.excel() //excel=com.CreateObject("Excel.Application");
                     fsys.delete(dirpath+"/EXPORT")
                     fsys.createDir(dirpath+"/EXPORT")
                     excel.createFile(dirpath+"/EXPORT/E-PHONEBOOK.xlsx") 
                     var book = excel.WorkBooks.Open( dirpath+"\EXPORT\E-PHONEBOOK.xlsx" )
                     fsys.setCurDir(dirpath)
                     excel.visible=ture;
                     excel.DisplayAlerts = False;
                     sheet1 = book.sheets(1);
                     sheet1.UsedRange.clear()
                     outnum=1
                     sheet1.Cells(outnum,1).value2="Group"; 
                     sheet1.Cells(outnum,2).value2="PHOTO";
                     sheet1.Cells(outnum,3).value2="Chinese Name";
                     sheet1.Cells(outnum,4).value2="English Name";
                     sheet1.Cells(outnum,5).value2="Company Name";
                     sheet1.Cells(outnum,6).value2="Mobail Number";
                     sheet1.Cells(outnum,7).value2="Tel Number";
                     sheet1.Cells(outnum,8).value2="Post";
                     sheet1.Cells(outnum,9).value2="Sex";
                     sheet1.Cells(outnum,10).value2="Email";
                     sheet1.Cells(outnum,11).value2="Company Address";
                     sheet1.Cells(outnum,12).value2="Home Address";
                     sheet1.Cells(outnum,13).value2="Remark";
                     outnum=2
                     sheet1.Cells.RowHeight=40//DD??
                     sheet1.Cells.ColumnWidth=16//áD?í
                if mainForm.combobox10.selText="ALL"{
                     fsys.setCurDir(dirpath)
                     for picnum,fgroup,cname,ename,comname,mnumber,tnumber,post,sex,email,coaddress,faddress,remark in sqlConnection.each( "select * from [phonedata]" ){
                          temple9=picnum
                          if fgroup=null{sheet1.Cells(outnum,1).value2=""}else{sheet1.Cells(outnum,1).value2=fgroup}
                          if cname=null{sheet1.Cells(outnum,3).value2=""}else{sheet1.Cells(outnum,3).value2=cname}
                          if ename=null{sheet1.Cells(outnum,4).value2=""}else{sheet1.Cells(outnum,4).value2=ename}
                          if comname=null{sheet1.Cells(outnum,5).value2=""}else{sheet1.Cells(outnum,5).value2=comname}
                          if mnumber=null{sheet1.Cells(outnum,6).value2=""}else{sheet1.Cells(outnum,6).value2=mnumber}
                          if tnumber=null{sheet1.Cells(outnum,7).value2=""}else{sheet1.Cells(outnum,7).value2=tnumber}
                          if post=null{sheet1.Cells(outnum,8).value2=""}else{sheet1.Cells(outnum,8).value2=post}
                          if sex=null{sheet1.Cells(outnum,9).value2=""}else{sheet1.Cells(outnum,9).value2=sex}
                          if email=null{sheet1.Cells(outnum,10).value2=""}else{sheet1.Cells(outnum,10).value2=email}
                          if coaddress=null{sheet1.Cells(outnum,11).value2=""}else{sheet1.Cells(outnum,11).value2=coaddress}
                          if faddress=null{sheet1.Cells(outnum,12).value2=""}else{sheet1.Cells(outnum,12).value2=faddress}
                          if remark=null{sheet1.Cells(outnum,13).value2=""}else{sheet1.Cells(outnum,13).value2=remark}
                          pic=dirpath+"\Photo\"+picnum+".jpg"
                          var sheet1 = excel.ActiveWorkbook.Sheets(1); 
                          sh=sheet1.getPictures().Insert(pic)
                          var row=outnum
                          with sh{
                                 left=sheet1.Range('B'+row).left+1
                                 top=sheet1.Range('B'+row).top+1
                                 width=sheet1.Range('B'+row).width-2
                                 height=sheet1.Range('B'+row).height-2
                                 }
                          outnum=outnum+1
                          }
                    }
                if mainForm.combobox10.selText!="ALL"{
                     fsys.setCurDir(dirpath)
                     for picnum,fgroup,cname,ename,comname,mnumber,tnumber,post,sex,email,coaddress,faddress,remark in sqlConnection.each( "select * from [phonedata]" ){
                          if fgroup=mainForm.combobox10.selText{
                               img=dirpath+"\Photo\"+picnum+".jpg"
                               var sheet1 = excel.ActiveWorkbook.Sheets(1); 
                               sh=sheet1.getPictures().Insert(img);
                               var row=tonumber(outnum)
                               with sh{
                                      left=sheet1.Range('B'+row).left+1
                                      top=sheet1.Range('B'+row).top+1
                                      width=sheet1.Range('B'+row).width-2
                                      height=sheet1.Range('B'+row).height-2
                                      }
                               if fgroup=null{sheet1.Cells(outnum,1).value2=""}else{sheet1.Cells(outnum,1).value2=fgroup}
                               if cname=null{sheet1.Cells(outnum,3).value2=""}else{sheet1.Cells(outnum,3).value2=cname}
                               if ename=null{sheet1.Cells(outnum,4).value2=""}else{sheet1.Cells(outnum,4).value2=ename}
                               if comname=null{sheet1.Cells(outnum,5).value2=""}else{sheet1.Cells(outnum,5).value2=comname}
                               if mnumber=null{sheet1.Cells(outnum,6).value2=""}else{sheet1.Cells(outnum,6).value2=mnumber}
                               if tnumber=null{sheet1.Cells(outnum,7).value2=""}else{sheet1.Cells(outnum,7).value2=tnumber}
                               if post=null{sheet1.Cells(outnum,8).value2=""}else{sheet1.Cells(outnum,8).value2=post}
                               if sex=null{sheet1.Cells(outnum,9).value2=""}else{sheet1.Cells(outnum,9).value2=sex}
                               if email=null{sheet1.Cells(outnum,10).value2=""}else{sheet1.Cells(outnum,10).value2=email}
                               if coaddress=null{sheet1.Cells(outnum,11).value2=""}else{sheet1.Cells(outnum,11).value2=coaddress}
                               if faddress=null{sheet1.Cells(outnum,12).value2=""}else{sheet1.Cells(outnum,12).value2=faddress}
                               if remark=null{sheet1.Cells(outnum,13).value2=""}else{sheet1.Cells(outnum,13).value2=remark}
                               outnum=outnum+1
                               }
                          }                
                    }
                sheet1.UsedRange.WrapText = true
                sheet1.UsedRange.Borders.color=1//?ó±??ò
                sheet1.UsedRange.HorizontalAlignment= -4108 //??±??????ó?D
                sheet1.UsedRange.VerticalAlignment =-4108;  //′1?±?ó?D
                sheet1.Cells.Columns.AutoFit()//×??ˉμ÷??áD?í
                excel.ActiveWorkbook.Save();
                excel.ActiveWorkbook.close();
                mainForm.static.text="";
                mainForm.static13.text="成功导出Phonebook到E-PHONEBOOK.xlsx."
                process.explore(dirpath+"\EXPORT");
                }
        if mainForm.combobox9.selText="EXPORT TO E-PHONE"{
            mainForm.static13.text="正在导出数据,请勿进行其他操作!"
                fsys.delete(dirpath+"/EXPORT")
                fsys.createDir(dirpath+"/EXPORT/E-PHONE")
                fsys.copy("\res\fdata.db",dirpath+"/EXPORT/E-PHONE/E-PHONEBOOK.db")
                fsys.copy("\res\Photo",dirpath+"/EXPORT/E-PHONE\Photo") 
            if mainForm.combobox10.selText!="ALL"{
                outtable=null
                outtable={}
                outnum=0
                for picnum,fgroup,cname,ename,comname,mnumber,tnumber,post,sex,email,coaddress,faddress,remark in sqlConnection.each( "select * from [phonedata]" ){
                     if fgroup!=mainForm.combobox10.selText{
                          outnum=outnum+1
                          outtable[outnum]=picnum                  
                          }
                     if fgroup=mainForm.combobox10.selText{fsys.copy("\res\Photo\"+picnum+".jpg",dirpath+"/EXPORT/E-PHONE\Photo\"+picnum+".jpg")}
                     }
                for i=1;outnum;1{
                     sqlConnection.exec( "DELETE FROM phonedata WHERE picnum = '"++outtable[i]++"' ")
                     }
                }  
            mainForm.static.text="";
            mainForm.static13.text="成功导出Phonebook联系人到EXPORT文件夹。"
            process.explore(dirpath+"\EXPORT\E-PHONE");
            }
       }
    if judge="in" and path!=null{
             if mainForm.combobox9.selText="INPORT EXCEL" and string.lower(path.ext)=".xlsx" or string.lower(path.ext)=".xls"{
                   temple1="yes"//?D??ê?óDóD?óOTHERS×é
                   innum=1
                   for grouppoint,groupname in sqlConnection.each( "select * from [phonegroup]" ){innum=grouppoint+1;if groupname="Others"{temple1="no"} }
                   temple4="Others"
                   if temple1="yes"{sqlConnection.exec( "insert into phonegroup values ('"++innum++"','"++temple4++"');");mainForm.combobox.add("Others")}
                   mainForm.static13.text=""
                   var excel = com.excel(true) 
                   excel.Visible = false 
                   var book1 = excel.WorkBooks.Open(inpath)
                   var sheet1=excel.workbooks(1).sheets(1);
                   for i=1;sheet1.UsedRange.Rows.Count;1{//??±í??à?μ??úèY?3?μ??êy×é
                          temple3="yes"
                          if sheet1.Cells(i,1).Value2=null{infgroup="Others"}else{infgroup=tostring(sheet1.Cells(i,1).Value2)}
                          if sheet1.Cells(i,2).Value2=null and sheet1.Cells(i,3).Value2=null{mainForm.static13.text="联系人名称不能为空!无法导入该成员。"; temple3="no"}else{
                              if sheet1.Cells(i,2).Value2=null{incname=""}else{incname=tostring(sheet1.Cells(i,2).Value2)}
                              if sheet1.Cells(i,3).Value2=null{inename=""}else{inename=tostring(sheet1.Cells(i,3).Value2)}}
                          if sheet1.Cells(i,4).Value2=null{incomname=""}else{incomname=tostring(sheet1.Cells(i,4).Value2)}
                          if sheet1.Cells(i,5).Value2=null and sheet1.Cells(i,6).Value2=null{mainForm.static13.text="联系人联系方式不能为空!无法导入该成员。"; temple3="no"}else{
                              if sheet1.Cells(i,5).Value2=null{inmnumber=""}else{inmnumber=tostring(sheet1.Cells(i,5).Value2)}
                              if sheet1.Cells(i,6).Value2=null{intnumber=""}else{intnumber=tostring(sheet1.Cells(i,6).Value2)}}   
                          //??3yPHONETABLEà????àí?μ?áa??è?
                          for picnum,fgroup,cname,ename,comname,mnumber,tnumber,post,sex,email,coaddress,faddress,remark in sqlConnection.each( "select * from [phonedata]" ){
                              if sheet1.Cells(i,2).Value2=cname and sheet1.Cells(i,3).Value2=ename and sheet1.Cells(i,4).Value2=comname{
                                   temple3="no"
                                   }
                              }
                          if temple3="yes"{
                              mainForm.static13.text="正在导入数据,请勿经行其他的操作!"
                              if sheet1.Cells(i,7).Value2=null{inpost=""}else{inpost=tostring(sheet1.Cells(i,7).Value2)}
                              if sheet1.Cells(i,8).Value2=null{insex=""}else{insex=tostring(sheet1.Cells(i,8).Value2)}
                              if sheet1.Cells(i,9).Value2=null{inemail=""}else{inemail=tostring(sheet1.Cells(i,9).Value2)}
                              if sheet1.Cells(i,10).Value2=null{incoaddress=""}else{incoaddress=tostring(sheet1.Cells(i,10).Value2)}
                              if sheet1.Cells(i,11).Value2=null{infaddress=""}else{infaddress=tostring(sheet1.Cells(i,11).Value2)}
                              if sheet1.Cells(i,12).Value2=null{inremark=""}else{inremark=tostring(sheet1.Cells(i,12).Value2)}
                              pnum=0
                              temple2="yes"//?D??ê?·?óD???′μ?×é
                              innum=0
                              for grouppoint,groupname in sqlConnection.each( "select * from [phonegroup]" ){innum=grouppoint+1;if infgroup=groupname{temple2="no"}}
                              if innum=0{innum=1}
                              if temple2="yes"{sqlConnection.exec( "insert into phonegroup values ('"++innum++"','"++infgroup++"');");
                                    mainForm.combobox.add(infgroup)}
                              //2é?ò×?′óμ?PICNUM
                              pnum=0
                              for picnum,fgroup,cname,ename,comname,mnumber,tnumber,post,sex,email,coaddress,faddress,remark in sqlConnection.each( "select * from [phonedata]" ){if tonumber(picnum)>pnum{pnum=tonumber(picnum)}}
                              tpnum=tostring(pnum+1) 
                              fsys.copy(dirpath+"\SYSTEMCOLOR\Nopic.jpg",dirpath+"\Photo\"+tostring(tpnum)+".jpg");
                              var command = sqlConnection.prepare( "insert into phonedata(picnum,fgroup,cname,ename,comname,mnumber,tnumber,post,sex,email,coaddress,faddress,remark) values(@picnum,@fgroup,@cname,@ename,@comname,@mnumber,@tnumber,@post,@sex,@email,@coaddress,@faddress,@remark);" )  
                              command.bind.parameterByNamesAt( 
                                    picnum=tpnum;
                                    fgroup=infgroup;
                                    cname=incname;
                                    ename=inename;
                                    comname=incomname;
                                    mnumber=inmnumber;
                                    tnumber=intnumber;
                                    post=inpost;
                                    sex=insex;
                                    email=inemail;
                                    coaddress=incoaddress;
                                    faddress=infaddress;
                                    remark=inremark 
                                    ).step();  
                              command.finalize() 
                              mainForm.combobox8.items=mainForm.combobox.items
                              mainForm.combobox10.items= mainForm.combobox8.items
                              mainForm.combobox10.add("ALL")
                              }            
                          }
                   excel.ActiveWorkbook.close();
                   mainForm.static13.text="成功导入文件"+path.file+" ."
                   }
             if mainForm.combobox9.selText="INPORT E-PHONE" and string.lower(path.ext)=".db"{
                   //??FDATAà?μ??ùáa?μè?×êá??3?μ??êy×é
                   oldtable=null
                   oldtable={}
                   oldnum=1//????áa?μè?μ?êyá?
                   maxnum=1//????Dòo?μ?×?′ó?μ
                   for picnum,fgroup,cname,ename,comname,mnumber,tnumber,post,sex,email,coaddress,faddress,remark in sqlConnection.each( "select * from [phonedata]" ){
                        oldtable[oldnum]={}
                        oldtable[oldnum][1]=cname
                        oldtable[oldnum][2]=ename
                        oldtable[oldnum][3]=comname
                        oldnum=oldnum+1
                        if tonumber(picnum)>maxnum{maxnum=tonumber(picnum)}
                        }
                   sqlConnection.close()
                   sqlConnection = sqlite( inpath )
                   temple2="yes"//?ì2éê?·?′??úphonedata±í??
                   if( not sqlConnection.existsTable( "phonedata" ) ){mainForm.static13.text="文件格式不吻合,无法导入!";temple2="no"}
                   if temple2="yes"{
                        mainForm.static13.text="System is exporting data. Please don't select other function!"
                        intable=null
                        intable={}
                        innum=1//????D?áa?μè?μ?êyá?
                        for picnum,fgroup,cname,ename,comname,mnumber,tnumber,post,sex,email,coaddress,faddress,remark in sqlConnection.each( "select * from [phonedata]" ){
                             for i=1;oldnum-1;1{
                                  //??3y?àí?μ?áa?μè?
                                  if oldtable[i][2]=cname and oldtable[i][3]=ename and oldtable[i][5]=comname{}else{
                                      intable[innum]={}
                                      intable[innum][1]=maxnum+1
                                      intable[innum][2]=fgroup
                                      intable[innum][3]=cname
                                      intable[innum][4]=ename
                                      intable[innum][5]=comname
                                      intable[innum][6]=mnumber
                                      intable[innum][7]=tnumber
                                      intable[innum][8]=post
                                      intable[innum][9]=sex
                                      intable[innum][10]=email
                                      intable[innum][11]=coaddress
                                      intable[innum][12]=faddress
                                      intable[innum][13]=remark
                                      innum=innum+1
                                      maxnum=maxnum+1
                                      }
                                  }
                             }
                        }
                        //??μ?è?±í??μ?GROUP??3??3?μ??êy×énewgroup
                        newgroup=null
                        newgroup={}
                        newgroupnum=0
                        for grouppoint,groupname in sqlConnection.each( "select * from [phonegroup]" ){
                              newgroup[newgroupnum]=groupname
                              newgroupnum=newgroupnum+1
                              }
                        sqlConnection.close()
                        sqlConnection = sqlite("\res\fdata.db" )
                        //??D?áa?μè?×¢è?μ?FDATA±í??à?
                        for i=1;innum-1;1{
                              fsys.copy(dirpath+"\SYSTEMCOLOR\Nopic.jpg",dirpath+"\Photo\"+intable[i][1]+".jpg");
                              var command = sqlConnection.prepare( "insert into phonedata(picnum,fgroup,cname,ename,comname,mnumber,tnumber,post,sex,email,coaddress,faddress,remark) values(@picnum,@fgroup,@cname,@ename,@comname,@mnumber,@tnumber,@post,@sex,@email,@coaddress,@faddress,@remark);" )  
                              command.bind.parameterByNamesAt( 
                                    picnum=intable[i][1];
                                    fgroup=intable[i][2];
                                    cname=intable[i][3];
                                    ename=intable[i][4];
                                    comname=intable[i][5];
                                    mnumber=intable[i][6];
                                    tnumber=intable[i][7];
                                    post=intable[i][8];
                                    sex=intable[i][9];
                                    email=intable[i][10];
                                    coaddress=intable[i][11];
                                    faddress=intable[i][12];
                                    remark=intable[i][13] 
                                    ).step();  
                              command.finalize() 
                             }
                        //ìí?óD?×é
                        temple5=1//????GROUP×éμ?×?′óDòo?
                        for grouppoint,groupname in sqlConnection.each( "select * from [phonegroup]" ){if tonumber(grouppoint)>temple5{temple5=tonumber(grouppoint)}}
                        addtable=null
                        addtable={}//·???Dèòaìí?óμ?GROUP
                        addnum=1//????Dèòaìí?óμ?êyá?
                        for grouppoint,groupname in sqlConnection.each( "select * from [phonegroup]" ){
                             for i=1;newgroupnum-1;1{
                                  temple6="yes"//?ì2éê?·?óD???′
                                  if string.lower(groupname)=string.lower(newgroup[i]){temple6="no"}
                                  if temple6="yes"{
                                       addtable[addnum]={}
                                       addtable[addnum][1]=temple5+1
                                       addtable[addnum][2]=newgroup[i]
                                       addnum=addnum+1;temple5=temple5+1
                                       }
                                  }
                             }
                        for i=1;addnum-1;1{
                             sqlConnection.exec( "insert into phonegroup values ('"++addtable[i][1]++"','"++addtable[i][2]++"');")
                             }
                        setlist1(0)
                        mainForm.combobox.clear();         
                        for grouppoint,groupname in sqlConnection.each( "select * from [phonegroup]" ){//?3?μ??×éμ???à-2?μ¥
                            mainForm.combobox.add(groupname)}
                        mainForm.combobox8.items=mainForm.combobox.items
                        mainForm.combobox10.items= mainForm.combobox8.items
                        mainForm.combobox10.add("ALL")
                        mainForm.static13.text="成功导入文件:"+path.file+" ."
                   }
        }   
 }
 mainForm.combobox3.oncommand = function(id,event){//通过是否已经开通密码显示
	if ( event == 0x1/*_CBN_SELCHANGE*/ ){
	     if mainForm.combobox3.selText="Don't need password" {mainForm.edit2.hide=1}else{
	          mainForm.edit2.hide=0;mainForm.edit2.text=passkey;mainForm.static.text="请输入新密码!";}
	     }	
} 
mainForm.picturebox11.oncommand = function(id,event){//small
	popbuttom(mainForm.picturebox11)
	mainForm.hitmin()
	
}

mainForm.picturebox13.oncommand = function(id,event){//BACK
	popbuttom(mainForm.picturebox13)
	if judge="search"{mainForm.combobox.delete(mainForm.combobox.count);clearmanu(0)}
	if judge="new" or judge="revise" or judge="delete"{
	      mainForm.listview2.hide=1;
	      mainForm.listview1.hide=0;
	      mainForm.listview1.top=354
	      showlist1(0);
	      mainForm.picturebox16.hide=0;
	      mainForm.picturebox17.hide=0;
	      mainForm.picturebox15.hide=0;
	      mainForm.picturebox14.hide=1;
	      judge="book";}
	if judge="revise"{mainForm.editlable.text=""}
    if judge="book" or judge="useful"or judge="password"{clearmanu(0)}
	currentline=0 ;
	mainForm.static.text=""
	if judge="setup" or judge="setcolor" or judge="setgroup"{hidesetup(0);judge="no";mainForm.combobox4.selIndex=0;clearmanu(0)}
    if judge="revisegroup" or judge="newgroup" or judge="deletegroup"{
          hidesetup(0)
          mainForm.combobox4.hide=0
	      for i=15;17;1{mainForm["picturebox"+i].hide=0}
	      judge="setgroup"
          }
    if judge="inout" or judge="in" or judge="out"{hideinout(1);for i=2;7;1{mainForm["picturebox"+i].hide=0};judge="no"}
    mainForm.picturebox.image=dirpath+"\SYSTEMCOLOR\Nopic.jpg" 
}
mainForm.picturebox12.oncommand = function(id,event){//close
	popbuttom(mainForm.picturebox12)
	mainForm.close()	
}
 mainForm.groupbox.wndproc = {//photo//
     [0x233/*_WM_DROPFILES*/] = function(hwnd,message,wParam,lParam){
              var infile = win.getDropFile(wParam) 
              inpath=string.join(infile,'\r\n')
              path = io.splitpath(string.join(infile,'\r\n'))
              mainForm.static.text="找到输入文件.";
              } 
 }
mainForm.combobox9.oncommand = function(id,event){//inout  INPORT EXCEL;INPORT E-PHONE;OUTPORT TO EXCEL;
	if ( event == 0x1/*_CBN_SELCHANGE*/ ){
	     if mainForm.combobox9.selText="INPORT EXCEL" or mainForm.combobox9.selText="INPORT E-PHONE"{
	           judge="in"
	           mainForm.static.text="" 
	           mainForm.static15.hide=1
	           mainForm.combobox10.hide=1
	           if mainForm.combobox9.selText="INPORT EXCEL"{mainForm.static13.text="请将需要导入的EXCEL文件拖入此框中! 请注意,EXCEL表格必须包含12列,分别为:组名称, 中文名, 英文名,公司名称, 手机号, 座机号, 职务, 性别, 邮箱, 公司地址, 家庭住址, 备注。 请注意联系人名称和联系方式不能为空。 系统会自动删除重复成员!"}
	           if mainForm.combobox9.selText="INPORT E-PHONE"{mainForm.static13.text="请将需要导入的E-PHONEBOOK文件拖入此框中!"}
	           }
	     if mainForm.combobox9.selText="EXPORT TO EXCEL" or mainForm.combobox9.selText="EXPORT TO E-PHONE"{
	           judge="out"
	           mainForm.static.text="" 
	           mainForm.static15.hide=0
	           mainForm.combobox10.hide=0
	           mainForm.static13.text="可以选择某个组输出也可以输出所以联系人!"
	           mainForm.combobox10.selText="ALL"
	           }
	     }	
}
 mainForm.picturebox.wndproc = {//photo//
     [0x233/*_WM_DROPFILES*/] = function(hwnd,message,wParam,lParam){ 
                if judge="new" or judge="revise"{
                        var photov = string.join(win.getDropFile(wParam),'\r\n') 
                        var thumbnail = gdip.image(photov).getThumbnail(78,104); 
                        thumbnail.save(dirpath+"\SYSTEMCOLOR\temple.jpg",88)
                        photopath= io.splitpath(photov)
                        mainForm.picturebox.image=dirpath+"\SYSTEMCOLOR\temple.jpg"
                        currentpic=dirpath+"\SYSTEMCOLOR\temple.jpg"
                        }

      }
}

  mainForm.listview1.onnotify = function(id,code,ptr){// click menber show pictures
        select(code) {
            case  0xFFFFFF9B/*_LVN_ITEMCHANGED*/ {
                var h = mainForm.listview1.selIndex
                if(h){
                    if judge="book"{
                         mainForm.picturebox.image=photable[h][1]
                         mainForm.static1.text=photable[h][2]
                         mainForm.static2.text=photable[h][3]
                         mainForm.static3.text=photable[h][4]
                         mainForm.static4.text=photable[h][5]
                         mainForm.static5.text=photable[h][6]
                         mainForm.static6.text=photable[h][7]
                         currentline=h
                         currentpic=photable[h][1]}
                     if judge="useful"{
                              mainForm.picturebox.image=usetable[h][1]
                              mainForm.static1.text=usetable[h][2]
                              mainForm.static2.text=usetable[h][3]
                              mainForm.static3.text=usetable[h][4]
                              mainForm.static4.text=usetable[h][5]
                              mainForm.static5.text=usetable[h][6]
                              mainForm.static6.text=usetable[h][7]
                              currentline=h
                              currentpic=usetable[h][1]
                              }
                     if judge="search"{
                              mainForm.picturebox.image=searchtable[h][1]
                              mainForm.static1.text=searchtable[h][2]
                              mainForm.static2.text=searchtable[h][3]
                              mainForm.static3.text=searchtable[h][4]
                              mainForm.static4.text=searchtable[h][5]
                              mainForm.static5.text=searchtable[h][6]
                              mainForm.static6.text=searchtable[h][7]
                              currentline=h
                              currentpic=searchtable[h][1]                          
                              }
                     }  
                }
            case  0xFFFFFF94/*_LVN_COLUMNCLICK*/{
                var nm = mainForm.listview1.getNotifyMessage(code,ptr)
                if judge="book"{
                     sortnum= nm.iSubItem+1
                     if nm.iSubItem=3{sortnum=5}
                     if nm.iSubItem=4{sortnum=6}
                     if nm.iSubItem=5{sortnum=7}
                     if nm.iSubItem=6{sortnum=8}
                     if nm.iSubItem=7{sortnum=4}
                     for i=1;phonecount-1;1{ 
                           sortmax=i
                           temple10=photable[i][sortnum]
                           for t=i+1;phonecount;1{//找出对比列中最小的一行,记录行号
                               if temple10>photable[t][sortnum]{temple10=photable[t][sortnum];sortmax=t}
                               }
                    if sortmax!=i{//如果最小值不为i,将最小行和I行交换
                           for tt=0;12;1{temple10=photable[i][tt];photable[i][tt]=photable[sortmax][tt];photable[sortmax][tt]=temple10}
                           }
                    }
                    mainForm.listview1.clear()
                    for i=1;phonecount;1{
                          mainForm.listview1.addItem({
	                          photable[i][2];photable[i][3];photable[i][5];
	                          photable[i][6];photable[i][7];photable[i][8];
	                          photable[i][4];photable[i][9];photable[i][10];
	                          photable[i][11];photable[i][12];
	                          })
                          }
                     }
                if judge="useful"{
                      sortnum= nm.iSubItem+1
                     if nm.iSubItem=3{sortnum=5}
                     if nm.iSubItem=4{sortnum=6}
                     if nm.iSubItem=5{sortnum=7}
                     if nm.iSubItem=6{sortnum=8}
                     if nm.iSubItem=7{sortnum=4}
                     for i=1;ukey-1;1{ 
                           sortmax=i
                           temple10=usetable[i][sortnum]
                           for t=i+1;ukey;1{//找出对比列中最小的一行,记录行号
                               if temple10>usetable[t][sortnum]{temple10=usetable[t][sortnum];sortmax=t}
                               }
                    if sortmax!=i{//如果最小值不为i,将最小行和I行交换
                           for tt=0;12;1{temple10=usetable[i][tt];usetable[i][tt]=usetable[sortmax][tt];usetable[sortmax][tt]=temple10}
                           }
                    }
                    mainForm.listview1.clear()
                    for i=1;ukey;1{
                          mainForm.listview1.addItem({
	                          usetable[i][2];usetable[i][3];usetable[i][5];
	                          usetable[i][6];usetable[i][7];usetable[i][8];
	                          usetable[i][4];usetable[i][9];usetable[i][10];
	                          usetable[i][11];usetable[i][12];
	                          })
                          }                    
                     }
                if judge="search"{//排序功能
                      sortnum= nm.iSubItem+1
                     if nm.iSubItem=3{sortnum=5}
                     if nm.iSubItem=4{sortnum=6}
                     if nm.iSubItem=5{sortnum=7}
                     if nm.iSubItem=6{sortnum=8}
                     if nm.iSubItem=7{sortnum=4}
                     for i=1;searchnum-2;1{ 
                           sortmax=i
                           temple10=searchtable[i][sortnum]
                           for t=i+1;searchnum-1;1{//找出对比列中最小的一行,记录行号
                               if temple10>searchtable[t][sortnum]{temple10=searchtable[t][sortnum];sortmax=t}
                               }
                    if sortmax!=i{//如果最小值不为i,将最小行和I行交换
                           for tt=0;12;1{temple10=searchtable[i][tt];searchtable[i][tt]=searchtable[sortmax][tt];searchtable[sortmax][tt]=temple10}
                           }
                    }
                    mainForm.listview1.clear()
                    for i=1;searchnum-1;1{
                          mainForm.listview1.addItem({
	                          searchtable[i][2];searchtable[i][3];searchtable[i][5];
	                          searchtable[i][6];searchtable[i][7];searchtable[i][8];
	                          searchtable[i][4];searchtable[i][9];searchtable[i][10];
	                          searchtable[i][11];searchtable[i][12];
	                          })
                          }                    
                     }             
                }
           }
  }

 
mainForm.listview2.onnotify = function(id,code,ptr){
    if(code==0xFFFFFF4B || code==0xFFFFFF4C){// 滚动
        if(!mainForm.editlable || !mainForm.listview2.prepos) return ; 
        pos=mainForm.listview2.prepos;
        rc=mainForm.listview2.getItemRect(pos.iItem+1,pos.iSubItem+1,,2/*_LVIR_LABEL*/)
        if(rc.top<10){
            win.show(mainForm.editlable.hwnd,false);
            return ; 
        }
        rc.top-=3;
        mainForm.editlable.setRect(rc);
        mainForm.listview2.redraw();
        win.show(mainForm.editlable.hwnd,true)
    }
    if(code=0xFFFFFFFE){// 点击
        pos=raw.convert(ptr,win.ui.ctrl.listview.NMLISTVIEW());
        if(pos.iItem<0 || pos.iSubItem<0) return ; 
        rc=mainForm.listview2.getItemRect(pos.iItem+1,pos.iSubItem+1,,2/*_LVIR_LABEL*/)
        if(mainForm.editlable){// 更新edit
            if(mainForm.editlable.modified && mainForm.listview2.prepos){// 输入框内容变化时
                mainForm.listview2.setItemText(mainForm.editlable.text,mainForm.listview2.prepos.iItem+1,mainForm.listview2.prepos.iSubItem+1);
            }
            rc.top-=3;
            mainForm.editlable.text=mainForm.listview2.getItemText(pos.iItem+1,pos.iSubItem+1);
            mainForm.editlable.setRect(rc);
            mainForm.listview2.redraw();
            win.show(mainForm.editlable.hwnd,true);
        }else {// 创建edit
            mainForm.add(
                editlable = { 
                    cls="edit";font=LOGFONT( weight=700 );bottom=rc.bottom;border=1;right=rc.right;left=rc.left;top=rc.top-3;z=1;text=mainForm.listview2.getItemText(pos.iItem+1,pos.iSubItem+1);id=123;autoResize=false}
            )
            // 相应回车键
            mainForm.editlable.wndproc = function(hwnd,message,wParam,lParam){
                if(message == 0x101/*_WM_KEYUP*/ && wParam == 0xD/*_VK_RETURN*/){// 按下了回车键,更新listview数据
                    mainForm.listview2.setItemText(mainForm.editlable.text,mainForm.listview2.prepos.iItem+1,mainForm.listview2.prepos.iSubItem+1);
                    win.show(mainForm.editlable.hwnd,false)
                }
                //无返回值则继续调用默认回调函数
            }
            // 设置父窗口
            win.setParent(mainForm.editlable.hwnd,mainForm.listview2.hwnd);
        }
        mainForm.listview2.prepos=pos;// 记录位置
        win.setFocus(mainForm.editlable.hwnd);// 获取焦点
    }
}

if y>768 and y<1000{win.setPos(mainForm.hwnd,x-387,10)}
if y<769{win.setPos(mainForm.hwnd,x-370,5)}
if y>1000{win.setPos(mainForm.hwnd,x-380,10)}//让窗体显示在屏幕右上角。

mainForm.show() 
win.loopMessage();



本文转载自:http://bbs.aau.cn/forum.php?mod=viewthread&tid=11526&extra=page%3D1

共有 人打赏支持
废柴大叔
粉丝 53
博文 111
码字总数 43127
作品 0
苏州
高级程序员
私信 提问
快手--AAuto Quicker

快手( AAuto开发环境 )下载压缩包仅 6.x MB, 绿色软件解压即用 - 无论个人或企业都可以永久免费使用本软件。快手内置AAuto标准库,以及大量范例全部开源。AAuto用户可以自由使用无需付费,...

qqmmcc
2011/10/06
10K
12
快手AAuto Quicker正式版

快手AAuto——国内优秀的小型软件开发工具,可以直接内崁c和js代码的胶水语言,代码简洁运行效率高,各种自动化操作软件开发的首选 。完美支持静态类型、动态类型,完美支持COM、DLL API、R...

相心的泪
2016/08/10
22
0
使用HPROSE 创建服务端、客户端简明教程

一、创建服务端 以PHP为例,首先下载 hprose-php 下载地址: https://github.com/hprose/hprose-php/archive/master.zip 解压下载的压缩包,您可以在看到以下文件: /hprose-php/README_zh_...

figer1
2014/02/28
11.7K
4
iOS获取一个方法的执行时间

最后在做一个应用的时候,从电话本时读出数据,如果电话很多,就需要比较长的时间,于是如果能得到每个方法的执行时间,就可以知道代码优化的地方。 在网上看到了一个比较好的方法来获取执行...

长平狐
2012/08/13
762
0
mjrao/QtSMSDemo

#信风 ###任务描述: ###一、标题 ###信风 ###二、题目 一个虚拟的短信应用,支持各种短信箱子、支持短信模拟收发、支持短信过滤、支持短信聊天。内嵌简单电话本功能,支持黑白名单。 采用Q...

mjrao
2015/04/05
0
0

没有更多内容

加载失败,请刷新页面

加载更多

C++ vector和list的区别

1.vector数据结构 vector和数组类似,拥有一段连续的内存空间,并且起始地址不变。 因此能高效的进行随机存取,时间复杂度为o(1); 但因为内存空间是连续的,所以在进行插入和删除操作时,会造...

shzwork
今天
4
0
Spring之invokeBeanFactoryPostProcessors详解

Spring的refresh的invokeBeanFactoryPostProcessors,就是调用所有注册的、原始的BeanFactoryPostProcessor。 相关源码 public static void invokeBeanFactoryPostProcessors(Configu......

cregu
昨天
4
0
ibmcom/db2express-c_docker官方使用文档

(DEPRECIATED) Please check DB2 Developer-C Edition for the replacement. What is IBM DB2 Express-C ? ``IBM DB2 Express-C``` is the no-charge community edition of DB2 server, a si......

BG2KNT
昨天
4
0
Ubuntu 18.04.2 LTS nvidia-docker2 : 依赖: docker-ce (= 5:18.09.0~3-0~ubuntu-bionic)

平台:Ubuntu 18.04.2 LTS nvidia-docker2 版本:2.0.3 错误描述:在安装nvidia-docker2的时候报dpkg依赖错误 nvidia-docker2 : 依赖: docker-ce (= 5:18.09.0~3-0~ubuntu-bionic) 先看一下依......

Pulsar-V
昨天
4
0
学习笔记1-goland结构体(struct)

写在前面:若有侵权,请发邮件by.su@qq.com告知。 转载者告知:如果本文被转载,但凡涉及到侵权相关事宜,转载者需负责。请知悉! 本文永久更新地址:https://my.oschina.net/bysu/blog/3036...

不最醉不龟归
昨天
4
0

没有更多内容

加载失败,请刷新页面

加载更多

返回顶部
顶部