Register | Login
Forum Index > Samples > Simple window in KolibriOS
Author Message
Pages: 1
Admin
Site Admin

avatar

(send private message)

Posts: 933
Topics: 55

Location:
OverHertz Studio
[1445] Simple window in KolibriOS - posted: 2015-01-09 23:09:50
The latest Ziron linker plugin supports KolibriOS executables. A sample app (code provided by 0CodErr)

Code:
program KOLIBRI32 'sample';
 
#include 'kolibrios.zir';
                
const MY_WIN_STYLE = WS_CAPTION or WS_COORD_CLIENT or WS_SKINNED_SIZABLE or WS_FILL_GRADIENT or 0x00C00DEE;                  
const MY_EVENT_MASK = EM_REDRAW or EM_BUTTON;                  

dword Width,Height,Left,Top;
  
SetEventMask(MY_EVENT_MASK);
  
// calculate left, top, width, height:
edx = GetScreenSize();
edx >> 17;
and eax, 0xFFFF;
eax >> 1;
Height = eax;
eax >> 1;
Top  = eax;  
Width  = edx;
edx >> 1;
Left = edx;

repeat {
  RedrawStart();
  DrawWindow(Left, Width, Top, Height, MY_WIN_STYLE, 'Hello from Ziron :)');  
  RedrawFinish();
  
  eax = WaitEvent();
} until (eax != 1);
  
ThreadTerminate();




Download Ziron
Get free hosting for Ziron related fan-sites and Ziron projects, contact me in private message.
0CodErr
Ziron Guru
(send private message)

Posts: 199
Topics: 37

Location:
[1456] - posted: 2015-01-14 15:27:22
Currently in 'kolibrios\\macros.zir' macro "DrawWindow" expects 7 params. But in this example only 6. Need update i think.
Admin
Site Admin

avatar

(send private message)

Posts: 933
Topics: 55

Location:
OverHertz Studio
[1457] - posted: 2015-01-14 16:23:19
Yes, latest release I added the additional parameter you suggested in PM.

update line:

Code:
  DrawWindow(Left, Width, Top, Height, MY_WIN_STYLE, 'Hello from Ziron :)'); 


to

Code:
  DrawWindow(Left, Width, Top, Height, MY_WIN_STYLE, 'Hello from Ziron :)', CAPTION_MOVABLE); 


The kolibrios include was just a test, I will need to look at the API guide for kolibri to start writing full include files.

Just a quick question, in Kolibri, which registered are treated as volatile? (Which need to be protected on function calls etc)

Download Ziron
Get free hosting for Ziron related fan-sites and Ziron projects, contact me in private message.
0CodErr
Ziron Guru
(send private message)

Posts: 199
Topics: 37

Location:
[1459] - posted: 2015-01-14 16:33:46
Just a quick question, in Kolibri, which registered are treated as volatile? (Which need to be protected on function calls etc)
Emm.. did you mean calling convention?
As written in http://websvn.kolibrios.org/filedetails.php?repname=Kolibri+OS&path=%2Fkernel%2Ftrunk%2Fdocs%2Fsysfuncs.txt:
Number of the function is located in the register eax.
The call of the system function is executed by "int 0x40" command.
All registers except explicitly declared in the returned value,
including eflags, are preserved.
Pages: 1
create new reply


Quick reply:

Message:



Currently Active Users:
There are currently 9 user(s) online. 0 member(s) and 9 guest(s)
Most users ever online was 1046, January 28, 2022, 2:08 pm.


Statistics:
Threads: 225 | Posts: 1848 | Members: 51 | Active Members: 51
Welcome to our newest member, yecate
const Copyright = '2011-2024 © OverHertz Ltd. All rights reserved.';
Web development by OverHertz Ltd