Skip to content

Instantly share code, notes, and snippets.

@ecere
ecere / gist:4036174
Created November 8, 2012 02:24
Ecere demo
import "ecere"
class MyView : Window
{
Button b1
{
this, anchor = { top = 200 }, size = { 100, 100 }, caption = "OK", isDefault = true;
bool NotifyClicked(Button button, int x, int y, Modifiers mods)
{
class MyClass
{
SomeClass someThing { }; /* the storage */
public property SomeClass someThing
{
set { delete someThing; someThing = value; incref someThing; }
get { return someThing; }
};
}
import "ecere"
class CustomButton : Button
{
bool dragging;
Point dragStart;
bool OnRightButtonDown(int x, int y, Modifiers mods)
{
dragging = true;
dragStart = { x, y };
import "ecere"
class MyView : Window
{
Button b1
{
this, anchor = { top = 200 }, size = { 100, 100 }, caption = "OK", isDefault = true;
bool NotifyClicked(Button button, int x, int y, Modifiers mods)
{
{
File f = FileOpen("file.txt", read);
if(f)
{
while(!f.eof)
{
char buffer[1024];
if(f.GetLine(buffer, sizeof(buffer)))
PrintLn(buffer);
}
#include "sort.h"
void SRT_Bubble(sort_t *Array, WORD Count)
{
WORD c1,c2;
sort_t tmp;
for(c1=0; c1<Count; c1++)
for(c2=Count-1; c2>c1; c2--)
if(Array[c1].Compared>Array[c2].Compared)
{
import "HTMLView"
class AddressBar : Window
{
background = activeBorder;
EditBox address
{
this, text = "Address", anchor = Anchor { left = 60, right = 60, top = 0, bottom = 0 }, hotKey = altA;
bool NotifyKeyDown(EditBox editBox, Key key, unichar ch)
3ec7cd9 ecere/gui/ColorDropBox: Fixed missing color - Fixed problem introduced by 0faaa3a99957395bcb1a323bf18c8f0e1ffca642
2a10b1b ecere/gfx/fonts: Fixed wrong kerning when using the same face with different sizes
cbe727b compiler/libec: Marking all structs with gcc_struct to get same packed padding as GCC < 4.7
1fe51ec compiler/libec: Fix for debug line numbers in generated C code
9b55c14 ide/Project: Fixed buffer overflows using DynamicString::concatf - As I understand it, the whole point of DynamicString being to avoid buffer overflows, we should either get rid of concatf or fix it ASAP.
import "ecere"
import "console" //typing
import "about" //about
import "help" //help
import "Sounds" //sounds
import "IPPorts" //IP Ports
import "enckey" //encryption keys
import "changename" //change nickname
import "UDP" //ports
import "htmlParser"
import "ecere"
import "Image"
import "Layout"
import "Button"
class LayoutArea : LayoutWindow
{
text = "Rectangle Layout Demo";
background = peru;
borderStyle = sizable; //fixed;