Recent Posts

Pages: [1] 2 3 ... 10
1
User Offerings / Listview color
« Last post by Andy on January 10, 2019, 04:09:21 AM »
Thought I'd post this one.

It shows you how you can highlight an item(s) in a list view with a colour.

To use it, simply type in a letter in the edit box  - C or O or P etc, and use the > and < buttons to navigate to the next name that has that letter in it.

And of course, you can use words as well like COPY, LOOP etc.

Many many thanks to both Brian and Bill for the big hand up on this one!

Think this needs to be posted as it's different from the listview no resize example, as here it highlights items without you having to click on them.

Thought it will come in use for many of us at some time.

Andy.
 :)
2
General Questions / Re: Listview colour
« Last post by Andy on January 09, 2019, 04:35:29 AM »
Larry,

Thanks for that, yes I know about the listview no resize example, but it only gets me so far.

Brian and Bill have emailed examples and after looking at both (thanks guys!) I'm trying Brian's code as it's the easier of the two and I'm getting there with it.

just need to figure out how to reset all items to their default colour now.

Thanks,
Andy.
 :)
3
General Questions / Re: Listview colour
« Last post by LarryMc on January 08, 2019, 01:05:50 PM »
this program shows how to color a cell in a listview
4
General Questions / Listview colour
« Last post by Andy on January 08, 2019, 07:11:29 AM »
Well I'm just playing around with the constants search program to see if I can make it even easier to use.

I came upon an idea where you could search the list view for part of a constant name e.g. "SET".

Now I use LVM_ENSUREVISIBLE to make the list view scroll down to the first instance of "SET" it finds in the constants names, but I'm not actually selecting the position as this would add it to the search history - and I don't want that.

I know there is an example of setting a row of a list view colour in the examples for IWB, but that depends on the user clicking the list.

So the question is... can I set the list view row with a colour without a click?

Attached is the constants search program V6.2

To use it, you will see two edit boxes at the bottom of the screen, set your option 1 search to WINDOWS and MESSAGES
then in the second edit box (next to "<" " >" at the bottom) type in SET - you will see it jump to the first instance of the word "SET" in the listed constants names.

But I would love to be able to colour this row.

Can this be done?

Line No 884 is where it does the search.

Thanks,
Andy.
 :)
5
The Roundtable / Simple Colour Wheel: Update
« Last post by Brian Pugh on January 08, 2019, 04:41:03 AM »
Well, after spending most of the weekend in bed with flu, I'm up and about now, although I have an appointment with the doctor this dinnertime. Anyway, I had some time to think of some updates to the Colour Wheel program, and here we are. Bit simpler code, and a tidy up, as well

Brian
6
2D/3D / Re: DirectX Line drawing
« Last post by GWS on January 06, 2019, 07:02:55 PM »
Hi folks,

After a bit more testing - and a new graphics card ..  ::) I think I've resolved the problem ..

It's down to the already known problems of incompatibility of Direct X screens with normal windows controls.  For instance Button controls cannot be relied upon to work in a DX environment. You would need to draw and handle your own buttons.

Similarly, lines drawn in a windowed DX screen, occasionally exhibit visible gaps.

If the DX screen is full screen (ie. the bits per pixel setting is specified), the lines are pretty well perfect.  Just slight anti-aliasing occurs.

I include my modified DXLines pogram which demonstrates the effects.

It sets the bits per pixel to 32 in the CreateScreen statement to create a fullsize DX screen - the lines are now pretty good, but of course the Windows menu control is lost.  Hence the need to press Q to exit.

If you then temporarily remove the 32 bpp from the CreateScreen statement, you get a Windowed DX screen - but the lines are not so good.

The conclusion is - keep DX screens separate from ordinary Windows.  They don't get on well together.

Here's my modified program ..

Code: [Select]
' the DirectX lines sample program
' displays random lines

autodefine "off"

IF GETDXVERSION < 7
MESSAGEBOX 0,"This program requires" + chr$(13) + "DirectX 7.0 or greater","Error"
END
ENDIF

declare "kernel32",GetTickCount(),int

DEF win:window
DEF size,tstart,run:int
def wW,wH:int

wW = 1024
wH = 768

'open a window and add a menu
WINDOW win,0,0,wW,wH,@SIZE|@MINBOX|@MAXBOX|@CAPTION|@NOAUTODRAW,0,"Lines ala DirectX",mainwindow
MENU win,"T,Options,0,0","I,Clear,0,1","S,Line Size,0,0","I,1,0,2,","I,2,0,3","I,3,0,4","^I,Quit,0,5"

IF CREATESCREEN(win,wW,wH,32) < 0 :' Note: the 32 bbp creates a full size DX screen without the menu

' try temporarily removing the 32 bpp value to get a windowed screen
' Note the slight incompatibility of the DX screen with Windows -
' the lines are often incomplete, and the close window icon is erratic.

MESSAGEBOX win, "Could not create DirectX screen","Error"
CLOSEWINDOW win
END
ENDIF

setfont win, "arial", 14, 600
frontpen win,rgb(0,250,0)
drawmode win,@TRANSPARENT

size = 1
SETLINESTYLE win,@LSSOLID,size

run = 1

gosub Draw :' draw first group of lines

waituntil run = 0
closewindow win
end

'this is the handler subroutine for the window
sub mainwindow
SELECT @class
case @IDCREATE
centerwindow win
case @idclosewindow
run = 0
case @idchar
if (@CODE = ASC("Q")) | (@CODE = ASC("q")) then run = 0

case @iddxupdate
' draw new random lines every 4 sec update
if ((GetTickCount() - tstart) >= 4000) then Draw

case @IDMENUPICK
SELECT @MENUNUM
CASE 1
RECT win,0,0,wW,wH,RGB(55,55,55),RGB(55,55,55)
CASE 2
CASE 3
CASE 4
SETLINESTYLE win,@LSSOLID,@MENUNUM - 1
size = @MENUNUM - 1
CASE 5
run = 0
ENDSELECT
case @IDMENUINIT
CHECKMENUITEM win,2,size = 1
CHECKMENUITEM win,3,size = 2
CHECKMENUITEM win,4,size = 3
ENDSELECT
RETURN

sub Draw
' draw random lines
dxfill win,RGB(35,35,35) :' start with a new grey background
move win, 40, 20
print win, "Press Q to Quit"

for i = 1 to 20 :' draw 20 random lines
line win,rnd(wW),rnd(wH),rnd(wW),rnd(wH),RGB(rnd(255),rnd(255),rnd(255))
next i

dxflip win,1 :' specifying the 1 tells dxflip not to wait for vertical sync
tstart = GetTickCount() :' set new start time

return


Best wishes, :)

Graham




7
The Roundtable / Re: Simple Colour Wheel
« Last post by billhsln on January 03, 2019, 12:37:08 PM »
Not sure how simple this will be, but when the circle gets very dark, maybe change the color to a lighter color for the RGB value or move where it displays the RGB Color to outside of the circle, so you won't need to worry about the color of the circle.

Bill
8
The Roundtable / Simple Colour Wheel
« Last post by Brian Pugh on January 03, 2019, 11:34:03 AM »
Hi,

I thought I would have a stab at a simple Colour Wheel. Put all three files in a folder, and compile. Adjust the three colours as needed. You can then send the RGB result to the Clipboard. You can also reset the trackbars with one click to save you from having to manually adjust them

The trackbars do look better with the manifest file present, but it will run without the manifest file

As always, any ideas or changes, please feel free to comment

Brian

Updated 04/01/2019 with code changes and bitmap modification
9
Shared INC's and LIB's / Re: Constants search Program version 6.0 - A special.
« Last post by Andy on December 28, 2018, 04:38:39 AM »
Your very welcome!

It didn't take too long either, so I was glad about that.

I will still play around with the program, and I have a beta version of version 6.1 so that when you click the "X" close navigation box it goes back to what you were viewing / searching for before you selected a navigation button, i.e. restores the list view contents etc.

I'm still testing this one, looks okay, but if anyone wants a copy please message me.

Thanks,
Andy.
 :)



10
Shared INC's and LIB's / Re: Constants search Program version 6.0 - A special.
« Last post by fasecero on December 27, 2018, 10:20:56 AM »
That's exactly what I wanted. Thanks!  :)
Pages: [1] 2 3 ... 10