diff --git a/programs/cmm/lib/patterns/rgb.h b/programs/cmm/lib/patterns/rgb.h index 073db52b7e..a89955c3e6 100644 --- a/programs/cmm/lib/patterns/rgb.h +++ b/programs/cmm/lib/patterns/rgb.h @@ -10,9 +10,9 @@ :void _rgb::DwordToRgb(dword _dword) { - r = _dword & 0xFF; _dword >>= 8; - g = _dword & 0xFF; _dword >>= 8; b = _dword & 0xFF; _dword >>= 8; + g = _dword & 0xFF; _dword >>= 8; + r = _dword & 0xFF; _dword >>= 8; } :dword _rgb::RgbToDword() diff --git a/programs/cmm/pipet/Tupfile.lua b/programs/cmm/pipet/Tupfile.lua new file mode 100644 index 0000000000..055592ddb1 --- /dev/null +++ b/programs/cmm/pipet/Tupfile.lua @@ -0,0 +1,6 @@ +if tup.getconfig("NO_CMM") ~= "" then return end +if tup.getconfig("LANG") == "ru" +then C_LANG = "LANG_RUS" +else C_LANG = "LANG_ENG" -- this includes default case without config +end +tup.rule("pipet.c", "c-- /D=AUTOBUILD /D=$(C_LANG) %f" .. tup.getconfig("KPACK_CMD"), "pipet.com") diff --git a/programs/cmm/pipet/compile_en.bat b/programs/cmm/pipet/compile_en.bat new file mode 100644 index 0000000000..e35dab9ca1 --- /dev/null +++ b/programs/cmm/pipet/compile_en.bat @@ -0,0 +1,5 @@ +@del pipet.kex +@c-- pipet.c +@rename *.com *.kex +@del warning.txt +@pause \ No newline at end of file diff --git a/programs/cmm/pipet/pipet.c b/programs/cmm/pipet/pipet.c new file mode 100644 index 0000000000..6752af0a10 --- /dev/null +++ b/programs/cmm/pipet/pipet.c @@ -0,0 +1,133 @@ +#define MEMSIZE 4096*10 + +#include "../lib/gui.h" +#include "../lib/clipboard.h" +#include "../lib/patterns/rgb.h" + +//===================================================// +// // +// DATA // +// // +//===================================================// + +proc_info Form; +Clipboard clipboard; +dword pick_active = true; +dword picked_color = 0; +char picked_color_string[10]; +#define FORM_W 167 +#define FORM_H 60 +#define COLOR_BLOCK_SIZE 42 +#define COLOR_BLOCK_PADDING FORM_H - COLOR_BLOCK_SIZE / 2 +#define COLOR_BLOCK_X FORM_W - COLOR_BLOCK_SIZE - COLOR_BLOCK_PADDING +#define BUTTON_ID_CLOSE 1 +#define BUTTON_ID_COPY 2 +#define BUTTON_ID_PICK 3 + +//===================================================// +// // +// CODE // +// // +//===================================================// + +void main() +{ + int btn; + SetEventMask(000100111b); + SetWindowLayerBehaviour(-1, ZPOS_ALWAYS_TOP); + loop() switch(WaitEvent()) + { + case evMouse: + mouse.get(); + + if (mouse.x>0) && (mouse.x0) && (mouse.y