Jump to content

how to make a main panel??


87052402

Recommended Posts

Host control: LIST

Host style requirements:  The extsel style is required, and the vsbar and hsbar styles should NOT be used. The size style is optional, but recommended.

 

 

MDX control style listing

 

alignleft Specifies that items are left-aligned in icon and small icon view

aligntop Specifies that items are aligned with the top of the control in icon and small icon view

autoarrange Specifies that the icons will be automatically rearranged if the control is resized

editlabels Allows the user to edit item labels by clicking on their text

icon Specifies icon view

list Specifies list view

noheader Specifies that a column header is not displayed in report view. By default, columns have headers in report view

 

nolabelwrap Displays item text on a single line in icon view. By default, item text can wrap in icon view

noscroll Disables scrolling. All items must be within the client area

nosortheader Specifies that column headers do not work like buttons

report Specifies report view

showsel Always show the selection, if any, even if the control does not have the focus

single Allows only one item at a time to be selected. By default, multiple items can be selected. mIRC's extsel list style is still required.

 

smallicon Specifies small icon view

sortascending Sorts items based on item text in ascending order

sortdescending Sorts items based on item text in descending order

droptarget The ListView can act as a target on which files and items from other MDX controls can be dropped

filedragsource The items in the ListView can be dragged as files to Explorer and any other applications that accept files

mdxdragsource The items in the ListView can be dragged to other MDX controls that will accept them, using MDX' internal format. Note that you cannot drag items between running copies of mIRC. However, if you use the filedragsource style, items can be written to a file which can then be read by other copies.

 

The following styles require at least Internet Explorer 3.x to be installed on the user's computer:

 

checkboxes Enables check boxes ( ) for items in the ListView control.

rowselect When an item is selected, the item and the entire row it is in is highlighted. This style is available only in conjunction with the report style.

grid Displays gridlines around items and subitems. This style is available only in conjunction with the report style.

headerdrag Enables drag-and-drop reordering of columns in a ListView control. This style is only available to ListView controls that use the report style.

 

hottrack Enables hot-track selection in a ListView control. Hot track selection means that an item is automatically selected when the cursor remains over the item for a certain period of time.

oneclick The ListView control sends a dclick event to mIRC when the user clicks an item. This style also enables hot tracking in the ListView control.

twoclick The ListView control sends a dclick event to mIRC when the user double-clicks an item. This style also enables hot tracking in the ListView control.

 

The following styles require at least Internet Explorer 4.0 to be installed on the user's computer:

 

infotip Enables the use of custom tooltips for each item (see the tooltip command and the section on adding individual lines to the ListView)

flatsb Enables flat scroll bars in the ListView.

underlinecold Causes non-hot items that are activatable to be displayed with underlined text. This style requires that the twoclick style also be set.

underlinehot Causes hot items that are activatable to be displayed with underlined text. This style requires that the oneclick or twoclick styles also be set.

 

                         

 

The following style requires at least Internet Explorer 5 to be installed on the user's computer:

 

labeltip If a partially hidden label in any ListView mode lacks tooltip text, the ListView control will unfold the label. If this style is not set, the ListView control will unfold partly hidden labels only for the large icon mode.

 

Output page reference

 

What is an output page?

 

Line 1 of the ListView control can be read with $did(), which returns a line in the format of:

 

<last event> <page name> <page data>

 

<page name> is the name of the currently active output page. To read an output page, your script must call the page command before using $did() to read line 1. Most scripts will make an alias to do this. The output pages and their <page data> formats are as follows:

 

headerdims <width>:<pos> <width>:<pos> ...

 

This page is used to retrieve information on the positioning of the columns and their ordering in report view. <width> is the width, in pixels, of a column, and <pos> is the ordering position at which that column resides.

 

headertext <+flags> <icon#> <text>{tab}<+flags> <icon#> ...

 

The headertext page provides more information on the column headers; in this case, the flags, text, and icon that a column and its header have. <icon#> and <text> work the same as they do for regular items.

The available column flags are:

b The icon is displayed on the right of the text instead of the left

l The header and column text are left-justified. This is the default.

c The header and column text are centered

 

r The header and column text are right-justified

 

dragdrop <+flags> <method> <data type> <items> [dialog] [id#]

 

This page is used during a drag and drop operation, when the user drags an object over the ListView control.

 

The available flags are:

 

c The user is holding the "Ctrl" key

s The user is holding the "Shift" key

a The user is holding the "Alt" key

l The user is dragging with the left mouse button

m The user is dragging with the middle mouse button (this may not be possible, but the support exists)

r The user is dragging with the right mouse button

C The dragged data can be copied

M The dragged data can be moved

L The dragged data can be linked to

 

<method> is the default dragging method that will be used when the item is dropped. It can be:

 

none The data will not be dropped

copy The data will be copied (a drag cursor with a  will be displayed)

move The data will be moved (a drag cursor with no extra status will be displayed)

link The data will be linked (a drag cursor with a  will be displayed)

 

<data type> can either be mdx or file, indicating that the data being dragged either came from another MDX control or from a file, respectively.

 

<items> is a count of the number of items being dragged, such as multiple files. Its value should not be trusted until the data is actually dropped.

 

[dialog] and [id#] are only displayed for items which have a <data type> of mdx. They indicate the name of the dialog and the ID of the dialog control from which the items are being dragged. You can use this to determine whether the data should be accepted.

 

begindrag <button>

 

Describes which mouse button was used to begin a drag operation from this control. <button> can either be left or right.

 

enddrag <effect>

 

Describes the end result of a drag operation from this control. <effect> can be move, copy, link, or none.

 

dropinfo <data>

 

Retrieves a data item from data dropped onto the control. This can either be a filename in the case of dragged files, or control-specific data in the case of items dragged from other MDX controls. Use the getdrop command to select which item to retrieve information on.

 

drophilite <item#>

 

Indicates the item currently slated to be the target of a drop operation. It can also be none, meaning that the drag cursor is not over any item.

 

recent <item#>

 

Indicates the item most recently affected by a command sent by a script.

 

event <item#>

 

Indicates the item most recently affected by an event triggered by the user. This is used by several events.

 

headerrecent <col#>

 

Indicates the column most recently affected by a command sent by a script.

 

headerevent <col#>

 

Indicates the column most recently affected by an event triggered by the user.

 

labeledit <text>

 

This page is only valid at the end of a label edit event. It is used to retrieve the text entered by the user.

 

visual <c:txt> <c:txtbg> <c:bg> <type> [layout] [x% y%]

 

This page is used to get information on various visual aspects of the ListView control. <c:txt>, <c:txtbg> and <c:bg> are the colors of the text, text background, and background colors, given in $rgb() format. <c:txt> and <c:txtbg> can also be default, meaning that they are using the default Windows colors, and <c:txtbg> and <c:bg> can be none, meaning they are transparent.

 

<type> is the type of background image the ListView has. It can either be none, meaning no image, or url, meaning the background is an image from a filename or URL. [layout] describes how the image is to be displayed. It can be normal, meaning the image is placed at a specific position in the ListView (usually centered), or tile, meaning the image is tiled to cover the entire background of the control.

 

If [layout] is normal, then [x% y%] are given. They indicate the offset of the background image on the ListView, given in percentage (from 0 to 100).

 

Lastly, is the location (filename or URL) of the background image, if one is to be provided.

 

dimensions <ix iy> <r:item> <r:icon> <r:label> <r:all>

 

Retrieves size and position information on the item and subitem described by the recent and headerrecent output pages.

 

<ix iy> is the position of the upper-left corner of an item, relative to the ListView area.

 

<r:item> is the dimensions (x y w h) of the rectangle encompassing the ListView item, but only in the column described by headerrecent.

 

<r:icon> is the dimensions (x y w h) of the rectangle encompassing the item's icon in the current column.

 

<r:label> is the dimensions (x y w h) of the rectangle encompassing the item's text in the current column.

 

<r:all> is the dimensions (x y w h) of the rectangle encompassing the entire item.

 

itemspacing <sx sy> <ix iy>

 

Retrieves the amount of space between icons in small icon view (<sx sy>) and regular icon view (<ix iy>).

 

origin <x y>

 

Retrieves the coordinates of the ListView's origin. You can use this to calculate an item's position on the screen. It is only valid if the ListView is in icon or small icon mode.

 

mIRC dialog events triggered

 

sclick This event is also used to notify scripts of the majority of ListView MDX events. See below for more details.

dclick The user has activated an item. The definition of "activated" depends on what styles are set for the control. Without the hottrack, oneclick, or twoclick styles, this is just a double click. With the hottrack or oneclick styles, this means that the user clicked on the item once. With the twoclick style, this means that the user clicked on a selected item.

 

Control-specific events triggered

 

The <last event> parameter from a $did() request for line 1 tells you what the last event that caused an sclick (or dclick) was. It can be:

 

none No event

sclick Left single click. The event page indicates which item was clicked, if any.

dclick Item activation, usually left double click. The event page indicates which item was activated. Note that this event only comes up with mIRC's dclick

, separate from other events.

rclick Right single click. The event page indicates which item was clicked, if any.

item An item selection was changed

 

stateclick The user clicked on an item's state icon (this would be the checkbox if the checkboxes style were enabled) The event page indicates which item was clicked, if any.

dragover The user is dragging some data over the control. Your script should call the dropeffect command if it wants to change the drop effect being used. The dragdrop page contains information on the item being dragged.

drop The user has dropped some data onto the ListView. Your script should take appropriate action. The dragdrop page contains information on the item being dropped, and the drophilite page tells which item the data was dropped on to. Your script can call the getdrop command to change which dropped item the dropinfo page should retrieve information on.

 

begindrag The user has begun a drag operation. The begindrag page gives information related to this. Use the dragmethod command to set the drag methods that are valid for the data being dragged. You can use the cancel command to prevent the user from dragging the selected item(s).

enddrag The user has finished a drag operation. The enddrag page gives information related to this.

droptofile The user dragged an item or items to somewhere that needed to treat it as a file.  Your script should write data on the currently selected item(s) to a temporary file or files, and then call the dropfile command to add those files to the data object.

 

beginlabeledit The user has begun editing an item label. The event page indicates which item is being edited. You can use the cancel command to keep the user from editing the label.

endlabeledit The user completed editing of an item label, and your script should process the new text. The event page indicates which item was edited, and the labeledit page indicates the text that the user entered.

 

cancellabeledit The user canceled editing of an item label, either by pressing Escape or not making any changes. The event page indicates which item was being edited at the time.

headerclick The user clicked one of the column header buttons while in report view mode. The headerevent page indicates which column was clicked.

 

Command reference

 

All of the /did commands will work just like they do on a regular mIRC listbox, except:

 

-d Line 1 is not deletable (it is the “special access†line)

-aio Inserting/overwriting to any line other than line 1 should be formatted as follows:

 

 

[indent#] [+flags] [icon#] [overlay#] [state#] [text]{tab}[+flags] [icon#] [overlay#] [state#] [text]{tab}...

 

If you want a specific tooltip for the line, put a $chr(4) at the end and the desired tooltip text after it.

 

The tab character is used to separate items into each column, which are set up by the headers (to be discussed later).

 

The various fields are as follows:

 

indent# Determines how much a line should be indented in report view, measured in icon widths. For example, if you are using small icons and you use an indentation of 1, the line will be positioned 16 pixels over to the right. An indentation of 2 will result in the line being positioned 32 pixels to the right, and so on.

+flags The available flags are:

 

c The item is marked for a cut-and-paste operation. In other words, it appears as 50% opaque, giving it a "ghost" effect.

d The item is highlighted as a drag and drop target.

f The item has the focus. (In other words, the dotted box border)

s The item is selected.

 

icon# Index of the icon to use from the ListView's main icon list. Use 0 for no icon. All icons must be added with the seticon command before they can be used.

overlay# Index of the overlay icon to use for this item. Overlay icons are placed on top of the normal icons, and are generally used to indicate some sort of special status. (Two examples of this are the "shortcut arrow"  and "shared folder"  icons used in Explorer.) Use 0 for no overlay icon.

 

state# Index of the state icon to use from the ListView's state image list. State images are displayed to the left of the main icon. The checkboxes style automatically creates two state images on its own and uses these to simulate checkboxes for items. When the checkboxes style is enabled, items may only have state icons 1 (unchecked) and 2 (checked). Otherwise, you may use 0 to indicate no state icon. All icons must be added with the seticon command before they can be used.

 

text The text to be displayed for the given item.

 

This is the same format that is output when retrieving the text with $did(). Selected lines can be retrieved using $did().sel as normal. However, any lines that are checked off will be represented as a negative value in $did().sel -- in other words, if line 3 (the second line in the list box) is checked off, $did().sel will have -3 somewhere in it.

 

Line 2 is considered the top of the ListView, and as such, all references returned will start from there. A ListView must have at least one header, or the items will not show up.

 

Line 1 is the "special access" line, used to control the list header as well as several other operations. It is used as follows:

 

/did -i <dialog> <id> 1 <operation> [arguments]

 

The operations and their arguments are:

 

page <name>

 

Sets the current output page to <name>.

 

Example:

 

//did -i myDlg 20 1 page event

 

headerdims [width:pos] [width:pos] ...

 

Sets header dimensions of the ListView, for use with report view mode. See the headerdims page for more information. Alternately, you can use auto:all for the arguments to automatically size all columns based on the largest item in each column, or autoheader:all to automatically size all columns based on the text in the headers. By the same token, [width] can be auto or autoheader to achieve the same effect for individual columns.

 

Example:

 

//did -i myDlg 20 1 headerdims 100:2 100:1

 

headertext [+flags] [icon#] [text]{tab}[+flags] [icon#] ...

 

Sets the header of the ListView. See the headertext page for more information on the various fields.

 

Don't forget that a ListView must have at least one header, or the items will not show up.

 

Example:

 

//did -i myDlg 20 1 headertext + 0 Column 1 $+ $chr(9) $+ +r 0 Column 2

 

seticon <normal|state> [icon#] <[index,]filename>

 

Sets or adds an icon to the main icon list or state icon list of the ListView. An icon number of 0 means that the icon is added to the end, whereas an icon number of anything more than 0 means an icon is replaced. If an error occurs when loading an icon, a special "error" icon ( or ) will be loaded in its place. (The FAQ has an explanation on using image lists.)

 

Example:

 

//did -i myDlg 20 1 seticon normal 0 3,c:\windows\progman.exe

 

seticon overlay <icon#> <overlay#>

 

Assigns an overlay index to an icon in the main image list. You can have up to 7 icons as overlays. Use an overlay index of 0 to make an icon no longer an overlay.

 

Example:

 

//did -i myDlg 20 1 seticon overlay 3 1

 

clearicons <normal|state>

 

Clears either the main icon list or the state icon list.

 

Example:

 

//did -i myDlg 20 1 clearicons state

 

setbkg <attrib> [value]

 

Sets some aspect of the ListView background. <attrib> can be:

 

url Sets a background image. Can be a local file or a file from the web. Supports any image format Internet Explorer supports. (GIF, JPG, BMP, etc.) Also requires a layout name after url, which can be:

 

tile image is tiled

normal image is not tiled

 

color Sets the background color to the given RGB value. [value] can be default to use the default color.

none Removes the background image

 

Example:

 

//did -i myDlg 20 1 setbkg url tile http://www.foo.com/bkg.gif

 

settxt <attrib> [RGB value]

 

Sets the text color. <attrib> can be:

 

color Sets the text foreground color

bgcolor Sets the text background color

 

In addition to numeric color values made from $rgb(),  [RGB value] can be default for either attribute, or it can be none for the bgcolor attribute.

 

Examples:

 

//did -i myDlg 20 1 settxt color $rgb(255,0,0)

 

//did -i myDlg 20 1 settxt bgcolor none

 

tooltip <text>

 

If the infotip style is set, sets the default tooltip text, which is shown for items that have no tooltip set already.

 

Example:

 

//did -i myDlg 20 1 tooltip My Tooltip Text

 

cancel

 

Cancels the default effect of certain events.

 

Example:

 

//did -i myDlg 20 1 cancel

 

dropfile <filename>

 

Adds a file to the currently-dropping data object. Only used during a droptofile event.

 

Example:

 

//did -i myDlg 20 1 dropfile $mircdir $+ temp\temp.txt

 

getdrop <index>

 

Changes which data index the dropinfo page should retrieve.

 

Example:

 

//did -i myDlg 20 1 getdrop 4

 

dropeffect <method>

 

Changes the drop effect displayed to the user during a drag and drop operation. <method> can be move, copy, link, or none. Only used during a dragover event.

 

Example:

 

//did -i myDlg 20 1 dropeffect link

 

dragmethod [method] [method] ...

 

Sets the drag methods that are allowed to be used for the data being dragged. [method] can be move, copy, or link. The difference from the dropeffect command is that this command is used when the user is dragging from the control to somewhere else, while dropeffect is used when the user is dragging from somewhere else to this control.

 

Example:

 

//did -i myDlg 20 1 dragmethod move copy

 

labeledit <action>

 

Forces an action related to label editing. <action> can be one of the following:

 

begin <item#> Begins label editing on the specified item

end Ends label editing on the current item being edited

cancel Same as end

 

Examples:

 

//did -i myDlg 20 1 labeledit begin 7

 

//did -i myDlg 20 1 labeledit end

 

setrecent <item>

 

Sets the item retrieved from the recent page. Other pages may use the recent item to retrieve information as well.

 

Example:

 

//did -i myDlg 20 1 setrecent 10

 

setheaderrecent <column>

 

Sets the column retrieved from the headerrecent page. Other pages may use the headerrecent page column to retrieve information as well.

 

Example:

 

//did -i myDlg 20 1 setheaderrecent 3

 

iconspacing <x> <y>

 

Sets the amount of spacing between icons in icon view mode. Note that to avoid overlapping items, this must include the width and height of the icons and text.

 

Example:

 

//did -i myDlg 20 1 iconspacing 40 40

 

arrange <type>

 

Arranges icons in icon view mode. <type> can be:

 

left Align items along the left edge

top Align items along the top edge

default Align items according to the control's current alignment styles

snaptogrid Snaps all icons to the nearest grid position

 

Example:

 

//did -i myDlg 20 1 arrange default

 

setitempos <item> <x> <y>

 

Sets an item's position in icon or smallicon view mode.

 

Example:

 

//did -i myDlg 20 1 setitempos 4 50 50

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...