* * *

Recent Posts

Pages: [1] 2 3 ... 10
General / Re: Generate every possible string combination from TStringLists
« Last post by taazz on Today at 06:28:59 am »
yeah sorry it does not help at all. The data are there but I do not see any foolproof way to get them. You need to first write a couple of helper functions
1) function GetArmorType(aArmor:String):TArmorType;
2) Function AllowedPiece(const aCombination:array of TArmortype; aNewPiece:TArmortype):Boolean;
TArmorType should be something along the lines of
Code: Pascal  [Select]
  1. TArmorPiece = (chest, shoulder, Leg, head);
  2. TPiecePlacement=(Left, right, none);
  3. TArmorType = record
  4.   Armor :String;
  5.   ArmorPiece:TArmorPiece;
  6.   PiecePlacement:TPiecePlacement;
  7. end;
Given any description you should be able to create a record and check it against the records already selected in the current list.
After that you create a recursive procedure that will drill down the same list over and over again, something along the lines of
Code: [Select]
//pseudo Code
procedure Combine(const CurrentCombination:array of TArmorType; Const OutList:TStringList; const ArmorPieces:TStringList);
  vNewCombination:Array OF TArmorType;
  if assigned(CurrentCombination) then begin
    setLEngth(vNewCombination, length(CurrentCombination)+1);
   copyData to vNewCombination from CurrentCombination;
  end else
    SetLength(vNewCombination, 1);
  for vCntr := 0 to ArmorPieces.Count-1 do begin
     vType := getArmorType(ArmorPieces.Strings[vCntr]);
     if AllowedPiece(CurrentCombination,vType) then begin
         change the last item in vCurrentCombination to  vType;
         Combine(vNewCombination, outlist, ArmorPieces);
//outlist holds the accepted combinations.
//ArmorPieces has all the Armor pieces you can combine.
This way should produce the most complete list, you use a lot of memory and cpu time. there are ways to make it faster but implement the simplest case first and ask again if you need more speed.
Third party / Re: CudaText for Raspberry Pi 3
« Last post by Alextp on Today at 06:26:30 am »
1- Autocompletions calculated on Py level. it may be Py-thread, if plugin wants to do thread.
2- PHP long time - what plugin is it?
I dont know plugin for CudaText for PHP completions.
So must know name of plugin.

(plugin must limit count of items for completions.)
Third party / Re: CudaText for Raspberry Pi 3
« Last post by Leledumbo on Today at 06:04:52 am »
Has the autocompletion been separated into its own thread/process? I once tested it for a PHP project with thousands of files and every invocation of autocompletion locks the editor for about a minute because of it. Debugging the code, I found that the plugin builds 1 HUGE string (super slow operation in languages like Python) first before it's parsed to form the popup listbox.
General / Re: Resizing (8 little-squares) Handles on Controls/Objects
« Last post by taazz on Today at 05:57:39 am »
TSizeControl v.7.2 by Angus Johnson. If I remember correctly this can be used as is in lazarus.

TJuhasResizeNodes v.1 by Juhas Software.  I think juha is a member of the lazarus team not sure though, if it is the same person then I bet that this will work on lcl as well.
Linux / Re: Getting console output as string
« Last post by Leledumbo on Today at 05:55:08 am »
I've tryed many things. Finaly got it working :)
Thank you!
"  AProcess.Parameters.Add('-c');" was the missing part in my tests :)
This code is prone to buffer deadlock, better use runcommand or its brothers.
C:\lazarus164\L1\sTable.pas(212,69) Error: (3337) Default values can only be specified for value, const and constref parameters
I set default value to a var parameter !
The error message clearly doesn't mention var parameters and that is logical (it's passed by reference, default value conceptually doesn't have memory address to be passed as reference).
Okay... here is my crude resize handles using the canvas.

I can easily show or hide the handles & marquee when clicking on/off object.
I need to clean it up, but good enough for now.


1) This is drawn on a canvas on the form. So, if I had multiple objects that overlapped, an object could cover the canvas drawing. This would be a problem.

2) How do I go about hovering and dragging a "painted object" that isn't actually there.

Well, its a start.... still learning how to do this.

See attached...
you need to provide the data for the string lists. I guess that some data (eg shoulder, leg etc) are part of the same list?

Aah yeah, my bad. At the moment, it's just got the one character. There'll be others with a different number of text files, due to the way the armour's done. To explain:

Chest pieces shouldn't be mixed with other chest pieces, helmets shouldn't be mixed with other helmets. There would be one Chests.txt, and one Helmets.txt, and these wouldn't be mixed.

Left hand gloves should be mixed with right hand gloves, left pauldrons, right pauldrons, left arm guards, right arm guards. There would be one big txt file containing these.

Figured that would be the best way to organize it all.

Anyway, here's the Head.txt file:

Code: [Select]

And here's the Shoulders.txt file:

Code: [Select]

The Heads.txt is not to be, err, "intra-mixed", so I put that in the first loop. In plain English, I was aiming "For each helmet, get every possible shoulder combination."
General / Resizing (8 little-squares) Handles on Controls/Objects
« Last post by technipixel on Today at 03:08:50 am »
I am experimenting with moving controls on a form... that works.

However, I want to be able to manually resize a control using those little squares that surround an object.
You know, kind of what they do in graphic programs.

I am thinking of using the drawing features, but not sure if that is the best way.
Can anyone shed any light on what THE BEST way to go about this would be?

Thanks in Advanced.
General / Re: Generate every possible string combination from TStringLists
« Last post by taazz on Today at 02:57:08 am »
you need to provide the data for the string lists. I guess that some data (eg shoulder, leg etc) are part of the same list?
Pages: [1] 2 3 ... 10


Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus