Jump to content
LordJashin

Scar irc client

Recommended Posts

I got bored again.

 

SCAR IRC CLIENT v0.1

---------------------

 

There is a bunch of constants you can set.

 

Here is a list of commands.

 

/connect (server after that), /disconnect, /pause (stops receiver), /resume (starts receiver again), /join or join (#channel after that), /channelonly (uses PRIVMSG inside channel as default (no commands to elsewhere except PRIVMSG), /serveronly (goes back to regular command thingy), /faster (speeds up receiver of IRC), /slower (slows down receiver).

SCAR_IRC_CLIENT.scar

Edited by LordJashin
Link to comment
Share on other sites

Got it, reuploaded it.

 

For SCAR is there a way to auto size controls/form without using OnResize or other event handlers?

 

Autosize / Layout

 

Yes, you should (almost) never use OnResize. Look into the Align, Anchor and Margins properties, it works the same as it does in Delphi, so there should be plenty documentation about it online.

Link to comment
Share on other sites

I don't see how that would be an improvement...

 

Just an idea. I dont see why it would be a bad idea. Could make communicating to other scriptwriters easier, more interactive. I could name quite a few perks, no its not a huge improvement but i could bet some people would find it very useful...

Link to comment
Share on other sites

Yes, you should (almost) never use OnResize. Look into the Align, Anchor and Margins properties, it works the same as it does in Delphi, so there should be plenty documentation about it online.

Well I'm still stuck on that. SCAR has TAnchors but you cant anchor to other controls. TEdit does not use the height attribute AFAIK. Align just anchors to a side. I don't know how to get the TEdit, and TMemo to anchor to each other (not overlap each other), and have everything be resizable without using OnResize. Maybe put a box around them?

 

@Freddy

Also I don't see how SCAR could receive IRC text using TCPReceive, write it to a text box, and not be so laggy. So to be able to type into the chat box, and receive messages on the main text box at the same time would nice.

 

If SCAR was to have IRC for the Scar-divi channel or w/e. It wouldn't be too hard to do. Sort of like how I've done here. Except the username would have to be coded into more. Just in case some1's using it or w/e. That's my opinion on the matter.

Edited by LordJashin
Link to comment
Share on other sites

When creating the form goto anchors, expand the column. Click akleft, aktop, akright, akbottom and set them all to true. Bam you done.

 

 

Example

[scar]

var

Form1: TForm;

Memo1: TMemo;

 

procedure Form1_Init;

begin

Form1 := CreateForm;

Memo1 := TMemo.Create(Form1);

with Form1 do

begin

Left := 376;

Top := 174;

Caption := 'Form1';

ClientHeight := 202;

ClientWidth := 304;

Color := clBtnFace;

Font.Charset := DEFAULT_CHARSET;

Font.Color := clWindowText;

Font.Height := -11;

Font.Name := 'Tahoma';

Font.Style := [];

OldCreateOrder := False;

PixelsPerInch := 96;

end;

with Memo1 do

begin

Parent := Form1;

Left := 20;

Top := 24;

Width := 268;

Height := 160;

Anchors := [akLeft, akTop, akRight, akBottom];

Lines.Add('Memo1');

TabOrder := 0;

end;

end;

 

procedure Form1_SafeInit;

var

v: TVariantArray;

begin

SetLength(v, 0);

ThreadSafeCall('Form1_Init', v);

end;

 

function Form1_ShowModal: Boolean;

begin

Result := Form1.ShowModal = mrOk;

end;

 

function Form1_SafeShowModal: Boolean;

var

v: TVariantArray;

begin

SetLength(v, 0);

Result := ThreadSafeCall('Form1_ShowModal', v);

end;

 

begin

Form1_SafeInit;

if Form1_SafeShowModal then

WriteLn('Form returned modalresult ok');

FreeForm(Form1);

end.

[/scar]

Link to comment
Share on other sites

Well I'm still stuck on that. SCAR has TAnchors but you cant anchor to other controls.

 

I never said I didn't know how to use TAnchors. I don't know how to get a TMemo and TEdit to not overlap each other, and resize correctly without using the OnResize event.

Link to comment
Share on other sites

I never said I didn't know how to use TAnchors. I don't know how to get a TMemo and TEdit to not overlap each other, and resize correctly without using the OnResize event.

 

Oh lol. sorry about that. Its just as easy, Think about it logically, the edit bar is on bottom so it needs to stay at the bottom and stick to the left and right sides. Heres an

 

memo

Anchors := [akLeft, akTop, akRight, akBottom];

 

edit

Anchors := [akLeft, akRight, akBottom];

 

example

 

[scar]

var

Form1: TForm;

Memo1: TMemo;

Edit1: TEdit;

 

procedure Form1_Init;

begin

Form1 := CreateForm;

Memo1 := TMemo.Create(Form1);

Edit1 := TEdit.Create(Form1);

with Form1 do

begin

Left := 376;

Top := 174;

Caption := 'Form1';

ClientHeight := 269;

ClientWidth := 433;

Color := clBtnFace;

Font.Charset := DEFAULT_CHARSET;

Font.Color := clWindowText;

Font.Height := -11;

Font.Name := 'Tahoma';

Font.Style := [];

OldCreateOrder := False;

PixelsPerInch := 96;

end;

with Memo1 do

begin

Parent := Form1;

Left := 8;

Top := 12;

Width := 416;

Height := 220;

Anchors := [akLeft, akTop, akRight, akBottom];

Lines.Add('Memo1');

TabOrder := 0;

end;

with Edit1 do

begin

Parent := Form1;

Left := 8;

Top := 240;

Width := 415;

Height := 21;

Anchors := [akLeft, akRight, akBottom];

TabOrder := 1;

Text := 'Edit1';

end;

end;

 

procedure Form1_SafeInit;

var

v: TVariantArray;

begin

SetLength(v, 0);

ThreadSafeCall('Form1_Init', v);

end;

 

function Form1_ShowModal: Boolean;

begin

Result := Form1.ShowModal = mrOk;

end;

 

function Form1_SafeShowModal: Boolean;

var

v: TVariantArray;

begin

SetLength(v, 0);

Result := ThreadSafeCall('Form1_ShowModal', v);

end;

 

begin

Form1_SafeInit;

if Form1_SafeShowModal then

WriteLn('Form returned modalresult ok');

FreeForm(Form1);

end.

[/scar]

 

 

Edit Side note set the size Constraints MinHeight and MinWidth to how ever big you wish the form to at least be other wise if you go smaller than the controls originally were they will over lap. =p

Edited by shadowrecon
Link to comment
Share on other sites

I didn't realize using TAnchors only really did anything when the form was resized. My bad for not trying harder on this, I sort of gave up after trying everything...but that of course. Dumb moment...

 

Reuploaded again. Now it is flawless :P?

 

=p Its silly little things like that, that can drive someone crazy! J/k. Very nice work again!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
  • Create New...