LordJashin Posted June 18, 2012 Share Posted June 18, 2012 (edited) 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 June 20, 2012 by LordJashin Quote Link to comment Share on other sites More sharing options...
FHannes Posted June 18, 2012 Share Posted June 18, 2012 Nice work, consider aligning the controls on the form, that way they will resize along with the form. Quote Link to comment Share on other sites More sharing options...
LordJashin Posted June 18, 2012 Author Share Posted June 18, 2012 Nice work, consider aligning the controls on the form, that way they will resize along with the form. Got it, reuploaded it. For SCAR is there a way to auto size controls/form without using OnResize or other event handlers? Autosize / Layout Quote Link to comment Share on other sites More sharing options...
FHannes Posted June 18, 2012 Share Posted June 18, 2012 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. Quote Link to comment Share on other sites More sharing options...
shadowrecon Posted June 19, 2012 Share Posted June 19, 2012 Looks good lord! Very nice job! Would be cool if scar had a built in IRC =) Quote Link to comment Share on other sites More sharing options...
FHannes Posted June 19, 2012 Share Posted June 19, 2012 Would be cool if scar had a built in IRC =) I don't see how that would be an improvement... Quote Link to comment Share on other sites More sharing options...
shadowrecon Posted June 19, 2012 Share Posted June 19, 2012 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... Quote Link to comment Share on other sites More sharing options...
LordJashin Posted June 19, 2012 Author Share Posted June 19, 2012 (edited) 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 June 20, 2012 by LordJashin Quote Link to comment Share on other sites More sharing options...
shadowrecon Posted June 20, 2012 Share Posted June 20, 2012 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] Quote Link to comment Share on other sites More sharing options...
LordJashin Posted June 20, 2012 Author Share Posted June 20, 2012 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. Quote Link to comment Share on other sites More sharing options...
shadowrecon Posted June 20, 2012 Share Posted June 20, 2012 (edited) 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 June 20, 2012 by shadowrecon Quote Link to comment Share on other sites More sharing options...
LordJashin Posted June 20, 2012 Author Share Posted June 20, 2012 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 ? Quote Link to comment Share on other sites More sharing options...
shadowrecon Posted June 20, 2012 Share Posted June 20, 2012 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 Its silly little things like that, that can drive someone crazy! J/k. Very nice work again! Quote Link to comment Share on other sites More sharing options...