forked from TheMRLL/WinXray
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
125 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,71 +1,55 @@ | ||
//二维码生成工具 | ||
|
||
import win.ui; | ||
import win.ui.atom; | ||
import fonts.fontAwesome; | ||
/*DSG{{*/ | ||
var winform = win.form(text="WinXray - 二维码生成工具";right=730;bottom=678;bgcolor=16777215;border="none";exmode="none";mode="popup") | ||
var winform = win.form(text="二维码生成工具";right=851;bottom=775) | ||
winform.add( | ||
bk={cls="bk";left=-6;top=-2;right=734;bottom=27;bgcolor=12632256;z=10}; | ||
btnQrEnode={cls="plus";text="生成二维码";left=562;top=565;right=694;bottom=595;align="left";bgcolor=14935259;db=1;dr=1;font=LOGFONT(h=-13);iconStyle={align="left";font=LOGFONT(h=-13;name='FontAwesome');padding={left=22}};iconText='\uF1C4';notify=1;textPadding={left=40};z=9}; | ||
editUrl={cls="plus";left=44;top=569;right=537;bottom=594;align="right";bgcolor=16777215;border={bottom=1;color=-8355712};db=1;dl=1;dr=1;editable="edit";font=LOGFONT(h=-16);textPadding={bottom=1};z=8}; | ||
lbErrLevel={cls="static";text=" 0:L 可纠错7%数据码字";left=104;top=656;right=272;bottom=679;db=1;dl=1;transparent=1;z=6}; | ||
lbVersion={cls="static";text="自动选择版本";left=466;top=656;right=672;bottom=679;db=1;dr=1;transparent=1;z=7}; | ||
plus={cls="plus";left=28;top=49;right=708;bottom=522;bgcolor=16777215;db=1;dl=1;dr=1;dt=1;repeat="scale";z=1}; | ||
static={cls="static";text="纠错级别:";left=13;top=624;right=97;bottom=651;align="right";db=1;dl=1;transparent=1;z=3}; | ||
static2={cls="static";text="版本(大小):";left=353;top=624;right=437;bottom=651;align="right";db=1;dl=1;dr=1;transparent=1;z=5}; | ||
static3={cls="static";text="WinXray - 二维码生成工具";left=17;top=4;right=230;bottom=24;color=3947580;transparent=1;z=11}; | ||
tbErrLevel={cls="trackbar";left=96;top=611;right=290;bottom=641;bgcolor=16777215;db=1;dl=1;max=3;min=0;z=2}; | ||
tbVersion={cls="trackbar";left=439;top=611;right=703;bottom=641;bgcolor=16777215;db=1;dr=1;max=40;min=0;z=4} | ||
btnQrEnode={cls="button";text="生成二维码";left=655;top=630;right=797;bottom=672;db=1;dr=1;z=2}; | ||
edit={cls="edit";text="https://www.winxray.com";left=69;top=633;right=622;bottom=670;db=1;dl=1;dr=1;edge=1;multiline=1;z=9}; | ||
lbErrLevel={cls="static";text=" 0:L 可纠错7%数据码字";left=129;top=735;right=297;bottom=758;db=1;dl=1;transparent=1;z=7}; | ||
lbVersion={cls="static";text="自动选择版本";left=491;top=735;right=697;bottom=758;db=1;dl=1;dr=1;transparent=1;z=8}; | ||
plus={cls="plus";left=71;top=50;right=786;bottom=588;db=1;dl=1;dr=1;dt=1;repeat="scale";z=1}; | ||
static={cls="static";text="纠错级别:";left=38;top=703;right=122;bottom=730;align="right";db=1;dl=1;transparent=1;z=4}; | ||
static2={cls="static";text="版本(大小):";left=378;top=703;right=462;bottom=730;align="right";db=1;dl=1;transparent=1;z=6}; | ||
tbErrLevel={cls="trackbar";left=121;top=690;right=315;bottom=720;db=1;dl=1;max=3;min=0;z=3}; | ||
tbVersion={cls="trackbar";left=464;top=690;right=728;bottom=720;db=1;dl=1;dr=1;max=40;min=0;z=5} | ||
) | ||
/*}}*/ | ||
|
||
import style; | ||
winform.btnQrEnode.skin(style.primaryButton); | ||
|
||
winform.tbErrLevel.oncommand = function(id,event,pos){ | ||
if( event == 0x8/*_TB_ENDTRACK*/ ){ | ||
pos = winform.tbErrLevel.pos; | ||
var v = {[0]="L 可纠错7%数据码字";[1]="M 可纠错15%的数据码字";[2]="Q 可纠错25%的数据码字";[3]="H 可纠错30%的数据码字";} | ||
winform.lbErrLevel.text = pos +":"+ v[pos]; | ||
} | ||
if( event == 0x8/*_TB_ENDTRACK*/ ){ | ||
pos = winform.tbErrLevel.pos; | ||
var v = {[0]="L 可纠错7%数据码字";[1]="M 可纠错15%的数据码字";[2]="Q 可纠错25%的数据码字";[3]="H 可纠错30%的数据码字";} | ||
winform.lbErrLevel.text = pos +":"+ v[pos]; | ||
} | ||
} | ||
winform.tbVersion.oncommand = function(id,event,pos){ | ||
if( event == 0x8/*_TB_ENDTRACK*/ ){ | ||
pos = winform.tbVersion.pos; | ||
if(!pos)winform.lbVersion.text = "自动选择版本"; | ||
else { | ||
var width = ((pos-1)*4)+21; | ||
winform.lbVersion.text = string.format("版本:%d 二维码数据大小:%d x %d",pos,width,width ); | ||
} | ||
} | ||
if( event == 0x8/*_TB_ENDTRACK*/ ){ | ||
pos = winform.tbVersion.pos; | ||
if(!pos)winform.lbVersion.text = "自动选择版本"; | ||
else { | ||
var width = ((pos-1)*4)+21; | ||
winform.lbVersion.text = string.format("版本:%d 二维码数据大小:%d x %d",pos,width,width ); | ||
} | ||
} | ||
} | ||
|
||
import win.dlg.message; | ||
import qrencode.bitmap; | ||
winform.btnQrEnode.oncommand = function(id,event){ | ||
if(!#winform.editUrl.text){ | ||
return winform.msgErr("请先输入内容") | ||
} | ||
|
||
winform.plus.hide = true; | ||
var qrBmp = qrencode.bitmap(winform.editUrl.text,winform.tbVersion.pos,winform.tbErrLevel.pos ); | ||
if(!qrBmp){ | ||
return winform.msgErr("请先输入内容") | ||
} | ||
winform.plus.setBackground(qrBmp.copyBitmap(winform.plus.width)); | ||
|
||
winform.plus.hide = false; | ||
winform.plus.redraw() | ||
winform.btnQrEnode.oncommand = function(id,event){ | ||
winform.plus.hide = true; | ||
var qrBmp = qrencode.bitmap(winform.edit.text,winform.tbVersion.pos,winform.tbErrLevel.pos ); | ||
winform.plus.setBackground(qrBmp.copyBitmap(winform.plus.width)); | ||
|
||
winform.plus.hide = false; | ||
winform.plus.redraw() | ||
} | ||
|
||
winform.createQrCode = function(url){ | ||
winform.editUrl.text = url; | ||
winform.edit.text = url; | ||
winform.btnQrEnode.oncommand(); | ||
} | ||
|
||
import win.ui.simpleWindow2; | ||
win.ui.simpleWindow2(winform); | ||
|
||
winform.show() | ||
win.loopMessage(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
{ | ||
"description":"在最小化图标右键栏添加扫一扫导入节点功能,以及完善了一下导入SS节点规则!", | ||
"description":"右键添加了清除重复节点功能!完善了二维码生成器代码!", | ||
"format":".lzma", | ||
"main":"\\WinXray.exe", | ||
"updater":"\\WinXray.exe", | ||
"url":"https://raw.githubusercontent.com/TheMRLL/winxray/main/release/update/", | ||
"version":"3.8" | ||
"version":"3.9" | ||
} |
Binary file not shown.