Add button to example and includes (BCC)

git-svn-id: svn://kolibrios.org@8153 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
maxcodehack 2020-11-06 19:42:52 +00:00
parent 10c141ffd3
commit 9c0ca4f346
5 changed files with 24 additions and 8 deletions

View File

@ -14,6 +14,6 @@ INCLUDE:=$(SVN_BCC32)/include
KOS32_BCC:=/home/autobuild/borlandcpp/bin KOS32_BCC:=/home/autobuild/borlandcpp/bin
# Filename without .cpp # Filename without .cpp
FILENAME:=hello FILENAME:=window
include $(SVN_BCC32)/Makefile_app include $(SVN_BCC32)/Makefile_app

View File

@ -5,7 +5,7 @@
using namespace Kolibri; using namespace Kolibri;
const char header[] = "Title"; const char header[] = "Title";
const char string[] = "Text"; const char string[] = "Exit";
bool KolibriOnStart(TStartData &kos_start, TThreadData th) bool KolibriOnStart(TStartData &kos_start, TThreadData th)
{ {
@ -20,7 +20,8 @@ bool KolibriOnStart(TStartData &kos_start, TThreadData th)
void KolibriOnPaint(void) void KolibriOnPaint(void)
{ {
DrawText(10, 10, 0, string); DrawButton(2,0xB0B0B0, 10,10,50,20);
DrawText(15, 15, 0, string);
} }
bool KolibriOnClose(TThreadData th) bool KolibriOnClose(TThreadData th)
{ {

View File

@ -1,10 +1,10 @@
kos32-bcc -S -v- -R- -6 -a4 -O2 -Og -Oi -Ov -OS -k- -D__KOLIBRI__ -I..\..\..\bcc32\include hello.cpp kos32-bcc -S -v- -R- -6 -a4 -O2 -Og -Oi -Ov -OS -k- -D__KOLIBRI__ -I..\..\..\bcc32\include window.cpp
echo STACKSIZE equ 102400 \n HEAPSIZE equ 102400 \n include "..\..\..\proc32.inc" \ninclude "..\..\..\bcc32\include\kos_start.inc" \n include "..\..\..\bcc32\include\kos_func.inc" \n include "..\..\..\bcc32\include\kos_heap.inc" > kos_make.inc echo STACKSIZE equ 102400 \n HEAPSIZE equ 102400 \n include "..\..\..\proc32.inc" \ninclude "..\..\..\bcc32\include\kos_start.inc" \n include "..\..\..\bcc32\include\kos_func.inc" \n include "..\..\..\bcc32\include\kos_heap.inc" > kos_make.inc
echo include "kos_make.inc" > f_hello.asm echo include "kos_make.inc" > f_window.asm
t2fasm < hello.asm >> f_hello.asm t2fasm < window.asm >> f_window.asm
fasm f_hello.asm hello.kex fasm f_window.asm window.kex
kpack hello.kex kpack window.kex
del kos_make.inc del kos_make.inc
pause pause

View File

@ -37,6 +37,7 @@ namespace Kolibri // All kolibri functions, types and data are nested in the (
// Note: pass only thread data of current thread as (thread_data) parameter to these functions. // Note: pass only thread data of current thread as (thread_data) parameter to these functions.
void Main(); // Main function is called at program startup. void Main(); // Main function is called at program startup.
void DrawButton(long id, long color, long x, long y, long c_x, long c_y); // Draw Standard button
void* ThreadMain(void *user = 0, void *stack_begin = 0); void* ThreadMain(void *user = 0, void *stack_begin = 0);
// Called at thread startup, (user) is placed in thread data as a user dword, // Called at thread startup, (user) is placed in thread data as a user dword,
//_ (stack_begin) is placed in thread data as a stack beginning. //_ (stack_begin) is placed in thread data as a stack beginning.

View File

@ -485,6 +485,20 @@ proc @Kolibri@GetPackedTime$qv
ret ret
endp endp
proc @Kolibri@DrawButton$qllllll uses ebx esi
mov eax,8
mov ebx,[esp+12+8]
shl ebx,16
mov bx,[esp+20+8]
mov ecx,[esp+16+8]
shl ecx,16
mov cx,[esp+24+8]
mov edx,[esp+4+8]
mov esi,[esp+8+8]
int 0x40
ret
endp
proc @Kolibri@GetTime$qpi proc @Kolibri@GetTime$qpi
mov eax,3 mov eax,3
int 0x40 int 0x40